From: Al Viro <viro@ZenIV.linux.org.uk>
To: Dmitry Dmitriev <dimondmm@yandex.ru>
Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: PROBLEM: Corrupting d_count of target dentry, when rename directory to the directory which is mount point, or when rename directory which is mount point to the existing directory.
Date: Sat, 4 Jun 2011 00:11:58 +0100 [thread overview]
Message-ID: <20110603231158.GR11521@ZenIV.linux.org.uk> (raw)
In-Reply-To: <254871306829495@web62.yandex.ru>
> When new_dentry exist, i.e. 'target' is not NULL, and a mount point( or old dentry is a mount point ), then function set 'error' variable to -EBUSY( line 2581 ). After that function will call dput function for new_dentry( line 2595 ) without corresponding dget. In this case d_count of dentry become corrupted. In case when old dentry and new dentry are not mount points, dget for new dentry is called in dentry_unhash function.
What do you mean, without corresponding dget()? It's done in dentry_unhash().
Oh, hell... We don't call it in that case. Right. vfs_rmdir() used to
do dentry_unhash() before the checks for mountpoints, vfs_rename_other() -
only after.
The funny part is, it got accidentally fixed in this merge window. -stable
still needs fixing - by moving dentry_unhash() down past the checks for
d_mountpoint(). Mainline should be OK now...
prev parent reply other threads:[~2011-06-03 23:12 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-05-31 8:11 PROBLEM: Corrupting d_count of target dentry, when rename directory to the directory which is mount point, or when rename directory which is mount point to the existing directory Dmitry Dmitriev
2011-06-03 23:11 ` Al Viro [this message]
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=20110603231158.GR11521@ZenIV.linux.org.uk \
--to=viro@zeniv.linux.org.uk \
--cc=dimondmm@yandex.ru \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.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).