Clear PG_writeback for sync I/O error case

Commit 2b2861362f 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 <behlendorf1@llnl.gov>
Closes #961
This commit is contained in:
Brian Behlendorf 2012-09-14 09:36:40 -07:00
parent 8e8e7f35b7
commit 8312c6df55

View File

@ -3848,7 +3848,16 @@ zfs_putpage(struct inode *ip, struct page *pp, struct writeback_control *wbc)
if (err == ERESTART) if (err == ERESTART)
dmu_tx_wait(tx); dmu_tx_wait(tx);
/* Will call all registered commit callbacks */
dmu_tx_abort(tx); 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); return (err);
} }