Commit d757a3b0 authored by Linus Torvalds's avatar Linus Torvalds

Merge tag 'ceph-for-4.20-rc2' of https://github.com/ceph/ceph-client

Pull Ceph fixes from Ilya Dryomov:
 "Two CephFS fixes (copy_file_range and quota) and a small feature bit
  cleanup"

* tag 'ceph-for-4.20-rc2' of https://github.com/ceph/ceph-client:
  libceph: assume argonaut on the server side
  ceph: quota: fix null pointer dereference in quota check
  ceph: add destination file data sync before doing any remote copy
parents 26eaed46 23c625ce
...@@ -1931,10 +1931,17 @@ static ssize_t ceph_copy_file_range(struct file *src_file, loff_t src_off, ...@@ -1931,10 +1931,17 @@ static ssize_t ceph_copy_file_range(struct file *src_file, loff_t src_off,
if (!prealloc_cf) if (!prealloc_cf)
return -ENOMEM; return -ENOMEM;
/* Start by sync'ing the source file */ /* Start by sync'ing the source and destination files */
ret = file_write_and_wait_range(src_file, src_off, (src_off + len)); ret = file_write_and_wait_range(src_file, src_off, (src_off + len));
if (ret < 0) if (ret < 0) {
dout("failed to write src file (%zd)\n", ret);
goto out;
}
ret = file_write_and_wait_range(dst_file, dst_off, (dst_off + len));
if (ret < 0) {
dout("failed to write dst file (%zd)\n", ret);
goto out; goto out;
}
/* /*
* We need FILE_WR caps for dst_ci and FILE_RD for src_ci as other * We need FILE_WR caps for dst_ci and FILE_RD for src_ci as other
......
...@@ -80,12 +80,8 @@ static int parse_reply_info_in(void **p, void *end, ...@@ -80,12 +80,8 @@ static int parse_reply_info_in(void **p, void *end,
info->symlink = *p; info->symlink = *p;
*p += info->symlink_len; *p += info->symlink_len;
if (features & CEPH_FEATURE_DIRLAYOUTHASH) ceph_decode_copy_safe(p, end, &info->dir_layout,
ceph_decode_copy_safe(p, end, &info->dir_layout, sizeof(info->dir_layout), bad);
sizeof(info->dir_layout), bad);
else
memset(&info->dir_layout, 0, sizeof(info->dir_layout));
ceph_decode_32_safe(p, end, info->xattr_len, bad); ceph_decode_32_safe(p, end, info->xattr_len, bad);
ceph_decode_need(p, end, info->xattr_len, bad); ceph_decode_need(p, end, info->xattr_len, bad);
info->xattr_data = *p; info->xattr_data = *p;
...@@ -3182,10 +3178,8 @@ static void send_mds_reconnect(struct ceph_mds_client *mdsc, ...@@ -3182,10 +3178,8 @@ static void send_mds_reconnect(struct ceph_mds_client *mdsc,
recon_state.pagelist = pagelist; recon_state.pagelist = pagelist;
if (session->s_con.peer_features & CEPH_FEATURE_MDSENC) if (session->s_con.peer_features & CEPH_FEATURE_MDSENC)
recon_state.msg_version = 3; recon_state.msg_version = 3;
else if (session->s_con.peer_features & CEPH_FEATURE_FLOCK)
recon_state.msg_version = 2;
else else
recon_state.msg_version = 1; recon_state.msg_version = 2;
err = iterate_session_caps(session, encode_caps_cb, &recon_state); err = iterate_session_caps(session, encode_caps_cb, &recon_state);
if (err < 0) if (err < 0)
goto fail; goto fail;
......
...@@ -237,7 +237,8 @@ static bool check_quota_exceeded(struct inode *inode, enum quota_check_op op, ...@@ -237,7 +237,8 @@ static bool check_quota_exceeded(struct inode *inode, enum quota_check_op op,
ceph_put_snap_realm(mdsc, realm); ceph_put_snap_realm(mdsc, realm);
realm = next; realm = next;
} }
ceph_put_snap_realm(mdsc, realm); if (realm)
ceph_put_snap_realm(mdsc, realm);
up_read(&mdsc->snap_rwsem); up_read(&mdsc->snap_rwsem);
return exceeded; return exceeded;
......
...@@ -213,12 +213,6 @@ DEFINE_CEPH_FEATURE_DEPRECATED(63, 1, RESERVED_BROKEN, LUMINOUS) // client-facin ...@@ -213,12 +213,6 @@ DEFINE_CEPH_FEATURE_DEPRECATED(63, 1, RESERVED_BROKEN, LUMINOUS) // client-facin
CEPH_FEATURE_NEW_OSDOPREPLY_ENCODING | \ CEPH_FEATURE_NEW_OSDOPREPLY_ENCODING | \
CEPH_FEATURE_CEPHX_V2) CEPH_FEATURE_CEPHX_V2)
#define CEPH_FEATURES_REQUIRED_DEFAULT \ #define CEPH_FEATURES_REQUIRED_DEFAULT 0
(CEPH_FEATURE_NOSRCADDR | \
CEPH_FEATURE_SUBSCRIBE2 | \
CEPH_FEATURE_RECONNECT_SEQ | \
CEPH_FEATURE_PGID64 | \
CEPH_FEATURE_PGPOOL3 | \
CEPH_FEATURE_OSDENC)
#endif #endif
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