linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeff Layton <jlayton@redhat.com>
To: jim owens <jowens@hp.com>
Cc: Steve French <smfrench@gmail.com>,
	linux-fsdevel <linux-fsdevel@vger.kernel.org>,
	"linux-cifs-client@lists.samba.org"
	<linux-cifs-client@lists.samba.org>,
	LKML <linux-kernel@vger.kernel.org>
Subject: Re: [linux-cifs-client] Re: unlink behavior when file is open by other process
Date: Fri, 17 Oct 2008 16:17:49 -0400	[thread overview]
Message-ID: <20081017161749.1fcbb214@tleilax.poochiereds.net> (raw)
In-Reply-To: <48F8ED0E.1060102@hp.com>

On Fri, 17 Oct 2008 15:52:46 -0400
jim owens <jowens@hp.com> wrote:

> Jeff Layton wrote:
> 
> > Sure, I'm not disputing whether returning an error on open is right or
> > wrong. The problem is that it's not expected. We've just unlinked the
> > filename and returned success -- there is *no* reason that the create
> > should fail here. An application programmer will (rightfully) consider
> > this a bug.
> 
> I agree that failing the unlink if you can not do it is
> "the right thing to do"... but unless you have some magic
> to prevent anyone else from creating the file between that
> unlink and the create then in fact there is a reason the
> application can see the create fail after unlink succeeds :)

It's all about expectations. If you have your environment set up in
such a way that you allow other processes or clients to race in and
create a file or directory here, then you should be expecting that
the create can fail, when it occurs :)

I just think that we have to strive for _consistent_ behavior from the
kernel. If we allow unlink to return without actually removing the
link, then it may "just work" in most cases. The problem is that it
won't work in some cases and it'll be very hard to predict when that
will be. IMO, that's far worse than just failing the unlink outright.

-- 
Jeff Layton <jlayton@redhat.com>

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

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-10-17 15:09 unlink behavior when file is open by other process Steve French
2008-10-17 15:24 ` Steve French
2008-10-17 17:27   ` [linux-cifs-client] " Jeff Layton
2008-10-17 17:41     ` Steve French
2008-10-17 18:10       ` Jeff Layton
2008-10-17 19:52         ` jim owens
2008-10-17 20:17           ` Jeff Layton [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=20081017161749.1fcbb214@tleilax.poochiereds.net \
    --to=jlayton@redhat.com \
    --cc=jowens@hp.com \
    --cc=linux-cifs-client@lists.samba.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=smfrench@gmail.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;
as well as URLs for NNTP newsgroup(s).