summaryrefslogtreecommitdiffstats
path: root/fs/ceph/caps.c
diff options
context:
space:
mode:
authorYan, Zheng2015-04-27 09:33:28 +0200
committerIlya Dryomov2015-06-25 10:49:28 +0200
commit10183a69551f76702ac68bc74a437b25419c6de0 (patch)
tree06e48d196c31f31eef6f039bce518ff3973b2760 /fs/ceph/caps.c
parentlibceph: allow setting osd_req_op's flags (diff)
downloadkernel-qcow2-linux-10183a69551f76702ac68bc74a437b25419c6de0.tar.gz
kernel-qcow2-linux-10183a69551f76702ac68bc74a437b25419c6de0.tar.xz
kernel-qcow2-linux-10183a69551f76702ac68bc74a437b25419c6de0.zip
ceph: check OSD caps before read/write
Signed-off-by: Yan, Zheng <zyan@redhat.com>
Diffstat (limited to 'fs/ceph/caps.c')
-rw-r--r--fs/ceph/caps.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/fs/ceph/caps.c b/fs/ceph/caps.c
index be5ea6af8366..7c8e93aeb01e 100644
--- a/fs/ceph/caps.c
+++ b/fs/ceph/caps.c
@@ -2233,6 +2233,10 @@ int ceph_get_caps(struct ceph_inode_info *ci, int need, int want,
{
int _got, check_max, ret, err = 0;
+ ret = ceph_pool_perm_check(ci, need);
+ if (ret < 0)
+ return ret;
+
retry:
if (endoff > 0)
check_max_size(&ci->vfs_inode, endoff);