All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@digeo.com>
To: Bryan Henderson <hbryan@us.ibm.com>
Cc: "linux-fsdevel@vger.kernel.org" <linux-fsdevel@vger.kernel.org>,
	Chris Mason <mason@suse.com>,
	"Stephen C. Tweedie" <sct@redhat.com>
Subject: Re: [PATCH] 2.5.x write_super is not for syncing
Date: Tue, 03 Dec 2002 20:29:57 -0800	[thread overview]
Message-ID: <3DED84C5.4085EBDD@digeo.com> (raw)
In-Reply-To: OFF9CCEDC2.D771947C-ON87256C85.00053348-88256C85.000B6EFC@boulder.ibm.com

Bryan Henderson wrote:
> 
> >Well, I'd say that telling the fs about umount activity is "out
> >of scope" for this exercise ;)
> 
> Not sure what your point is here.  The filesystem driver already knows when
> the filesystem image is being destroyed (i.e. the struct super_block is
> going away), which is the only umount activity I'm talking about.  If
> destroying a filesystem image of a particular type means cached stuff has
> to get sync'ed, the filesystem driver knows to do it then; there's no need
> for a ->sync_fs call in addition to ->put_super.

In the context of the 2.4 kernel it is not practical to change every
filesystem to sync itself at unmount.

Nor in 2.5, by my hand...

> >It seems reasonable to have a super_op which says "sync everything
> >to disk".
> 
> Well, maybe, but the question is when should FS call that?  I say
> performing the sync() system call is the only time it should.  If it calls
> it for any other reason, it is making assumptions about how the particular
> filesystem type works.

Yes, it always has.  And Linux's tradition of forcing the filesystems
to comply with the VFS's and VM's requirements has always been a
strength.  Because we can make deep changes to the VM and VFS without
having to make deep changes to filesytems.

Yes, this makes porting filesystems from other OS'es harder.  That is
tough luck.  It's better this way.  Filesystems which do weird stuff
are a pain - they drag down core kernel development.

> Because "sync everything to disk" is ambiguous in the modern diverse world
> of filesystems (so is fsync() -- note that standards define these pretty
> vaguely in recognition of that), the only sensible way to define it is to
> say "it's what sync() does -- ask your filesystem type designer what sync()
> does on your filesystem."
> 
> If there's any other writing of cached data to disk that needs to be done,
> I say the filesystem driver knows when to do it; FS should not presume to
> know.

The move is more toward "if the fs needs to do special stuff then it
should have a hook to do that".  In concrete terms, this means rather
than "write your superblock now" we need to tell the fs what's happening
at a higher level, and if the fs isn't interested, perform the default
(ext2-style) operation.

I don't think anyone has a problem with that approach.  And as new
filesystems are added to Linux, each one brings in its own set
of new hooks.  And I think that's a fine approach - we should not
be speculatively adding hooks if they have no in-kernel consumers.
 
> Of course, in ext2 and its ilk, FS understands the inner workings and is
> deeply involved in caching and uses the traditional ->write_super, etc. to
> carry it out.  We're only talking about new, more general kinds of
> filesystems now.

->write_super() seems to be a bit of a crock.  It _should_ be "the VFS
superblock info has changed.  You should propagate that to pagecache
but not start IO against it".  It's not clear what it actually means
at present.

But for your fs, I suspect we'll need to see specific descriptions
of the problems which are being encountered, and patches.

  reply	other threads:[~2002-12-04  4:29 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-10-16 18:00 [PATCH] 2.5.x write_super is not for syncing Chris Mason
2002-12-02 22:07 ` Andrew Morton
2002-12-02 23:40   ` Chris Mason
2002-12-03  0:03     ` Andrew Morton
2002-12-03  1:10       ` Chris Mason
2002-12-03  1:40         ` Andrew Morton
2002-12-03  3:09           ` Andrew Morton
2002-12-03 19:36             ` Bryan Henderson
2002-12-03 20:06               ` Andrew Morton
2002-12-03 21:41                 ` Bryan Henderson
2002-12-03 22:13                   ` Andrew Morton
2002-12-04  2:05                     ` Bryan Henderson
2002-12-04  4:29                       ` Andrew Morton [this message]
2002-12-04 19:00                         ` Bryan Henderson
2002-12-04 19:23                           ` Matthew Wilcox
2002-12-04 22:17                             ` Bryan Henderson
2002-12-05 10:36                               ` Arnaldo Carvalho de Melo
2002-12-05 16:31                                 ` Stephen C. Tweedie
2002-12-05 17:24                                   ` girish
2002-12-04 21:10                       ` Stephen C. Tweedie
2002-12-04 22:46                         ` Bryan Henderson

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=3DED84C5.4085EBDD@digeo.com \
    --to=akpm@digeo.com \
    --cc=hbryan@us.ibm.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=mason@suse.com \
    --cc=sct@redhat.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.