From 8312c6df55c1fb2ad3536fc3bc7ae93c429b85aa Mon Sep 17 00:00:00 2001 From: Brian Behlendorf Date: Fri, 14 Sep 2012 09:36:40 -0700 Subject: 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 Closes #961 --- module/zfs/zfs_vnops.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'module') 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); } -- cgit v1.2.3