diff options
author | Yan, Zheng <zyan@redhat.com> | 2015-07-01 04:27:46 -0400 |
---|---|---|
committer | Ilya Dryomov <idryomov@gmail.com> | 2015-09-08 16:14:28 -0400 |
commit | 48fec5d0a504dfbb302cb1dd24ebb0b82a46cce9 (patch) | |
tree | 41b4e0cf38951bf49372e1272a08c8264bf3d943 /fs/ceph/caps.c | |
parent | 64291f7db5bd8150a74ad2036f1037e6a0428df2 (diff) |
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.c | 8 |
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: | |||
2413 | goto out_unlock; | 2413 | goto out_unlock; |
2414 | } | 2414 | } |
2415 | 2415 | ||
2416 | if (!__ceph_is_any_caps(ci) && | ||
2417 | ACCESS_ONCE(mdsc->fsc->mount_state) == CEPH_MOUNT_SHUTDOWN) { | ||
2418 | dout("get_cap_refs %p forced umount\n", inode); | ||
2419 | *err = -EIO; | ||
2420 | ret = 1; | ||
2421 | goto out_unlock; | ||
2422 | } | ||
2423 | |||
2416 | dout("get_cap_refs %p have %s needed %s\n", inode, | 2424 | dout("get_cap_refs %p have %s needed %s\n", inode, |
2417 | ceph_cap_string(have), ceph_cap_string(need)); | 2425 | ceph_cap_string(have), ceph_cap_string(need)); |
2418 | } | 2426 | } |