All of lore.kernel.org
 help / color / mirror / Atom feed
From: Eric Sandeen <sandeen@redhat.com>
To: linux-xfs <linux-xfs@vger.kernel.org>
Subject: [PATCH] xfs_growfs: allow mounted device node as argument
Date: Mon, 28 Oct 2019 22:23:51 -0500	[thread overview]
Message-ID: <0283f073-88d8-977f-249c-f813dabd9390@redhat.com> (raw)

Up until:

 b97815a0 xfs_growfs: ensure target path is an active xfs mountpoint

xfs_growfs actually accepted a mounted block device name as the
primary argument, because it could be found in the mount table.

It turns out that Ansible was making use of this undocumented behavior,
and it's trivial to allow it, so put it back in place and document
it this time.

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
---

I can clone tests/xfs/289 to do tests of similar permutations for
device names.

diff --git a/growfs/xfs_growfs.c b/growfs/xfs_growfs.c
index 20089d2b..4224c5a0 100644
--- a/growfs/xfs_growfs.c
+++ b/growfs/xfs_growfs.c
@@ -140,6 +140,9 @@ main(int argc, char **argv)
 	}
 
 	fs = fs_table_lookup_mount(rpath);
+	if (!fs)
+		fs = fs_table_lookup_blkdev(rpath);
+
 	if (!fs) {
 		fprintf(stderr, _("%s: %s is not a mounted XFS filesystem\n"),
 			progname, argv[optind]);
diff --git a/man/man8/xfs_growfs.8 b/man/man8/xfs_growfs.8
index 7e6a387c..60a88189 100644
--- a/man/man8/xfs_growfs.8
+++ b/man/man8/xfs_growfs.8
@@ -35,7 +35,12 @@ xfs_growfs \- expand an XFS filesystem
 .B \-R
 .I size
 ]
+[
 .I mount-point
+|
+.I block-device
+]
+
 .br
 .B xfs_growfs \-V
 .SH DESCRIPTION
@@ -45,7 +50,10 @@ expands an existing XFS filesystem (see
 The
 .I mount-point
 argument is the pathname of the directory where the filesystem
-is mounted. The filesystem must be mounted to be grown (see
+is mounted. The
+.I block-device
+argument is the device name of a mounted XFS filesystem.
+The filesystem must be mounted to be grown (see
 .BR mount (8)).
 The existing contents of the filesystem are undisturbed, and the added space
 becomes available for additional file storage.


             reply	other threads:[~2019-10-29  3:23 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-29  3:23 Eric Sandeen [this message]
2019-10-29  7:15 ` [PATCH] xfs_growfs: allow mounted device node as argument Christoph Hellwig
2019-10-29 13:24   ` Eric Sandeen
2019-10-29 13:26     ` Christoph Hellwig
2019-10-29 13:34       ` Eric Sandeen

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=0283f073-88d8-977f-249c-f813dabd9390@redhat.com \
    --to=sandeen@redhat.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.