linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andreas Dilger <adilger@clusterfs.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: cmm@us.ibm.com, linux-fsdevel@vger.kernel.org,
	linux-kernel@vger.kernel.org, linux-ext4@vger.kernel.org,
	nfsv4@linux-nfs.org
Subject: Re: [EXT4 set 4][PATCH 3/5] i_version:ext4 inode version read/store
Date: Wed, 11 Jul 2007 05:50:13 -0600	[thread overview]
Message-ID: <20070711115013.GS6417@schatzie.adilger.int> (raw)
In-Reply-To: <20070710163117.d14fce90.akpm@linux-foundation.org>

On Jul 10, 2007  16:31 -0700, Andrew Morton wrote:
> > This patch adds 64-bit inode version support to ext4. The lower 32 bits
> > are stored in the osd1.linux1.l_i_version field while the high 32 bits
> > are stored in the i_version_hi field newly created in the ext4_inode.
> 
> So reading the code here does serve to answer the question I raised against
> the earlier patch.  A bit.
> 
> I'd have thought that this patch and the one which adds i_version_hi should
> be folded into a single diff?

It could be - the original patch to reserve i_version_hi was submitted to
before the patches were ready to avoid that space being used by something
else.

> > +	if (EXT4_INODE_SIZE(inode->i_sb) > EXT4_GOOD_OLD_INODE_SIZE) {
> > +		if (EXT4_FITS_IN_INODE(raw_inode, ei, i_version_hi))
> > +			inode->i_version |=
> > +			(__u64)(le32_to_cpu(raw_inode->i_version_hi)) << 32;
> 
> <checks the precedence of "(type)" versus "<<">
> 
> <OK>
> 
> > +	}
> 
> I don't quite see how the above two tests are sufficient to unambiguously
> determine that the i_version_hi field is present on-disk.
> 
> I guess we're implicitly assuming that if the on-disk inode is big enough
> then it _must_ have i_version_hi in there?  If so, why is the comparison
> with EXT4_GOOD_OLD_INODE_SIZE needed?

The GOOT_OLD_INODE_SIZE check is needed to know if i_extra_isize is even
present or valid in the on-disk inode.

> > @@ -2852,8 +2859,14 @@ static int ext4_do_update_inode(handle_t
> > +	raw_inode->i_disk_version = cpu_to_le32(inode->i_version);
> > +	if (ei->i_extra_isize) {
> > +		if (EXT4_FITS_IN_INODE(raw_inode, ei, i_version_hi)) {
> 
> There's no comparison with EXT4_GOOD_OLD_INODE_SIZE here...

Because this is the in-memory version and it is always valid (set to zero
if there is extra space in the on-disk inode).

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

      reply	other threads:[~2007-07-11 11:50 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-07-01  7:37 [EXT4 set 4][PATCH 3/5] i_version:ext4 inode version read/store Mingming Cao
2007-07-10 23:31 ` Andrew Morton
2007-07-11 11:50   ` Andreas Dilger [this message]

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=20070711115013.GS6417@schatzie.adilger.int \
    --to=adilger@clusterfs.com \
    --cc=akpm@linux-foundation.org \
    --cc=cmm@us.ibm.com \
    --cc=linux-ext4@vger.kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@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).