All of lore.kernel.org
 help / color / mirror / Atom feed
From: Eric Sandeen <sandeen@sandeen.net>
To: Chandan Rajendra <chandan@linux.vnet.ibm.com>, linux-xfs@vger.kernel.org
Cc: darrick.wong@oracle.com
Subject: Re: [PATCH] xfs: do not unconditionally enable hasalign feature on V5 filesystems
Date: Wed, 15 Feb 2017 11:03:11 -0600	[thread overview]
Message-ID: <20b8b2b4-9586-1300-2591-f90c67a401e3@sandeen.net> (raw)
In-Reply-To: <7dd96d6b-ccb5-105f-18aa-207e1c28c625@sandeen.net>

On 2/15/17 10:13 AM, Eric Sandeen wrote:
>> The root cause of the problem is due to the fact that
>> xfs_sb_version_hasalign() returns true when we are working on a V5
>> filesystem. Due to this args.minalignslop (in xfs_ialloc_ag_alloc())
>> gets the unsigned equivalent of -1 assigned to it. This later causes
>> alloc_len in xfs_alloc_space_available() to have a value of 0. In such a
>> scenario when args.total is also 0, the assert statement
>> "ASSERT(args->maxlen > 0);" fails.
> Hm, the intent of the _haslign() function is to say that V5 must always
> imply the "alignbit" - i.e. we don't want to grow an infinite feature
> matrix, and by the time you get to V5 supers, there are many things which
> cannot be turned on or off, such as this feature.
> 
> So what happens here... xfs_ialloc_ag_alloc does:
> 
> args.minalignslop = xfs_ialloc_cluster_alignment(args.mp) - 1;
> 
> so you're saying that cluster_alignment comes out as 0?
> 
> That function is checking _hasalign:
> 
> static inline int
> xfs_ialloc_cluster_alignment(
>         struct xfs_mount        *mp)
> {
>         if (xfs_sb_version_hasalign(&mp->m_sb) &&
>             mp->m_sb.sb_inoalignmt >=
>                         XFS_B_TO_FSBT(mp, mp->m_inode_cluster_size))
>                 return mp->m_sb.sb_inoalignmt;
>         return 1;
> }
> 
> So are you saying that this function returns 0?  That would imply that
> sb_inoalignmt and m_inode_cluster_size are both zero, yes?  Is this
> what you see?

Sorry, I guess that means XFS_B_TO_FSBT(mp, mp->m_inode_cluster_size)) is
zero; inode cluster size is 8192 in this case I think, and that is in fact
0 filesystem blocks when computed with this macro.

I need to think about this a little bit to convince myself that the inode
alignment bit really /should/ be off for a filesystem of this geometry, vs
changing the macro to recognize the case.

-Eric

  reply	other threads:[~2017-02-15 17:03 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-15 15:57 [PATCH] xfs: do not unconditionally enable hasalign feature on V5 filesystems Chandan Rajendra
2017-02-15 16:13 ` Eric Sandeen
2017-02-15 17:03   ` Eric Sandeen [this message]
2017-02-15 17:16     ` Darrick J. Wong
2017-02-15 18:00       ` Chandan Rajendra
2017-02-15 22:53       ` Eric Sandeen
2017-02-15 17:36     ` Chandan Rajendra
2017-02-16  3:29   ` Eric Sandeen
2017-02-16 12:22     ` Chandan Rajendra

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=20b8b2b4-9586-1300-2591-f90c67a401e3@sandeen.net \
    --to=sandeen@sandeen.net \
    --cc=chandan@linux.vnet.ibm.com \
    --cc=darrick.wong@oracle.com \
    --cc=linux-xfs@vger.kernel.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 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.