aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSage Weil <sage@newdream.net>2010-11-07 09:39:00 -0800
committerSage Weil <sage@newdream.net>2010-11-07 09:39:23 -0800
commitfeb4cc9bb433bf1491ac5ffbba133f3258dacf06 (patch)
tree6339043d3fd867683459d9dc33f146b2f7e37d75
parent912a9b0319a8eb9e0834b19a25e01013ab2d6a9f (diff)
downloadmrst-s0i3-test-feb4cc9bb433bf1491ac5ffbba133f3258dacf06.tar.gz
mrst-s0i3-test-feb4cc9bb433bf1491ac5ffbba133f3258dacf06.tar.xz
mrst-s0i3-test-feb4cc9bb433bf1491ac5ffbba133f3258dacf06.zip
ceph: re-request max_size if cap auth changes
If the auth cap migrates to another MDS, clear requested_max_size so that we resend any pending max_size increase requests. This fixes potential hangs on writes that extend a file and race with an cap migration between MDSs. Signed-off-by: Sage Weil <sage@newdream.net>
-rw-r--r--fs/ceph/caps.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/fs/ceph/caps.c b/fs/ceph/caps.c
index 6e0942f33dd..04b207b0c84 100644
--- a/fs/ceph/caps.c
+++ b/fs/ceph/caps.c
@@ -2689,6 +2689,11 @@ static void handle_cap_import(struct ceph_mds_client *mdsc,
NULL /* no caps context */);
try_flush_caps(inode, session, NULL);
up_read(&mdsc->snap_rwsem);
+
+ /* make sure we re-request max_size, if necessary */
+ spin_lock(&inode->i_lock);
+ ci->i_requested_max_size = 0;
+ spin_unlock(&inode->i_lock);
}
/*