All of lore.kernel.org
 help / color / mirror / Atom feed
From: Greg Banks <gnb@sgi.com>
To: Christoph Hellwig <hch@lst.de>
Cc: nfs@lists.sourceforge.net, linux-fsdevel@vger.kernel.org
Subject: Re: [NFS] [PATH 10/19] xfs: new export ops
Date: Sat, 15 Sep 2007 01:22:16 +1000	[thread overview]
Message-ID: <20070914152216.GI21965@sgi.com> (raw)
In-Reply-To: <20070830131641.GK6834@lst.de>

On Thu, Aug 30, 2007 at 03:16:41PM +0200, Christoph Hellwig wrote:
> -#if XFS_BIG_INUMS
>  	bhv_vfs_t		*vfs = vfs_from_sb(inode->i_sb);
>  
> -	if (!(vfs->vfs_flag & VFS_32BITINODES)) {
> -		/* filesystem may contain 64bit inode numbers */
> -		is64 = XFS_FILEID_TYPE_64FLAG;
> -	}
> -#endif
>  
>  	/* Directories don't need their parent encoded, they have ".." */
>  	if (S_ISDIR(inode->i_mode))
> -	    connectable = 0;
> +		fileid_type = FILEID_INO32_GEN;
> +	else
> +		fileid_type = FILEID_INO32_GEN_PARENT;
> +
> +	/* filesystem may contain 64bit inode numbers */
> +	if (!(vfs->vfs_flag & VFS_32BITINODES))
> +		fileid_type |= XFS_FILEID_TYPE_64FLAG;

Not really a comment on your patches, but I got the original logic
wrong here.  The VFS_32BITINODES flag only affects newly allocated
inodes and is no guarantee that any particular inode is < 2^32-1.
It's possible for an unlucky user to perform a sequence of mounts
and IO which results in large inode numbers despite the presence of
that flag; we recently saw this happen by accident on a customer site.
So the right thing to do is probably to check the inode number against
(u32)~0.  Unfortunately, given the current encoding scheme, you have to
check both the inode and the parent inode, which complicates the logic.

Greg.
-- 
Greg Banks, R&D Software Engineer, SGI Australian Software Group.
Apparently, I'm Bedevere.  Which MPHG character are you?
I don't speak for SGI.

  reply	other threads:[~2007-09-14 15:22 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-08-30 13:16 [PATH 10/19] xfs: new export ops Christoph Hellwig
2007-08-30 13:16 ` Christoph Hellwig
2007-09-14 15:22 ` Greg Banks [this message]
2007-09-14 16:03   ` [NFS] " Christoph Hellwig
2007-09-14 16:46     ` Greg Banks

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=20070914152216.GI21965@sgi.com \
    --to=gnb@sgi.com \
    --cc=hch@lst.de \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=nfs@lists.sourceforge.net \
    /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.