From: Alex Elder <aelder@sgi.com>
To: Christoph Hellwig <hch@infradead.org>
Cc: xfs@oss.sgi.com
Subject: Re: [PATCH] xfs: fix access to upper inodes without inode64
Date: Fri, 28 May 2010 13:19:19 -0500 [thread overview]
Message-ID: <1275070759.2302.14.camel@doink> (raw)
In-Reply-To: <20100527190515.GA16102@infradead.org>
On Thu, 2010-05-27 at 15:05 -0400, Christoph Hellwig wrote:
> If a filesystem is mounted without the inode64 mount option we should still
> be able to access inodes not fitting into 32 bits, just not created new
> ones. For this to work we need to make sure the inode cache radix tree
> is initialized for all allocation groups, not just those we plan to allocate
> inodes from. This patch makes sure we initialize the inode cache radix
> tree for all allocation groups, and also cleans xfs_initialize_perag up
> a bit to separate the inode32 logical from the general perag structure
> setup.
This looks generally good, but I have a comment below that
is not a bug now but could become one.
> Signed-off-by: Christoph Hellwig <hch@lst.de>
>
> Index: xfs/fs/xfs/xfs_mount.c
> ===================================================================
> --- xfs.orig/fs/xfs/xfs_mount.c 2010-05-27 20:59:09.191004330 +0200
> +++ xfs/fs/xfs/xfs_mount.c 2010-05-27 20:59:43.290004329 +0200
. . .
> @@ -497,30 +489,30 @@ xfs_initialize_perag(
> } else {
> max_metadata = agcount;
> }
> +
> for (index = 0; index < agcount; index++) {
> ino = XFS_AGINO_TO_INO(mp, index, agino);
> - if (ino > max_inum) {
> + if (ino > XFS_MAXINUMBER_32) {
> index++;
> break;
> }
>
> - /* This ag is preferred for inodes */
> pag = xfs_perag_get(mp, index);
> pag->pagi_inodeok = 1;
> if (index < max_metadata)
> pag->pagf_metadata = 1;
> - xfs_initialize_perag_icache(pag);
> xfs_perag_put(pag);
> }
> +
> + *maxagi = agcount;
Here you unconditionally assign to *maxagi...
> } else {
> - /* Setup default behavior for smaller filesystems */
> for (index = 0; index < agcount; index++) {
> pag = xfs_perag_get(mp, index);
> pag->pagi_inodeok = 1;
> - xfs_initialize_perag_icache(pag);
> xfs_perag_put(pag);
> }
> }
> +
> if (maxagi)
> *maxagi = index;
...while here it checks to be sure it's non-null before
assigning. Right now, the two places that call this
function always pass the address of something. I don't
care which way it goes, but the two assignments should
be done consistently (either both or neither should check
for null before assignment).
Other than that, this change looks really good. Unless I
hear from you otherwise, I'll make the change before commit.
I will make both (all) spots assume a valid pointer is
passed in.
-Alex
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
next prev parent reply other threads:[~2010-05-28 18:24 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-05-27 19:05 [PATCH] xfs: fix access to upper inodes without inode64 Christoph Hellwig
2010-05-28 18:19 ` Alex Elder [this message]
2010-05-28 19:03 ` Christoph Hellwig
2010-05-28 18:49 ` Alex Elder
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=1275070759.2302.14.camel@doink \
--to=aelder@sgi.com \
--cc=hch@infradead.org \
--cc=xfs@oss.sgi.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox