public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Louis Rilling <Louis.Rilling@kerlabs.com>
To: Joel.Becker@oracle.com
Cc: linux-kernel@vger.kernel.org, ocfs2-devel@oss.oracle.com
Subject: Re: [PATCH][BUGFIX] configfs: Fix symlink() to a removing item
Date: Tue, 17 Jun 2008 12:42:59 +0200	[thread overview]
Message-ID: <20080617104259.GX30804@localhost> (raw)
In-Reply-To: <20080616222900.GD6441@mail.oracle.com>

[-- Attachment #1: Type: text/plain, Size: 1553 bytes --]

On Mon, Jun 16, 2008 at 03:29:00PM -0700, Joel Becker wrote:
> On Mon, Jun 16, 2008 at 08:09:11PM +0200, Louis Rilling wrote:
> > This patch introduces a similar (weird?) behavior as with mkdir failures making
> > rmdir fail: if symlink() races with rmdir() of the parent directory (or its
> > youngest user-created ancestor if parent is a default group) or rmdir() of the
> > target directory, and then fails in configfs_create(), this can make the racing
> > rmdir() fail despite the concerned directory having no user-created entry (resp.
> > no symlink pointing to it or one of its default groups) in the end.
> > If this behavior is found unacceptable, I'll submit a fix in the same spirit as
> > the racing mkdir() fix.
> 
> 	Ahh, but you can't wait on the mutex like you do in mkdir(),
> because they're not ordered - it can race rename again.

Yes I can. In the mkdir() case, rmdir() waits on the mutex of one of the default
groups. The symlink case will be handled the same. The difference is that while
mkdir() tags the parent with CONFIGFS_USET_IN_MKDIR, symlink() will tag both the
parent and the target with CONFIGFS_USET_IN_SYMLINK. [ We can actually merge the
two flags in something like CONFIGFS_USET_ATTACHING. ] Since tagging requires
only to take configfs_dirent_lock, there will be no deadlock.

I'll send a patch later.

Louis

-- 
Dr Louis Rilling			Kerlabs
Skype: louis.rilling			Batiment Germanium
Phone: (+33|0) 6 80 89 08 23		80 avenue des Buttes de Coesmes
http://www.kerlabs.com/			35700 Rennes

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

  reply	other threads:[~2008-06-17 10:43 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-06-16 18:09 [PATCH][BUGFIX] configfs: Fix symlink() to a removing item Louis Rilling
2008-06-16 22:29 ` Joel Becker
2008-06-17 10:42   ` Louis Rilling [this message]
2008-06-17 12:56     ` Louis Rilling

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=20080617104259.GX30804@localhost \
    --to=louis.rilling@kerlabs.com \
    --cc=Joel.Becker@oracle.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=ocfs2-devel@oss.oracle.com \
    /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