Skip to content

Commit

Permalink
To re-run quota check when EFAULT in zfs_write
Browse files Browse the repository at this point in the history
Signed-off-by: Grady Wong <[email protected]>
  • Loading branch information
Grady Wong committed Oct 5, 2018
1 parent 4530de4 commit cc157bc
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 5 deletions.
1 change: 1 addition & 0 deletions module/zfs/dmu.c
Original file line number Diff line number Diff line change
Expand Up @@ -1524,6 +1524,7 @@ dmu_write_uio_dnode(dnode_t *dn, uio_t *uio, uint64_t size, dmu_tx_t *tx,
* to lock the pages in memory, so that uiomove won't
* block.
*/
uio->uio_fault_disable = fault_disable;
err = uiomove((char *)db->db_data + bufoff, tocpy,
UIO_WRITE, uio);

Expand Down
1 change: 0 additions & 1 deletion module/zfs/dmu_tx.c
Original file line number Diff line number Diff line change
Expand Up @@ -1040,7 +1040,6 @@ dmu_tx_assign(dmu_tx_t *tx, uint64_t txg_how)
return (0);
}


void
dmu_tx_wait(dmu_tx_t *tx)
{
Expand Down
6 changes: 2 additions & 4 deletions module/zfs/zfs_vnops.c
Original file line number Diff line number Diff line change
Expand Up @@ -763,9 +763,7 @@ zfs_write(struct inode *ip, uio_t *uio, int ioflag, cred_t *cr)
/*
* Start a transaction.
*/
dmu_tx_t *tx = NULL;
top:
tx = dmu_tx_create(zfsvfs->z_os);
dmu_tx_t *tx = dmu_tx_create(zfsvfs->z_os);
dmu_tx_hold_sa(tx, zp->z_sa_hdl, B_FALSE);
dmu_tx_hold_write(tx, zp->z_id, woff, MIN(n, max_blksz));
zfs_sa_upgrade_txholds(tx, zp);
Expand Down Expand Up @@ -816,7 +814,7 @@ zfs_write(struct inode *ip, uio_t *uio, int ioflag, cred_t *cr)
if (error == EFAULT) {
uio_prefaultpages(MIN(n, max_blksz), uio);
dmu_tx_commit(tx);
goto top;
continue;
} else if (error != 0) {
dmu_tx_abort(tx);
break;
Expand Down

0 comments on commit cc157bc

Please sign in to comment.