diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2018-11-09 17:26:18 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2018-11-09 17:26:18 -0500 |
commit | d757a3b01e72368176c5ee580ea17f8c2d185cd7 (patch) | |
tree | 331c1f77b2814282a02d1b1cae0437b5217d2db5 | |
parent | 26eaed4671af3c4108b266504aed1103fb68a378 (diff) | |
parent | 23c625ce3065e40c933a4239efb9b11f1194a343 (diff) |
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
-rw-r--r-- | fs/ceph/file.c | 11 | ||||
-rw-r--r-- | fs/ceph/mds_client.c | 12 | ||||
-rw-r--r-- | fs/ceph/quota.c | 3 | ||||
-rw-r--r-- | include/linux/ceph/ceph_features.h | 8 |
4 files changed, 15 insertions, 19 deletions
diff --git a/fs/ceph/file.c b/fs/ceph/file.c index 27cad84dab23..189df668b6a0 100644 --- a/fs/ceph/file.c +++ b/fs/ceph/file.c | |||
@@ -1931,10 +1931,17 @@ static ssize_t ceph_copy_file_range(struct file *src_file, loff_t src_off, | |||
1931 | if (!prealloc_cf) | 1931 | if (!prealloc_cf) |
1932 | return -ENOMEM; | 1932 | return -ENOMEM; |
1933 | 1933 | ||
1934 | /* Start by sync'ing the source file */ | 1934 | /* Start by sync'ing the source and destination files */ |
1935 | ret = file_write_and_wait_range(src_file, src_off, (src_off + len)); | 1935 | ret = file_write_and_wait_range(src_file, src_off, (src_off + len)); |
1936 | if (ret < 0) | 1936 | if (ret < 0) { |
1937 | dout("failed to write src file (%zd)\n", ret); | ||
1938 | goto out; | ||
1939 | } | ||
1940 | ret = file_write_and_wait_range(dst_file, dst_off, (dst_off + len)); | ||
1941 | if (ret < 0) { | ||
1942 | dout("failed to write dst file (%zd)\n", ret); | ||
1937 | goto out; | 1943 | goto out; |
1944 | } | ||
1938 | 1945 | ||
1939 | /* | 1946 | /* |
1940 | * We need FILE_WR caps for dst_ci and FILE_RD for src_ci as other | 1947 | * We need FILE_WR caps for dst_ci and FILE_RD for src_ci as other |
diff --git a/fs/ceph/mds_client.c b/fs/ceph/mds_client.c index 67a9aeb2f4ec..bd13a3267ae0 100644 --- a/fs/ceph/mds_client.c +++ b/fs/ceph/mds_client.c | |||
@@ -80,12 +80,8 @@ static int parse_reply_info_in(void **p, void *end, | |||
80 | info->symlink = *p; | 80 | info->symlink = *p; |
81 | *p += info->symlink_len; | 81 | *p += info->symlink_len; |
82 | 82 | ||
83 | if (features & CEPH_FEATURE_DIRLAYOUTHASH) | 83 | ceph_decode_copy_safe(p, end, &info->dir_layout, |
84 | ceph_decode_copy_safe(p, end, &info->dir_layout, | 84 | sizeof(info->dir_layout), bad); |
85 | sizeof(info->dir_layout), bad); | ||
86 | else | ||
87 | memset(&info->dir_layout, 0, sizeof(info->dir_layout)); | ||
88 | |||
89 | ceph_decode_32_safe(p, end, info->xattr_len, bad); | 85 | ceph_decode_32_safe(p, end, info->xattr_len, bad); |
90 | ceph_decode_need(p, end, info->xattr_len, bad); | 86 | ceph_decode_need(p, end, info->xattr_len, bad); |
91 | info->xattr_data = *p; | 87 | info->xattr_data = *p; |
@@ -3182,10 +3178,8 @@ static void send_mds_reconnect(struct ceph_mds_client *mdsc, | |||
3182 | recon_state.pagelist = pagelist; | 3178 | recon_state.pagelist = pagelist; |
3183 | if (session->s_con.peer_features & CEPH_FEATURE_MDSENC) | 3179 | if (session->s_con.peer_features & CEPH_FEATURE_MDSENC) |
3184 | recon_state.msg_version = 3; | 3180 | recon_state.msg_version = 3; |
3185 | else if (session->s_con.peer_features & CEPH_FEATURE_FLOCK) | ||
3186 | recon_state.msg_version = 2; | ||
3187 | else | 3181 | else |
3188 | recon_state.msg_version = 1; | 3182 | recon_state.msg_version = 2; |
3189 | err = iterate_session_caps(session, encode_caps_cb, &recon_state); | 3183 | err = iterate_session_caps(session, encode_caps_cb, &recon_state); |
3190 | if (err < 0) | 3184 | if (err < 0) |
3191 | goto fail; | 3185 | goto fail; |
diff --git a/fs/ceph/quota.c b/fs/ceph/quota.c index 32d4f13784ba..03f4d24db8fe 100644 --- a/fs/ceph/quota.c +++ b/fs/ceph/quota.c | |||
@@ -237,7 +237,8 @@ static bool check_quota_exceeded(struct inode *inode, enum quota_check_op op, | |||
237 | ceph_put_snap_realm(mdsc, realm); | 237 | ceph_put_snap_realm(mdsc, realm); |
238 | realm = next; | 238 | realm = next; |
239 | } | 239 | } |
240 | ceph_put_snap_realm(mdsc, realm); | 240 | if (realm) |
241 | ceph_put_snap_realm(mdsc, realm); | ||
241 | up_read(&mdsc->snap_rwsem); | 242 | up_read(&mdsc->snap_rwsem); |
242 | 243 | ||
243 | return exceeded; | 244 | return exceeded; |
diff --git a/include/linux/ceph/ceph_features.h b/include/linux/ceph/ceph_features.h index 6b92b3395fa9..65a38c4a02a1 100644 --- a/include/linux/ceph/ceph_features.h +++ b/include/linux/ceph/ceph_features.h | |||
@@ -213,12 +213,6 @@ DEFINE_CEPH_FEATURE_DEPRECATED(63, 1, RESERVED_BROKEN, LUMINOUS) // client-facin | |||
213 | CEPH_FEATURE_NEW_OSDOPREPLY_ENCODING | \ | 213 | CEPH_FEATURE_NEW_OSDOPREPLY_ENCODING | \ |
214 | CEPH_FEATURE_CEPHX_V2) | 214 | CEPH_FEATURE_CEPHX_V2) |
215 | 215 | ||
216 | #define CEPH_FEATURES_REQUIRED_DEFAULT \ | 216 | #define CEPH_FEATURES_REQUIRED_DEFAULT 0 |
217 | (CEPH_FEATURE_NOSRCADDR | \ | ||
218 | CEPH_FEATURE_SUBSCRIBE2 | \ | ||
219 | CEPH_FEATURE_RECONNECT_SEQ | \ | ||
220 | CEPH_FEATURE_PGID64 | \ | ||
221 | CEPH_FEATURE_PGPOOL3 | \ | ||
222 | CEPH_FEATURE_OSDENC) | ||
223 | 217 | ||
224 | #endif | 218 | #endif |