From: Eric Sandeen <sandeen@redhat.com>
To: xfs-oss <xfs@oss.sgi.com>
Subject: [PATCH] xfs_growfs: don't grow data if only -m is specified
Date: Thu, 27 Feb 2014 17:28:44 -0600 [thread overview]
Message-ID: <530FCA2C.8090204@redhat.com> (raw)
While writing an xfstest to check imaxpct behavior, I realized
that xfs_growfs -m XXX /mnt/point will not only change
imaxpct, but also grow the filesystem if it's not currently
occupying the entire block device. This doesn't seem like
the expected behavior, so split it out such that if only
-m, and not -d, is specified, only the imaxpct will be
changed.
This is a change from previous behavior, but I think it
satisfies the principle of least surprise...
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
---
diff --git a/growfs/xfs_growfs.c b/growfs/xfs_growfs.c
index 2df68fb..fb7eda8 100644
--- a/growfs/xfs_growfs.c
+++ b/growfs/xfs_growfs.c
@@ -189,7 +189,7 @@ main(int argc, char **argv)
usage();
if (iflag && xflag)
usage();
- if (dflag + lflag + rflag == 0)
+ if (dflag + lflag + rflag + mflag == 0)
aflag = 1;
fs_table_initialise(0, NULL, 0, NULL);
@@ -305,12 +305,15 @@ main(int argc, char **argv)
drsize -= (drsize % 2);
error = 0;
- if (dflag | aflag) {
+
+ if (dflag | mflag | aflag) {
xfs_growfs_data_t in;
if (!mflag)
maxpct = geo.imaxpct;
- if (!dsize)
+ if (!dflag && !aflag) /* Only mflag, no data size change */
+ dsize = geo.datablocks;
+ else if (!dsize)
dsize = ddsize / (geo.blocksize / BBSIZE);
else if (dsize > ddsize / (geo.blocksize / BBSIZE)) {
fprintf(stderr, _(
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
next reply other threads:[~2014-02-27 23:28 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-02-27 23:28 Eric Sandeen [this message]
2014-02-28 1:19 ` [PATCH] xfs_growfs: don't grow data if only -m is specified 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=530FCA2C.8090204@redhat.com \
--to=sandeen@redhat.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