linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Al Viro <viro@ZenIV.linux.org.uk>
To: Andreas Dilger <adilger@dilger.ca>
Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org,
	Linus Torvalds <torvalds@linux-foundation.org>
Subject: Re: [RFC] killing boilerplate checks in ->link/->mkdir/->rename
Date: Fri, 3 Feb 2012 17:03:00 +0000	[thread overview]
Message-ID: <20120203170300.GW23916@ZenIV.linux.org.uk> (raw)
In-Reply-To: <E950CD52-73DC-404C-A84A-6027CAF7F6E6@dilger.ca>

On Fri, Feb 03, 2012 at 01:25:26AM -0700, Andreas Dilger wrote:
> On 2012-02-02, at 2:24 PM, Al Viro wrote:
> > FWIW, there's something we really should've done a long time ago: putting
> > that limit into sb->s_max_links.  With 0 meaning "leave all checks to
> > ->link/->mkdir/->rename".  Something like the following would make a
> > reasonable start - just the conversion of obvious cases.  As the next
> > step I'd probably initialize it as ~0U instead of 0 and let the filesystems
> > that want something trickier (reiserfs, ext4, gfs2, ocfs2) explicitly set
> > it to 0 in their foo_fill_super().  That would take care of a bunch of cases
> > where we forgot to do those checks (ubifs, hfsplus, jffs2, ramfs, etc.) and
> > it's probably a saner default anyway.
> 
> This would also give userspace some hope of pathconf(path, _PC_LINK_MAX)
> returning the actual value from the filesystem, instead of hard-coding
> this into glibc itself based on the statfs-returned f_type magic value.

*snort*

Even skipping the standard flame about pathconf() as an API, this will
not work.
	* we have filesystems that do not allow link creation at all and
do keep track of subdirectories count in i_nlink of directories.  What
would you have them store?  As it is, ~0U works just fine, but pathconf()
users won't be happy with it.
	* we have filesystems that allow unlimited subdirectories, while
limiting the number of links to non-directories; ->s_max_links == 0 will
work just fine, but won't make pathconf() happy.
	* we have filesystems that have more complex rules re links to
non-directory (see mail from Chris in this thread).  What would you have
pathconf() do?

  reply	other threads:[~2012-02-03 17:03 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20120130222717.GA6393@kroah.com>
     [not found] ` <m18vkoirv9.fsf@fess.ebiederm.org>
     [not found]   ` <4F27C6EB.2070305@suse.cz>
     [not found]     ` <m14nvc82jo.fsf@fess.ebiederm.org>
     [not found]       ` <CA+55aFwZNdoAA9iPMiEp8-+ndgV+CtSZO4neSh_L+gd77k7-vg@mail.gmail.com>
     [not found]         ` <m1wr87ywex.fsf@fess.ebiederm.org>
     [not found]           ` <m1ehueyz20.fsf_-_@fess.ebiederm.org>
     [not found]             ` <CA+55aFyNQnXrL7fWhBt4LYBuoHD_x+j=Af-N=ueFMBkymy9Rnw@mail.gmail.com>
     [not found]               ` <CA+55aFzZX544ZDN9vN3jWMWZ=_9ZtpZ9cR6gNEzUnx9RCqR5LQ@mail.gmail.com>
     [not found]                 ` <20120202012258.GQ23916@ZenIV.linux.org.uk>
2012-02-02 21:24                   ` [RFC] killing boilerplate checks in ->link/->mkdir/->rename Al Viro
2012-02-02 23:46                     ` Linus Torvalds
2012-02-03  1:16                       ` Al Viro
2012-02-03  1:45                         ` Al Viro
2012-02-03  2:00                           ` Linus Torvalds
2012-02-03 14:57                         ` Chris Mason
2012-02-03 17:08                         ` Al Viro
2012-02-03 19:34                           ` Artem Bityutskiy
2012-02-06  8:50                           ` Artem Bityutskiy
2012-02-06 13:56                             ` Al Viro
2012-02-06 17:05                               ` Artem Bityutskiy
2012-02-06 17:11                                 ` Al Viro
2012-02-07  7:21                                   ` Artem Bityutskiy
2012-02-06 22:49                         ` Dave Chinner
2012-02-03  8:25                     ` Andreas Dilger
2012-02-03 17:03                       ` Al Viro [this message]
2012-02-04  7:42                         ` Andreas Dilger

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=20120203170300.GW23916@ZenIV.linux.org.uk \
    --to=viro@zeniv.linux.org.uk \
    --cc=adilger@dilger.ca \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@linux-foundation.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).