aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ceph/inode.c
diff options
context:
space:
mode:
authorSage Weil <sage@newdream.net>2010-01-25 14:33:08 -0500
committerSage Weil <sage@newdream.net>2010-01-25 14:49:51 -0500
commit5b1daecd59f95eb24dc629407ed80369c9929520 (patch)
tree19b5d4e11427350f48947df8dca453069ed0a0d5 /fs/ceph/inode.c
parent3ea25f9441fc0951ada649105f2c57a59536b539 (diff)
ceph: properly handle aborted mds requests
Previously, if the MDS request was interrupted, we would unregister the request and ignore any reply. This could cause the caps or other cache state to become out of sync. (For instance, aborting dbench and doing rm -r on clients would complain about a non-empty directory because the client didn't realize it's aborted file create request completed.) Even we don't unregister, we still can't process the reply normally because we are no longer holding the caller's locks (like the dir i_mutex). So, mark aborted operations with r_aborted, and in the reply handler, be sure to process all the caps. Do not process the namespace changes, though, since we no longer will hold the dir i_mutex. The dentry lease state can also be ignored as it's more forgiving. Signed-off-by: Sage Weil <sage@newdream.net>
Diffstat (limited to 'fs/ceph/inode.c')
-rw-r--r--fs/ceph/inode.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/fs/ceph/inode.c b/fs/ceph/inode.c
index 518beb628f09..71e107fb4dbc 100644
--- a/fs/ceph/inode.c
+++ b/fs/ceph/inode.c
@@ -915,6 +915,16 @@ int ceph_fill_trace(struct super_block *sb, struct ceph_mds_request *req,
915 } 915 }
916 916
917 if (rinfo->head->is_dentry) { 917 if (rinfo->head->is_dentry) {
918 struct inode *dir = req->r_locked_dir;
919
920 err = fill_inode(dir, &rinfo->diri, rinfo->dirfrag,
921 session, req->r_request_started, -1,
922 &req->r_caps_reservation);
923 if (err < 0)
924 return err;
925 }
926
927 if (rinfo->head->is_dentry && !req->r_aborted) {
918 /* 928 /*
919 * lookup link rename : null -> possibly existing inode 929 * lookup link rename : null -> possibly existing inode
920 * mknod symlink mkdir : null -> new inode 930 * mknod symlink mkdir : null -> new inode
@@ -932,12 +942,6 @@ int ceph_fill_trace(struct super_block *sb, struct ceph_mds_request *req,
932 BUG_ON(ceph_snap(dir) != 942 BUG_ON(ceph_snap(dir) !=
933 le64_to_cpu(rinfo->diri.in->snapid)); 943 le64_to_cpu(rinfo->diri.in->snapid));
934 944
935 err = fill_inode(dir, &rinfo->diri, rinfo->dirfrag,
936 session, req->r_request_started, -1,
937 &req->r_caps_reservation);
938 if (err < 0)
939 return err;
940
941 /* do we have a lease on the whole dir? */ 945 /* do we have a lease on the whole dir? */
942 have_dir_cap = 946 have_dir_cap =
943 (le32_to_cpu(rinfo->diri.in->cap.caps) & 947 (le32_to_cpu(rinfo->diri.in->cap.caps) &