Commit 3bd58143 authored by Yan, Zheng's avatar Yan, Zheng Committed by Sage Weil

ceph: reserve caps for file layout/lock MDS requests

Signed-off-by: default avatarYan, Zheng <zheng.z.yan@intel.com>
Reviewed-by: default avatarSage Weil <sage@inktank.com>
parent fd7b95cd
...@@ -110,6 +110,8 @@ static long ceph_ioctl_set_layout(struct file *file, void __user *arg) ...@@ -110,6 +110,8 @@ static long ceph_ioctl_set_layout(struct file *file, void __user *arg)
return PTR_ERR(req); return PTR_ERR(req);
req->r_inode = inode; req->r_inode = inode;
ihold(inode); ihold(inode);
req->r_num_caps = 1;
req->r_inode_drop = CEPH_CAP_FILE_SHARED | CEPH_CAP_FILE_EXCL; req->r_inode_drop = CEPH_CAP_FILE_SHARED | CEPH_CAP_FILE_EXCL;
req->r_args.setlayout.layout.fl_stripe_unit = req->r_args.setlayout.layout.fl_stripe_unit =
...@@ -154,6 +156,7 @@ static long ceph_ioctl_set_layout_policy (struct file *file, void __user *arg) ...@@ -154,6 +156,7 @@ static long ceph_ioctl_set_layout_policy (struct file *file, void __user *arg)
return PTR_ERR(req); return PTR_ERR(req);
req->r_inode = inode; req->r_inode = inode;
ihold(inode); ihold(inode);
req->r_num_caps = 1;
req->r_args.setlayout.layout.fl_stripe_unit = req->r_args.setlayout.layout.fl_stripe_unit =
cpu_to_le32(l.stripe_unit); cpu_to_le32(l.stripe_unit);
......
...@@ -45,6 +45,7 @@ static int ceph_lock_message(u8 lock_type, u16 operation, struct file *file, ...@@ -45,6 +45,7 @@ static int ceph_lock_message(u8 lock_type, u16 operation, struct file *file,
return PTR_ERR(req); return PTR_ERR(req);
req->r_inode = inode; req->r_inode = inode;
ihold(inode); ihold(inode);
req->r_num_caps = 1;
/* mds requires start and length rather than start and end */ /* mds requires start and length rather than start and end */
if (LLONG_MAX == fl->fl_end) if (LLONG_MAX == fl->fl_end)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment