public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Al Viro <viro@zeniv.linux.org.uk>,
	linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [RFC] st_nlink after rmdir() and rename()
Date: Fri, 04 Mar 2011 05:46:27 +0900	[thread overview]
Message-ID: <87tyfk7x0c.fsf@devron.myhome.or.jp> (raw)
In-Reply-To: <AANLkTi=85DJo-Qy0bABKg1J_j0s=8HfTt1m+rq4E5GqS@mail.gmail.com> (Linus Torvalds's message of "Thu, 3 Mar 2011 12:05:43 -0800")

Linus Torvalds <torvalds@linux-foundation.org> writes:

> On Wed, Mar 2, 2011 at 10:03 PM, Al Viro <viro@zeniv.linux.org.uk> wrote:
>>
>> IOW, it's a QoI question - sure, NFS is weird and you lose a lot of usual
>> warranties there when it comes to object removal.  But why get local
>> fs behaving strangely?  It's not like "decrement i_nlink from 2 to 1" was
>> cheaper than "assign 0 to i_nlink", after all.
>>
>> FWIW, a lot of local filesystems have no notion of links; they tend to
>> maintain zero/non-zero distinction just fine.  Including those that have
>> all directories with i_nlink == 1 for as long as directory lives.
>
> The thing is, I don't think it's a QoI question at all - since any
> user that _depends_ on this kind of behavior is simply broken. We
> aren't going to guarantee it, exactly because some filesystems simply
> will not ever guarantee it.
>
> Now, for FAT we do in fact try rather hard to fake the i_nlink count,
> but I'm not at all convinced that's a good idea. It makes reading
> directory inodes on FAT much more expensive (we have to basically do a
> readdir for each open). So I'd hate to make that whole "you need to
> emulate i_nlink even if you really don't care" be something that we
> actually end up thinking is a quality issue.

Yes. It's one of reason linux's FAT is slow for some operations (from
original designs).

> There are other filesystems where i_nlink can be even _less_
> meaningful, ie if the filesystem does any kind of fancy
> content-indexing thing or lazy COW (think "union filesystem within the
> filesystem") or whatever, I could easily see i_nlink not having any
> traditional unix filesystem semantics.

But, some commands see i_nlink (IIRC, it's checking i_nlink == 2, to
know empty dir or not). So we have to simulate some levels. I guess you
are not saying we don't need to care it at all though.

I think if it's _really easy_ to do, I think we should try.

Thanks.
-- 
OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>

  reply	other threads:[~2011-03-03 20:46 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-03  3:24 [RFC] st_nlink after rmdir() and rename() Al Viro
2011-03-03  4:42 ` Al Viro
2011-03-03  5:17 ` Linus Torvalds
2011-03-03  6:03   ` Al Viro
2011-03-03 20:05     ` Linus Torvalds
2011-03-03 20:46       ` OGAWA Hirofumi [this message]
2011-03-03 20:50         ` OGAWA Hirofumi
2011-03-03 21:02         ` Linus Torvalds
2011-03-03 21:30           ` Al Viro
2011-03-03 21:37           ` OGAWA Hirofumi
2011-03-03 21:52             ` Linus Torvalds
2011-03-03 22:26               ` OGAWA Hirofumi
2011-03-03 22:37                 ` Linus Torvalds
2011-03-03 23:14                   ` OGAWA Hirofumi
2011-03-03 23:12                 ` Al Viro
2011-03-03 22:57               ` Al Viro
2011-03-03 23:07                 ` Al Viro
2011-03-04  6:55                 ` omfs fixes Al Viro
2011-03-04 15:24                   ` Bob Copeland
2011-03-03 21:23       ` [RFC] st_nlink after rmdir() and rename() Al Viro
2011-03-03 14:34 ` Theodore Tso
2011-03-03 16:17   ` Andreas Schwab
2011-03-03 19:16   ` Al Viro

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=87tyfk7x0c.fsf@devron.myhome.or.jp \
    --to=hirofumi@mail.parknet.co.jp \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@linux-foundation.org \
    --cc=viro@zeniv.linux.org.uk \
    /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