Skip to content

Commit d757a3b

Browse files
committed
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
2 parents 26eaed4 + 23c625c commit d757a3b

File tree

4 files changed

+15
-19
lines changed

4 files changed

+15
-19
lines changed

fs/ceph/file.c

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1931,10 +1931,17 @@ static ssize_t ceph_copy_file_range(struct file *src_file, loff_t src_off,
19311931
if (!prealloc_cf)
19321932
return -ENOMEM;
19331933

1934-
/* Start by sync'ing the source file */
1934+
/* Start by sync'ing the source and destination files */
19351935
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);
19371943
goto out;
1944+
}
19381945

19391946
/*
19401947
* We need FILE_WR caps for dst_ci and FILE_RD for src_ci as other

fs/ceph/mds_client.c

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -80,12 +80,8 @@ static int parse_reply_info_in(void **p, void *end,
8080
info->symlink = *p;
8181
*p += info->symlink_len;
8282

83-
if (features & CEPH_FEATURE_DIRLAYOUTHASH)
84-
ceph_decode_copy_safe(p, end, &info->dir_layout,
85-
sizeof(info->dir_layout), bad);
86-
else
87-
memset(&info->dir_layout, 0, sizeof(info->dir_layout));
88-
83+
ceph_decode_copy_safe(p, end, &info->dir_layout,
84+
sizeof(info->dir_layout), bad);
8985
ceph_decode_32_safe(p, end, info->xattr_len, bad);
9086
ceph_decode_need(p, end, info->xattr_len, bad);
9187
info->xattr_data = *p;
@@ -3182,10 +3178,8 @@ static void send_mds_reconnect(struct ceph_mds_client *mdsc,
31823178
recon_state.pagelist = pagelist;
31833179
if (session->s_con.peer_features & CEPH_FEATURE_MDSENC)
31843180
recon_state.msg_version = 3;
3185-
else if (session->s_con.peer_features & CEPH_FEATURE_FLOCK)
3186-
recon_state.msg_version = 2;
31873181
else
3188-
recon_state.msg_version = 1;
3182+
recon_state.msg_version = 2;
31893183
err = iterate_session_caps(session, encode_caps_cb, &recon_state);
31903184
if (err < 0)
31913185
goto fail;

fs/ceph/quota.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,8 @@ static bool check_quota_exceeded(struct inode *inode, enum quota_check_op op,
237237
ceph_put_snap_realm(mdsc, realm);
238238
realm = next;
239239
}
240-
ceph_put_snap_realm(mdsc, realm);
240+
if (realm)
241+
ceph_put_snap_realm(mdsc, realm);
241242
up_read(&mdsc->snap_rwsem);
242243

243244
return exceeded;

include/linux/ceph/ceph_features.h

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -213,12 +213,6 @@ DEFINE_CEPH_FEATURE_DEPRECATED(63, 1, RESERVED_BROKEN, LUMINOUS) // client-facin
213213
CEPH_FEATURE_NEW_OSDOPREPLY_ENCODING | \
214214
CEPH_FEATURE_CEPHX_V2)
215215

216-
#define CEPH_FEATURES_REQUIRED_DEFAULT \
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)
216+
#define CEPH_FEATURES_REQUIRED_DEFAULT 0
223217

224218
#endif

0 commit comments

Comments
 (0)