From: Eric Sandeen <sandeen@sandeen.net>
To: Timothy Shimmin <tes@sgi.com>
Cc: xfs-oss <xfs@oss.sgi.com>
Subject: Re: [PATCH, RFC] fix attr fit checking for filesystems which have lost their attr2
Date: Mon, 31 Mar 2008 08:32:22 -0500 [thread overview]
Message-ID: <47F0E7E6.8000006@sandeen.net> (raw)
In-Reply-To: <47F086C8.7070400@sgi.com>
Timothy Shimmin wrote:
> Eric,
>
> So probably need something like this for xfs_bmap_compute_maxlevels()...
Yep, I think that looks good. I had forgotten that you could mount with
"noattr2" to change the default behavior... so this isn't only a bug
w.r.t. bad_features2, is it.
Thanks,
-Eric
>
> --Tim
>
> ===========================================================================
> Index: fs/xfs/xfs_bmap.c
> ===========================================================================
>
> --- a/fs/xfs/xfs_bmap.c 2008-03-31 16:32:24.000000000 +1000
> +++ b/fs/xfs/xfs_bmap.c 2008-03-31 16:21:11.439806073 +1000
> @@ -4154,16 +4154,21 @@ xfs_bmap_compute_maxlevels(
> * number of leaf entries, is controlled by the type of di_nextents
> * (a signed 32-bit number, xfs_extnum_t), or by di_anextents
> * (a signed 16-bit number, xfs_aextnum_t).
> + *
> + * Note that we can no longer assume that if we are in ATTR1 that
> + * the fork offset of all the inodes will be (m_attroffset >> 3)
> + * because we could have mounted with ATTR2 and then mounted back
> + * with ATTR1, keeping the di_forkoff's fixed but probably at
> + * various positions. Therefore, for both ATTR1 and ATTR2
> + * we have to assume the worst case scenario of a minimum size
> + * available.
> */
> if (whichfork == XFS_DATA_FORK) {
> maxleafents = MAXEXTNUM;
> - sz = (mp->m_flags & XFS_MOUNT_ATTR2) ?
> - XFS_BMDR_SPACE_CALC(MINDBTPTRS) : mp->m_attroffset;
> + sz = XFS_BMDR_SPACE_CALC(MINDBTPTRS);
> } else {
> maxleafents = MAXAEXTNUM;
> - sz = (mp->m_flags & XFS_MOUNT_ATTR2) ?
> - XFS_BMDR_SPACE_CALC(MINABTPTRS) :
> - mp->m_sb.sb_inodesize - mp->m_attroffset;
> + sz = XFS_BMDR_SPACE_CALC(MINABTPTRS);
> }
> maxrootrecs = (int)XFS_BTREE_BLOCK_MAXRECS(sz, xfs_bmdr, 0);
> minleafrecs = mp->m_bmap_dmnr[0];
>
prev parent reply other threads:[~2008-03-31 14:04 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-03-29 4:56 [PATCH, RFC] fix attr fit checking for filesystems which have lost their attr2 Eric Sandeen
2008-03-31 0:52 ` Timothy Shimmin
2008-03-31 1:45 ` Eric Sandeen
2008-03-31 4:37 ` Timothy Shimmin
2008-03-31 6:11 ` Timothy Shimmin
2008-03-31 6:38 ` Timothy Shimmin
2008-03-31 13:32 ` Eric Sandeen [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=47F0E7E6.8000006@sandeen.net \
--to=sandeen@sandeen.net \
--cc=tes@sgi.com \
--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