From: Mark Tinguely <tinguely@sgi.com>
To: Jeff Liu <jeff.liu@oracle.com>
Cc: "xfs@oss.sgi.com" <xfs@oss.sgi.com>
Subject: Re: [PATCH] xfs: Don't keep silent if sunit/swidth can not be changed via mount
Date: Mon, 29 Apr 2013 09:51:18 -0500 [thread overview]
Message-ID: <517E88E6.9070709@sgi.com> (raw)
In-Reply-To: <517E5D12.5010809@oracle.com>
On 04/29/13 06:44, Jeff Liu wrote:
> From: Jie Liu<jeff.liu@oracle.com>
>
> As per the mount man page, sunit and swidth can be changed via
> mount options. For XFS, on the face of it, those options seems
> works if the specified alignments is properly, e.g.
> # mount -o sunit=4096,swidth=8192 /dev/sdb1 /mnt
> # mount | grep sdb1
> /dev/sdb1 on /mnt type xfs (rw,sunit=4096,swidth=8192)
>
> However, neither sunit nor swidth is shown from the xfs_info output.
> # xfs_info /mnt
> meta-data=/dev/sdb1 isize=256 agcount=4, agsize=262144 blks
> = sectsz=512 attr=2
> data = bsize=4096 blocks=1048576, imaxpct=25
> = sunit=0 swidth=0 blks
> ^^^^^^^^^^^^^^^^^^^^^^^^^^
> naming =version 2 bsize=4096 ascii-ci=0
> log =internal bsize=4096 blocks=2560, version=2
> = sectsz=512 sunit=0 blks, lazy-count=1
> realtime =none extsz=4096 blocks=0, rtextents=0
>
> The reason is that the alignment can only be changed if the relevant
> super block is already configured with alignments, otherwise, the
> given value will be silently ignored, so it's better to tell user
> that the alignment-changing can not take affect in one way or another.
>
> With this fix, the attempt to mount a storage without strip alignment
> setup on super block will failed if XFS_MOUNT_RETERR is enabled, or
> just ignore the given alignment and drop a warning to indicate the
> cause in syslog.
>
> # mount -o sunit=4096,swidth=8192 /dev/sdb1 /mnt
> mount: wrong fs type, bad option, bad superblock on /dev/sdb1,
> missing codepage or helper program, or other error
> In some cases useful info is found in syslog - try
> dmesg | tail or so
>
> # dmesg|tail
> .......
> XFS (sdb1): can not change alignment: no data alignment on superblock
>
> Signed-off-by: Jie Liu<jeff.liu@oracle.com>
>
> ---
> fs/xfs/xfs_mount.c | 7 +++++++
> 1 file changed, 7 insertions(+)
>
> diff --git a/fs/xfs/xfs_mount.c b/fs/xfs/xfs_mount.c
> index 3806088..bc7fdd4 100644
> --- a/fs/xfs/xfs_mount.c
> +++ b/fs/xfs/xfs_mount.c
> @@ -924,6 +924,13 @@ xfs_update_alignment(xfs_mount_t *mp)
> sbp->sb_width = mp->m_swidth;
> mp->m_update_flags |= XFS_SB_WIDTH;
> }
> + } else {
> + xfs_warn(mp, "can not change alignment: "
> + "no data alignment on superblock");
suggest that you keep the string together so it can be searched.
"superblock does not support data alignment"
> + if (mp->m_flags& XFS_MOUNT_RETERR)
> + return XFS_ERROR(EINVAL);
> + mp->m_dalign = 0;
> + mp->m_swidth = 0;
> }
> } else if ((mp->m_flags& XFS_MOUNT_NOALIGN) != XFS_MOUNT_NOALIGN&&
> xfs_sb_version_hasdalign(&mp->m_sb)) {
Thanks,
--Mark.
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
next prev parent reply other threads:[~2013-04-29 14:51 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-04-29 11:44 [PATCH] xfs: Don't keep silent if sunit/swidth can not be changed via mount Jeff Liu
2013-04-29 14:51 ` Mark Tinguely [this message]
2013-04-30 2:11 ` Jeff Liu
2013-04-30 7:36 ` Dave Chinner
2013-04-30 7:54 ` Jeff Liu
2013-04-30 11:35 ` Dave Chinner
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=517E88E6.9070709@sgi.com \
--to=tinguely@sgi.com \
--cc=jeff.liu@oracle.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