linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Al Viro <viro@ZenIV.linux.org.uk>
To: Namjae Jeon <linkinjeon@gmail.com>
Cc: hirofumi@mail.parknet.co.jp, akpm@linux-foundation.org,
	linux-kernel@vger.kernel.org,
	Amit Sahrawat <amit.sahrawat83@gmail.com>
Subject: Re: [PATCH] fat: remove redundent call to fat_detach in vfat_unlink
Date: Fri, 31 Aug 2012 18:29:00 +0100	[thread overview]
Message-ID: <20120831172900.GC23464@ZenIV.linux.org.uk> (raw)
In-Reply-To: <1346431688-3544-1-git-send-email-linkinjeon@gmail.com>

On Fri, Aug 31, 2012 at 12:48:07PM -0400, Namjae Jeon wrote:
> As after file is removed fat_evict_inode will be called and fat_detach will be called from that place. So, fat_detach can be removed from vfat_unlink

NAK.  Please, realize that unlink and destruction of file are separate
operations.  ->evict_inode() may be called long after ->unlink(); moreover,
during that time you might have another file created, getting the
same directory entry our file used to have.

This is Unix, damnit.  You *can* open file, then unlink it and that file
will keep existing (i.e. you can write to that descriptor, read, etc.)
until it's closed.

  reply	other threads:[~2012-08-31 17:29 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-08-31 16:48 [PATCH] fat: remove redundent call to fat_detach in vfat_unlink Namjae Jeon
2012-08-31 17:29 ` Al Viro [this message]
2012-09-03  6:08   ` Namjae Jeon

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=20120831172900.GC23464@ZenIV.linux.org.uk \
    --to=viro@zeniv.linux.org.uk \
    --cc=akpm@linux-foundation.org \
    --cc=amit.sahrawat83@gmail.com \
    --cc=hirofumi@mail.parknet.co.jp \
    --cc=linkinjeon@gmail.com \
    --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).