From: Al Viro <viro@ZenIV.linux.org.uk>
To: "Eric W. Biederman" <ebiederm@xmission.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>,
Dave Jones <davej@redhat.com>,
Linux Kernel <linux-kernel@vger.kernel.org>,
Miklos Szeredi <mszeredi@suse.cz>, Jan Kara <jack@suse.cz>,
Peter Zijlstra <peterz@infradead.org>,
linux-fsdevel@vger.kernel.org,
"J. Bruce Fields" <bfields@redhat.com>,
Sage Weil <sage@newdream.net>
Subject: Re: processes hung after sys_renameat, and 'missing' processes
Date: Fri, 8 Jun 2012 03:37:42 +0100 [thread overview]
Message-ID: <20120608023742.GN30000@ZenIV.linux.org.uk> (raw)
In-Reply-To: <87mx4eimij.fsf@xmission.com>
On Thu, Jun 07, 2012 at 07:08:04PM -0700, Eric W. Biederman wrote:
> > + dentry->d_fsdata = sysfs_get(sd);
> > + ret = d_materialise_unique(dentry, inode);
>
> I have a small problem with d_materialise_unique. For renames of files
> d_materialise_unique calls __d_instantiate_unique. __d_instantiate_unique
> does not detect renames of files. Which at least misses the rename
> of sysfs symlinks.
Er... yes, but why do we care? It's not as if you had a hardwired
reference to dentry from your objects, after all (can't, with multiple
superblocks). So you get old stale dentry at the old location and
a new one where we'd moved that sucker. They have the same inode
and each holds a reference to the same sd; ->d_revalidate() at the
old location must invalidate the old instance anyway, since you are
not guaranteed that lookup at the new one will happen before repeated
lookup at the old one.
Directories *are* special in that respect, but symlinks are trivial...
VFS doesn't care if you have extra dentries for those and neither does
sysfs, AFAICS.
It's not that we couldn't teach d_materialise_unique() about those (e.g.
introduce a new dentry flag and treat dentries with it as directories
for d_materialise_unique() purposes); I would like to understand the
reasons for doing that, though.
next prev parent reply other threads:[~2012-06-08 2:37 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20120603232820.GQ30000@ZenIV.linux.org.uk>
[not found] ` <20120606194233.GA1537@redhat.com>
[not found] ` <CA+55aFwxFVLPk4-dp73uccKXepKwjpGFgh0NW1u8d0zYzr=hBA@mail.gmail.com>
[not found] ` <20120606230040.GA18089@redhat.com>
[not found] ` <CA+55aFx_oREEd2XS_aG7PJ7dwzWjgx689V_uRPGWpVS01_++6A@mail.gmail.com>
[not found] ` <20120606235403.GC30000@ZenIV.linux.org.uk>
[not found] ` <20120607002914.GB22223@redhat.com>
[not found] ` <CA+55aFyp2GUbc218eb5BDyAqz+cOPTJMVcb4ptk+f1_RBB+-mg@mail.gmail.com>
[not found] ` <20120607011915.GA17566@redhat.com>
[not found] ` <20120607012900.GE30000@ZenIV.linux.org.uk>
2012-06-07 19:36 ` processes hung after sys_renameat, and 'missing' processes Al Viro
2012-06-07 20:43 ` Sage Weil
2012-06-07 23:12 ` Eric W. Biederman
2012-06-07 23:39 ` Al Viro
2012-06-07 23:57 ` Linus Torvalds
2012-06-08 0:36 ` Al Viro
2012-06-08 0:42 ` Linus Torvalds
2012-06-08 0:59 ` Al Viro
2012-06-08 5:25 ` Eric W. Biederman
2012-06-08 5:48 ` Al Viro
2012-06-08 7:54 ` Eric W. Biederman
2012-06-08 20:20 ` Al Viro
2012-06-08 2:08 ` Eric W. Biederman
2012-06-08 2:37 ` Al Viro [this message]
2012-06-08 2:18 ` Al Viro
2012-06-08 16:22 ` J. Bruce Fields
2012-06-08 17:44 ` Linus Torvalds
2012-06-11 12:17 ` J. Bruce Fields
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20120608023742.GN30000@ZenIV.linux.org.uk \
--to=viro@zeniv.linux.org.uk \
--cc=bfields@redhat.com \
--cc=davej@redhat.com \
--cc=ebiederm@xmission.com \
--cc=jack@suse.cz \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mszeredi@suse.cz \
--cc=peterz@infradead.org \
--cc=sage@newdream.net \
--cc=torvalds@linux-foundation.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).