linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3 0/5] ceph: clean up some unsafe dentry->d_parent accesses
@ 2016-12-14 14:54 Jeff Layton
  2016-12-14 14:54 ` [PATCH v3 1/5] ceph: clean up unsafe d_parent access in __choose_mds Jeff Layton
                   ` (4 more replies)
  0 siblings, 5 replies; 9+ messages in thread
From: Jeff Layton @ 2016-12-14 14:54 UTC (permalink / raw)
  To: ceph-devel; +Cc: zyan, sage, idryomov, linux-fsdevel, dhowells, viro

v3: use parent inode information more widely when we have it

v2: use r_locked_dir in __choose_mds if it's available
    handle NULL d_inode_rcu(parent) properly

In several places, the kcephfs client accesses dentry->d_parent without
holding appropriate locking. This is not safe, as you can race with
renames that can morph the tree such that is changes and dentries found
previously can end up freed. This patchset fixes these places to access
the parent(s) safely, mostly using the rcu_read_lock().

Note that I'm not aware of any specific bug reports in this area --
these were just discovered by inspection (mostly by Zheng). This passes
xfstests at least up to test generic/095, where we hit an unrelated
softlockup in the splice write code (http://tracker.ceph.com/issues/18130).

Tracker bug link: http://tracker.ceph.com/issues/18148

Jeff Layton (5):
  ceph: clean up unsafe d_parent access in __choose_mds
  ceph: clean up unsafe d_parent accesses in build_dentry_path
  ceph: pass parent dir ino info to build_dentry_path
  ceph: fix unsafe dcache access in ceph_encode_dentry_release
  ceph: pass parent inode info to ceph_encode_dentry_release if we have
    it

 fs/ceph/caps.c       |  8 ++++-
 fs/ceph/mds_client.c | 94 +++++++++++++++++++++++++++++++++++-----------------
 fs/ceph/super.h      |  1 +
 3 files changed, 71 insertions(+), 32 deletions(-)

-- 
2.7.4


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2016-12-15 11:30 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-12-14 14:54 [PATCH v3 0/5] ceph: clean up some unsafe dentry->d_parent accesses Jeff Layton
2016-12-14 14:54 ` [PATCH v3 1/5] ceph: clean up unsafe d_parent access in __choose_mds Jeff Layton
2016-12-15  9:08   ` Yan, Zheng
2016-12-15 11:30     ` Jeff Layton
2016-12-14 14:54 ` [PATCH v3 2/5] ceph: clean up unsafe d_parent accesses in build_dentry_path Jeff Layton
2016-12-14 14:54 ` [PATCH v3 3/5] ceph: pass parent dir ino info to build_dentry_path Jeff Layton
2016-12-15  9:11   ` Yan, Zheng
2016-12-14 14:54 ` [PATCH v3 4/5] ceph: fix unsafe dcache access in ceph_encode_dentry_release Jeff Layton
2016-12-14 14:54 ` [PATCH v3 5/5] ceph: pass parent inode info to ceph_encode_dentry_release if we have it Jeff Layton

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).