aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ceph/mds_client.c
diff options
context:
space:
mode:
authorSage Weil <sage@newdream.net>2010-05-14 09:35:38 -0700
committerSage Weil <sage@newdream.net>2010-05-17 10:25:45 -0700
commit81a6cf2d30eac5d790f53cdff110892f7b18c7fe (patch)
tree9dcc1d4492b8736cda6a007a4a1c076048bd87af /fs/ceph/mds_client.c
parentceph: fix race between aborted requests and fill_trace (diff)
downloadlinux-dev-81a6cf2d30eac5d790f53cdff110892f7b18c7fe.tar.xz
linux-dev-81a6cf2d30eac5d790f53cdff110892f7b18c7fe.zip
ceph: invalidate affected dentry leases on aborted requests
If we abort a request, we return to caller, but the request may still complete. And if we hold the dir FILE_EXCL bit, we may not release a lease when sending a request. A simple un-tar, control-c, un-tar again will reproduce the bug (manifested as a 'Cannot open: File exists'). Ensure we invalidate affected dentry leases (as well dir I_COMPLETE) so we don't have valid (but incorrect) leases. Do the same, consistently, at other sites where I_COMPLETE is similarly cleared. Signed-off-by: Sage Weil <sage@newdream.net>
Diffstat (limited to 'fs/ceph/mds_client.c')
-rw-r--r--fs/ceph/mds_client.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/fs/ceph/mds_client.c b/fs/ceph/mds_client.c
index c0568fe3c0ba..76995a960432 100644
--- a/fs/ceph/mds_client.c
+++ b/fs/ceph/mds_client.c
@@ -1732,12 +1732,17 @@ int ceph_mdsc_do_request(struct ceph_mds_client *mdsc,
struct ceph_inode_info *ci =
ceph_inode(req->r_locked_dir);
- dout("aborted, clearing I_COMPLETE on %p\n",
+ dout("aborted, clearing I_COMPLETE on %p, leases\n",
req->r_locked_dir);
spin_lock(&req->r_locked_dir->i_lock);
ci->i_ceph_flags &= ~CEPH_I_COMPLETE;
ci->i_release_count++;
spin_unlock(&req->r_locked_dir->i_lock);
+
+ if (req->r_dentry)
+ ceph_invalidate_dentry_lease(req->r_dentry);
+ if (req->r_old_dentry)
+ ceph_invalidate_dentry_lease(req->r_old_dentry);
}
} else {
err = req->r_err;