diff options
author | Yan, Zheng <zheng.z.yan@intel.com> | 2013-07-21 14:25:25 +0200 |
---|---|---|
committer | Sage Weil <sage@inktank.com> | 2013-08-10 02:54:32 +0200 |
commit | ad88f23f42a9b34a0b29a5b19d37251ccb7dd776 (patch) | |
tree | 730810dccdd6eb2fff76d831356edcee8d537bed /fs/ceph/dir.c | |
parent | ceph: fix null pointer dereference (diff) | |
download | linux-ad88f23f42a9b34a0b29a5b19d37251ccb7dd776.tar.xz linux-ad88f23f42a9b34a0b29a5b19d37251ccb7dd776.zip |
ceph: drop CAP_LINK_SHARED when sending "link" request to MDS
To handle "link" request, the MDS need to xlock inode's linklock,
which requires revoking any CAP_LINK_SHARED.
Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com>
Reviewed-by: Sage Weil <sage@inktank.com>
Diffstat (limited to 'fs/ceph/dir.c')
-rw-r--r-- | fs/ceph/dir.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/fs/ceph/dir.c b/fs/ceph/dir.c index f02d82b7933e..0e4da4a9c213 100644 --- a/fs/ceph/dir.c +++ b/fs/ceph/dir.c @@ -796,6 +796,8 @@ static int ceph_link(struct dentry *old_dentry, struct inode *dir, req->r_locked_dir = dir; req->r_dentry_drop = CEPH_CAP_FILE_SHARED; req->r_dentry_unless = CEPH_CAP_FILE_EXCL; + /* release LINK_SHARED on source inode (mds will lock it) */ + req->r_old_inode_drop = CEPH_CAP_LINK_SHARED; err = ceph_mdsc_do_request(mdsc, dir, req); if (err) { d_drop(dentry); |