summaryrefslogtreecommitdiff
path: root/fs/ceph/caps.c
diff options
context:
space:
mode:
authorYan, Zheng <zyan@redhat.com>2015-07-01 16:27:46 +0800
committerIlya Dryomov <idryomov@gmail.com>2015-09-08 23:14:28 +0300
commit48fec5d0a504dfbb302cb1dd24ebb0b82a46cce9 (patch)
tree41b4e0cf38951bf49372e1272a08c8264bf3d943 /fs/ceph/caps.c
parent64291f7db5bd8150a74ad2036f1037e6a0428df2 (diff)
downloadlinux-48fec5d0a504dfbb302cb1dd24ebb0b82a46cce9.tar.gz
linux-48fec5d0a504dfbb302cb1dd24ebb0b82a46cce9.tar.xz
ceph: EIO all operations after forced umount
This patch makes try_get_cap_refs() and __do_request() check if the file system was forced umount, and return -EIO if it was. This patch also adds a helper function to drops dirty caps and wakes up blocking operation. Signed-off-by: Yan, Zheng <zyan@redhat.com>
Diffstat (limited to 'fs/ceph/caps.c')
-rw-r--r--fs/ceph/caps.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/fs/ceph/caps.c b/fs/ceph/caps.c
index ddd5e9471290..27b566874bc1 100644
--- a/fs/ceph/caps.c
+++ b/fs/ceph/caps.c
@@ -2413,6 +2413,14 @@ again:
goto out_unlock;
}
+ if (!__ceph_is_any_caps(ci) &&
+ ACCESS_ONCE(mdsc->fsc->mount_state) == CEPH_MOUNT_SHUTDOWN) {
+ dout("get_cap_refs %p forced umount\n", inode);
+ *err = -EIO;
+ ret = 1;
+ goto out_unlock;
+ }
+
dout("get_cap_refs %p have %s needed %s\n", inode,
ceph_cap_string(have), ceph_cap_string(need));
}