From: hooanon05@yahoo.co.jp
To: dedekind@infradead.org
Cc: adrian.hunter@nokia.com, linux-fsdevel@vger.kernel.org
Subject: Re: ubifs, race between link and unlink/rename?
Date: Tue, 19 May 2009 15:18:34 +0900 [thread overview]
Message-ID: <13265.1242713914@jrobl> (raw)
In-Reply-To: <1242713370.15206.3.camel@localhost.localdomain>
Artem Bityutskiy:
> > Consider a scenario when 'vfs_link(dirA/fileA)' and
> > 'vfs_unlink(dirA/fileA, dirB/fileB)' race. 'vfs_link()' does not
> > lock 'dirA->i_mutex', so this is possible. Both of the functions
:::
> Pushing this patch to ubifs-2.6.git, thanks.
Ah, I am late.
We need one minor correction.
> @@ -528,6 +528,25 @@ static int ubifs_link(struct dentry *old_dentry, struct inode *dir,
> inode->i_nlink, dir->i_ino);
> ubifs_assert(mutex_is_locked(&dir->i_mutex));
> ubifs_assert(mutex_is_locked(&inode->i_mutex));
> +
> + /*
> + * Return -ENOENT if we've raced with unlink and i_nlink is 0. Doing
> + * otherwise has the potential to corrupt the orphan inode list.
> + *
> + * Indeed, consider a scenario when 'vfs_link(dirA/fileA)' and
> + * 'vfs_unlink(dirA/fileA, dirB/fileB)' race. 'vfs_link()' does not
This comment is confusing.
Need to swich vfs_unlink and vfs_link. :-)
J. R. Okajima
prev parent reply other threads:[~2009-05-19 6:19 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-05-13 16:31 ubifs, race between link and unlink/rename? hooanon05
2009-05-13 18:28 ` Adrian Hunter
2009-05-15 8:44 ` Artem Bityutskiy
2009-05-15 9:35 ` Artem Bityutskiy
2009-05-19 6:09 ` Artem Bityutskiy
2009-05-19 6:18 ` hooanon05 [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=13265.1242713914@jrobl \
--to=hooanon05@yahoo.co.jp \
--cc=adrian.hunter@nokia.com \
--cc=dedekind@infradead.org \
--cc=linux-fsdevel@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