Linux/linux 1bcb344fs/ceph mds_client.c

ceph: only use d_name directly when parent is locked

Ben reported tripping the BUG_ON in create_request_message during some
performance testing. Analysis of the vmcore showed that the length of
the r_dentry->d_name string changed after we allocated the buffer, but
before we encoded it.

build_dentry_path returns pointers to d_name in the common case of
non-snapped dentries, but this optimization isn't safe unless the parent
directory is locked. When it isn't, have the code make a copy of the
d_name while holding the d_lock.

Cc: stable at vger.kernel.org
Reported-by: Ben England <bengland at redhat.com>
Signed-off-by: Jeff Layton <jlayton at kernel.org>
Reviewed-by: "Yan, Zheng" <zyan at redhat.com>
Signed-off-by: Ilya Dryomov <idryomov at gmail.com>
DeltaFile
+50-11fs/ceph/mds_client.c
+50-111 files

UnifiedSplitRaw