linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andreas Dilger <adilger@clusterfs.com>
To: Alexandre Ratchov <alexandre.ratchov@bull.net>
Cc: linux-ext4@vger.kernel.org, nfsv4@linux-nfs.org
Subject: Re: rfc: [patch] change attribute for ext3
Date: Thu, 14 Sep 2006 15:01:48 -0600	[thread overview]
Message-ID: <20060914210147.GY6441@schatzie.adilger.int> (raw)
In-Reply-To: <20060914132154.GB28663@openx1.frec.bull.fr>

On Sep 14, 2006  15:21 +0200, Alexandre Ratchov wrote:
> IMHO, the natural place to do this stuff is the VFS, because it can be
> common to all file-systems supporting this feature. Currently it's the same
> with ctime, mtime and atime. These are in the VFS even if there are
> file-systems that don't support all of them.

Well, that is only partly true.  I see lots of places in ext3 that are
setting i_ctime and i_mtime...

> > Ugh, this would definitely hurt performance, because ext3_dirty_inode()
> > packs-for-disk the whole inode each time.  I believe Stephen had patches
> > at one time to do the inode packing at transaction commit time instead
> > of when it is changed, so we only do the packing once.  Having a generic
> > mechanism to do pre-commit callbacks from jbd (i.e. to pack a dirty
> > inode to the buffer) would also be useful for other things like doing
> > the inode or group descriptor checksum only once per transaction...
> 
> afaik, for an open file, there is always a copy of the inode in memory,
> because there is a reference to it in the file structure. So, in principle,
> we shouldn't need to make dirty the inode. I don't know if this is feasable
> perhaps am i missing something here.

The in-memory inode needs to be copied into the buffer so that it is
part of the transaction being committed to disk, or updates are lost.
This was a common bug with early ext3 - marking the inode dirty and
then changing a field in the in-core inode - which would not be saved
to disk.  In other filesystems this is only a few-cycle race, but in
ext3 the in-core inode is not written to disk unless the inode is
again marked dirty.

The potential benefit of making this a callback from the JBD layer is
it avoids copying the inode for EVERY dirty, and only doing it once
per transaction.  Add a list of callbacks hooked onto the transaction
to be called before it is committed, and the callback data is the
inode pointer which does a single ext3_do_update_inode() call if the
inode is still marked dirty.

> it's not strictly necessary; it's not more necessary that the interface to
> ctime or other attributes. It's here for completness, in my opinion the
> change attribute is the same as the ctime time-stamp

Then makes sense to just improve the ctime mechanism instead of adding
new code and interfaces...

Cheers, Andreas
--
Andreas Dilger
Principal Software Engineer
Cluster File Systems, Inc.


  reply	other threads:[~2006-09-14 21:02 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-09-13 16:42 rfc: [patch] change attribute for ext3 Alexandre Ratchov
2006-09-13 18:11 ` Trond Myklebust
2006-09-13 18:30   ` Alexandre Ratchov
2006-09-13 19:06     ` Trond Myklebust
2006-09-13 20:31       ` Randy.Dunlap
2006-09-14  9:23     ` Andreas Dilger
2006-09-14 13:48       ` Alexandre Ratchov
2006-11-14 22:17       ` Andreas Dilger
2006-11-24  0:23         ` Andreas Dilger
2006-11-28 19:00           ` J. Bruce Fields
2006-11-28 22:06             ` Andreas Dilger
2006-09-14 13:46   ` Peter Staubach
2006-09-14 13:56     ` Trond Myklebust
2006-09-14 14:06     ` Alexandre Ratchov
2006-12-14  1:24   ` Andreas Dilger
2006-12-14  1:52     ` J. Bruce Fields
2006-12-14 16:48       ` Trond Myklebust
2006-12-14 23:04         ` Andreas Dilger
2006-09-13 19:31 ` Andreas Dilger
2006-09-14  1:24   ` J. Bruce Fields
2006-09-14 13:21   ` Alexandre Ratchov
2006-09-14 21:01     ` Andreas Dilger [this message]
2006-09-15 10:19       ` Alexandre Ratchov
2006-09-15 16:18         ` Andreas Dilger
2006-11-29 18:54 ` [RFC] [patch 0/3] change attribute for ext4 Jean-Noel Cordenner

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=20060914210147.GY6441@schatzie.adilger.int \
    --to=adilger@clusterfs.com \
    --cc=alexandre.ratchov@bull.net \
    --cc=linux-ext4@vger.kernel.org \
    --cc=nfsv4@linux-nfs.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).