public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Dave Chinner <david@fromorbit.com>
To: Ales Novak <alnovak@suse.cz>
Cc: xfs@oss.sgi.com
Subject: Re: [PATCH] xfs: fix in the setting of logbsize
Date: Sat, 6 Jun 2015 08:22:57 +1000	[thread overview]
Message-ID: <20150605222257.GY24666@dastard> (raw)
In-Reply-To: <1433510925-11438-1-git-send-email-alnovak@suse.cz>

[dropped lkml from the cc list, XFS specific noise is not needed
there.]

On Fri, Jun 05, 2015 at 03:28:45PM +0200, Ales Novak wrote:
> Logbsize should be integer multiple of log stripe unit size. If it's
> not, various operations will lead to crashes, due to invalid buffer
> sizes, i.e. we've seen crashes in the callpath xlog_sync->xlog_pack_data.

Can you give more information about the crashes? From this
description, I do not know whether this is a work around or a fix
because I don't know  what code is actually causing the problem or
the circumstances in which the crash occurs. Hence I cannot
determine if your change is the right change to make or whether the
documetnation is simply wrong and we have a real bug we shoul dbe
fixing.

> However, this rule is only mentioned in the documentation, while it
> could be checked during the mount.

Where in the documentation is that mentioned?

> Signed-off-by: Ales Novak <alnovak@suse.cz>
> ---
>  fs/xfs/xfs_super.c | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/fs/xfs/xfs_super.c b/fs/xfs/xfs_super.c
> index 8fcc4cc..1a3766d 100644
> --- a/fs/xfs/xfs_super.c
> +++ b/fs/xfs/xfs_super.c
> @@ -1352,6 +1352,11 @@ xfs_finish_flags(
>  			xfs_warn(mp,
>  		"logbuf size must be greater than or equal to log stripe size");
>  			return -EINVAL;
> +		} else if (mp->m_logbsize > 0 && mp->m_sb.sb_logsunit > 0 &&
> +			   mp->m_logbsize % mp->m_sb.sb_logsunit) {
> +			xfs_warn(mp,
> +		"logbuf size must be integer multiple of log stripe size");
> +			return -EINVAL;
>  		}
>  	} else {
>  		/* Fail a mount if the logbuf is larger than 32K */

If the logbsize was not specified as a mount option, we simply use
what is on disk. If it was specified as a mount option, we know that
we've already constrained m_logbsize to 32k, 64k, 128k or 256k (in
xfs_parse_args()). Which then means the above code will refuse to
mount a filesystem where the logsunit is not a power of two. e.g.
logsunit of 96k and logbsize=192k will not be allowed to mount...

So, at minimum, we need to refine more than just check for integer
multiples here, and so we need to look at whether arbitrary stripe
unit alignments in mkfs are valid given the power-of-2 restriction
on the log buffer size which may be overly restrictive...

Cheers,

Dave.
-- 
Dave Chinner
david@fromorbit.com

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

  reply	other threads:[~2015-06-05 22:23 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-05 13:28 [PATCH] xfs: fix in the setting of logbsize Ales Novak
2015-06-05 22:22 ` Dave Chinner [this message]
2015-06-05 23:03   ` Eric Sandeen
2015-06-06 22:32     ` Dave Chinner
2015-07-03 15:09       ` Ales Novak
2015-06-07  9:16   ` Ales Novak
2015-06-08 13:04     ` Mark Tinguely
2015-06-25 22:58       ` Ales Novak

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=20150605222257.GY24666@dastard \
    --to=david@fromorbit.com \
    --cc=alnovak@suse.cz \
    --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