Skip to content

Commit

Permalink
ceph: reserve caps for file layout/lock MDS requests
Browse files Browse the repository at this point in the history
Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com>
Reviewed-by: Sage Weil <sage@inktank.com>
  • Loading branch information
Yan, Zheng authored and Sage Weil committed Apr 28, 2014
1 parent fd7b95c commit 3bd5814
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
3 changes: 3 additions & 0 deletions fs/ceph/ioctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,8 @@ static long ceph_ioctl_set_layout(struct file *file, void __user *arg)
return PTR_ERR(req);
req->r_inode = inode;
ihold(inode);
req->r_num_caps = 1;

req->r_inode_drop = CEPH_CAP_FILE_SHARED | CEPH_CAP_FILE_EXCL;

req->r_args.setlayout.layout.fl_stripe_unit =
Expand Down Expand Up @@ -154,6 +156,7 @@ static long ceph_ioctl_set_layout_policy (struct file *file, void __user *arg)
return PTR_ERR(req);
req->r_inode = inode;
ihold(inode);
req->r_num_caps = 1;

req->r_args.setlayout.layout.fl_stripe_unit =
cpu_to_le32(l.stripe_unit);
Expand Down
1 change: 1 addition & 0 deletions fs/ceph/locks.c
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ static int ceph_lock_message(u8 lock_type, u16 operation, struct file *file,
return PTR_ERR(req);
req->r_inode = inode;
ihold(inode);
req->r_num_caps = 1;

/* mds requires start and length rather than start and end */
if (LLONG_MAX == fl->fl_end)
Expand Down

0 comments on commit 3bd5814

Please sign in to comment.