This is a note to let you know that I've just added the patch titled ceph: force updating the msg pointer in non-split case to the 4.19-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: ceph-force-updating-the-msg-pointer-in-non-split-case.patch and it can be found in the queue-4.19 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. >From 4cafd0400bcb6187c0d4ab4d4b0229a89ac4f8c2 Mon Sep 17 00:00:00 2001 From: Xiubo Li <xiubli@xxxxxxxxxx> Date: Thu, 18 May 2023 09:47:23 +0800 Subject: ceph: force updating the msg pointer in non-split case From: Xiubo Li <xiubli@xxxxxxxxxx> commit 4cafd0400bcb6187c0d4ab4d4b0229a89ac4f8c2 upstream. When the MClientSnap reqeust's op is not CEPH_SNAP_OP_SPLIT the request may still contain a list of 'split_realms', and we need to skip it anyway. Or it will be parsed as a corrupt snaptrace. Cc: stable@xxxxxxxxxxxxxxx Link: https://tracker.ceph.com/issues/61200 Reported-by: Frank Schilder <frans@xxxxxx> Signed-off-by: Xiubo Li <xiubli@xxxxxxxxxx> Reviewed-by: Ilya Dryomov <idryomov@xxxxxxxxx> Signed-off-by: Ilya Dryomov <idryomov@xxxxxxxxx> Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> --- fs/ceph/snap.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) --- a/fs/ceph/snap.c +++ b/fs/ceph/snap.c @@ -976,6 +976,19 @@ skip_inode: continue; adjust_snap_realm_parent(mdsc, child, realm->ino); } + } else { + /* + * In the non-split case both 'num_split_inos' and + * 'num_split_realms' should be 0, making this a no-op. + * However the MDS happens to populate 'split_realms' list + * in one of the UPDATE op cases by mistake. + * + * Skip both lists just in case to ensure that 'p' is + * positioned at the start of realm info, as expected by + * ceph_update_snap_trace(). + */ + p += sizeof(u64) * num_split_inos; + p += sizeof(u64) * num_split_realms; } /* Patches currently in stable-queue which might be from xiubli@xxxxxxxxxx are queue-4.19/ceph-force-updating-the-msg-pointer-in-non-split-case.patch