All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] xfs_growfs: allow mounted device node as argument
@ 2019-10-29  3:23 Eric Sandeen
  2019-10-29  7:15 ` Christoph Hellwig
  0 siblings, 1 reply; 5+ messages in thread
From: Eric Sandeen @ 2019-10-29  3:23 UTC (permalink / raw)
  To: linux-xfs

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.


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] xfs_growfs: allow mounted device node as argument
  2019-10-29  3:23 [PATCH] xfs_growfs: allow mounted device node as argument Eric Sandeen
@ 2019-10-29  7:15 ` Christoph Hellwig
  2019-10-29 13:24   ` Eric Sandeen
  0 siblings, 1 reply; 5+ messages in thread
From: Christoph Hellwig @ 2019-10-29  7:15 UTC (permalink / raw)
  To: Eric Sandeen; +Cc: linux-xfs

On Mon, Oct 28, 2019 at 10:23:51PM -0500, Eric Sandeen wrote:
> I can clone tests/xfs/289 to do tests of similar permutations for
> device names.

Can we just add the device name based tests to xfs/289?

The patch itself looks fine:

Reviewed-by: Christoph Hellwig <hch@lst.de>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] xfs_growfs: allow mounted device node as argument
  2019-10-29  7:15 ` Christoph Hellwig
@ 2019-10-29 13:24   ` Eric Sandeen
  2019-10-29 13:26     ` Christoph Hellwig
  0 siblings, 1 reply; 5+ messages in thread
From: Eric Sandeen @ 2019-10-29 13:24 UTC (permalink / raw)
  To: Christoph Hellwig, Eric Sandeen; +Cc: linux-xfs



On 10/29/19 2:15 AM, Christoph Hellwig wrote:
> On Mon, Oct 28, 2019 at 10:23:51PM -0500, Eric Sandeen wrote:
>> I can clone tests/xfs/289 to do tests of similar permutations for
>> device names.
> 
> Can we just add the device name based tests to xfs/289?

Could do, I was hesitant to make a once-passing test start failing on older
userspace. (maybe we should formalize a policy for this sort of thing)

> The patch itself looks fine:
> 
> Reviewed-by: Christoph Hellwig <hch@lst.de>
> 

Thanks

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] xfs_growfs: allow mounted device node as argument
  2019-10-29 13:24   ` Eric Sandeen
@ 2019-10-29 13:26     ` Christoph Hellwig
  2019-10-29 13:34       ` Eric Sandeen
  0 siblings, 1 reply; 5+ messages in thread
From: Christoph Hellwig @ 2019-10-29 13:26 UTC (permalink / raw)
  To: Eric Sandeen; +Cc: Christoph Hellwig, Eric Sandeen, linux-xfs

On Tue, Oct 29, 2019 at 08:24:50AM -0500, Eric Sandeen wrote:
> 
> 
> On 10/29/19 2:15 AM, Christoph Hellwig wrote:
> > On Mon, Oct 28, 2019 at 10:23:51PM -0500, Eric Sandeen wrote:
> >> I can clone tests/xfs/289 to do tests of similar permutations for
> >> device names.
> > 
> > Can we just add the device name based tests to xfs/289?
> 
> Could do, I was hesitant to make a once-passing test start failing on older
> userspace. (maybe we should formalize a policy for this sort of thing)

Well, it is supposed to work for all but one release, right?

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] xfs_growfs: allow mounted device node as argument
  2019-10-29 13:26     ` Christoph Hellwig
@ 2019-10-29 13:34       ` Eric Sandeen
  0 siblings, 0 replies; 5+ messages in thread
From: Eric Sandeen @ 2019-10-29 13:34 UTC (permalink / raw)
  To: Christoph Hellwig, Eric Sandeen; +Cc: linux-xfs

On 10/29/19 8:26 AM, Christoph Hellwig wrote:
> On Tue, Oct 29, 2019 at 08:24:50AM -0500, Eric Sandeen wrote:
>>
>>
>> On 10/29/19 2:15 AM, Christoph Hellwig wrote:
>>> On Mon, Oct 28, 2019 at 10:23:51PM -0500, Eric Sandeen wrote:
>>>> I can clone tests/xfs/289 to do tests of similar permutations for
>>>> device names.
>>>
>>> Can we just add the device name based tests to xfs/289?
>>
>> Could do, I was hesitant to make a once-passing test start failing on older
>> userspace. (maybe we should formalize a policy for this sort of thing)
> 
> Well, it is supposed to work for all but one release, right?

Pointing it at a device has been broken since 4.12, so broken for about
a dozen releases / ~2+ years.

-Eric



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2019-10-29 13:34 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-29  3:23 [PATCH] xfs_growfs: allow mounted device node as argument Eric Sandeen
2019-10-29  7:15 ` Christoph Hellwig
2019-10-29 13:24   ` Eric Sandeen
2019-10-29 13:26     ` Christoph Hellwig
2019-10-29 13:34       ` Eric Sandeen

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.