Skip to content

Commit

Permalink
Clear PG_writeback for sync I/O error case
Browse files Browse the repository at this point in the history
Commit 2b28613 accidentally
introduced this issue by only conditionally registering the
commit callback in the async case.

The error handing code for the dmu_tx_assign() failure case
relied on there always being a registered commit callback to
clear the PG_writeback bit.  Since that is no longer strictly
true for the synchronous case we must explicitly invoke the
callback.

Signed-off-by: Brian Behlendorf <[email protected]>
Closes #961
  • Loading branch information
behlendorf committed Sep 14, 2012
1 parent 8e8e7f3 commit 8312c6d
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions module/zfs/zfs_vnops.c
Original file line number Diff line number Diff line change
Expand Up @@ -3848,7 +3848,16 @@ zfs_putpage(struct inode *ip, struct page *pp, struct writeback_control *wbc)
if (err == ERESTART)
dmu_tx_wait(tx);

/* Will call all registered commit callbacks */
dmu_tx_abort(tx);

/*
* For the synchronous case the commit callback must be
* explicitly called because there is no registered callback.
*/
if (sync)
zfs_putpage_commit_cb(pp, ECANCELED);

return (err);
}

Expand Down

0 comments on commit 8312c6d

Please sign in to comment.