diff options
author | Brian Behlendorf <[email protected]> | 2012-09-14 09:36:40 -0700 |
---|---|---|
committer | Brian Behlendorf <[email protected]> | 2012-09-14 15:53:47 -0700 |
commit | 8312c6df55c1fb2ad3536fc3bc7ae93c429b85aa (patch) | |
tree | e43b8bae131de24374dc4287dd1c73b1b90d51e8 | |
parent | 8e8e7f35b71e7aa88f5e45bf1594bcc75526227d (diff) |
Clear PG_writeback for sync I/O error case
Commit 2b2861362f7dd09cc3167df8fddb6e2cb475018a 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
-rw-r--r-- | module/zfs/zfs_vnops.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/module/zfs/zfs_vnops.c b/module/zfs/zfs_vnops.c index 300330231..89f0f608a 100644 --- a/module/zfs/zfs_vnops.c +++ b/module/zfs/zfs_vnops.c @@ -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); } |