From: Dave Chinner <david@fromorbit.com>
To: Guangyu Sun <guangyu.sun@oracle.com>
Cc: Koen De Wit <koen.de.wit@oracle.com>, xfs@oss.sgi.com
Subject: Re: [PATCH v2] xfsprogs: properly check size arguments for growfs
Date: Mon, 18 Nov 2013 06:35:18 +1100 [thread overview]
Message-ID: <20131117193518.GS6188@dastard> (raw)
In-Reply-To: <1384459290-16291-1-git-send-email-guangyu.sun@oracle.com>
On Thu, Nov 14, 2013 at 12:01:30PM -0800, Guangyu Sun wrote:
> xfs_growfs has lowercase options to grow a filesystem as big as possible
> (e.g. the -d option) and uppercase options to grow a filesystem to a
> specified size, expressed in blocks. (e.g. the "-D size" option)
>
> If the size parameter is not numerical, the parameter is either trimmed or
> ignored. In the latter case, the filesystem is grown as big as possible. This
> may happen when users accidentally specify the size in a format similar to
> mkfs.xfs (e.g. "-D 100m" or "-D size=16384")
>
> In both cases, xfs_growfs should return an error instead of resizing the
> filesystem.
>
> To reproduce:
> # mkfs.xfs -f -d size=20m -L koenfs /dev/dm-3
> # mount /dev/dm-3 //mnt
> # xfs_growfs -D 10000andmorethan10invalidcharacters /mnt
> (...)
> data blocks changed from 5120 to 10000
> # xfs_growfs -D invalidargument20000containingnumbers /mnt
> (...)
> data blocks changed from 10000 to 19659543
>
> Reported-by: Koen De Wit <koen.de.wit@oracle.com>
> Signed-off-by: Guangyu Sun <guangyu.sun@oracle.com>
Perhaps this should be changed to use cvtnum() from libxcmd? That
will fix the input validation problem, and also allow xfs_growfs to
all the different methods of specifying size that we use elsewhere
in xfsprogs...
Cheers,
Dave.
--
Dave Chinner
david@fromorbit.com
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
prev parent reply other threads:[~2013-11-17 19:35 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-11-14 20:01 [PATCH v2] xfsprogs: properly check size arguments for growfs Guangyu Sun
2013-11-17 19:35 ` Dave Chinner [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=20131117193518.GS6188@dastard \
--to=david@fromorbit.com \
--cc=guangyu.sun@oracle.com \
--cc=koen.de.wit@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