]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commitdiff
xfs_growfs: allow mounted device node as argument
authorEric Sandeen <sandeen@redhat.com>
Mon, 4 Nov 2019 20:35:49 +0000 (15:35 -0500)
committerEric Sandeen <sandeen@sandeen.net>
Mon, 4 Nov 2019 20:35:49 +0000 (15:35 -0500)
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>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
growfs/xfs_growfs.c
man/man8/xfs_growfs.8

index eab15984bf28077affbcf693c8494826685775ef..6c62833b1eb15bd3739134f5ac20a85d666ef927 100644 (file)
@@ -141,6 +141,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]);
index 7e6a387c8729855d2b9d9d7f4552fe6856924ebe..60a88189dd8888c0efe0d14bf15e757083ab57ee 100644 (file)
@@ -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.