linux-xfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] xfsprogs: ensure growfs rejects non-existent mount point
@ 2017-04-07 17:58 Bill O'Donnell
  2017-04-07 18:33 ` Darrick J. Wong
                   ` (4 more replies)
  0 siblings, 5 replies; 14+ messages in thread
From: Bill O'Donnell @ 2017-04-07 17:58 UTC (permalink / raw)
  To: linux-xfs

xfs_growfs manpage clearly states that the filesystem must
be mounted to be grown. Current behavior allows xfs_growfs
to proceed if the filesystem /containing/ the path
of the desired target is mounted. This is not the specified
behavior. Instead, also check the targeted fs argument against
the entry found in the fstable lookup. Unless the targeted
fs is actually mounted, reject the command.

Signed-off-by: Bill O'Donnell <billodo@redhat.com>
---
 growfs/xfs_growfs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/growfs/xfs_growfs.c b/growfs/xfs_growfs.c
index a294e14..05630b8 100644
--- a/growfs/xfs_growfs.c
+++ b/growfs/xfs_growfs.c
@@ -203,7 +203,7 @@ main(int argc, char **argv)
 
 	fs_table_initialise(0, NULL, 0, NULL);
 	fs = fs_table_lookup(argv[optind], FS_MOUNT_POINT);
-	if (!fs) {
+	if (!fs || (strcmp(argv[optind], fs->fs_dir) != 0)) {
 		fprintf(stderr, _("%s: %s is not a mounted XFS filesystem\n"),
 			progname, argv[optind]);
 		return 1;
-- 
2.9.3


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

end of thread, other threads:[~2017-05-03 16:09 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-04-07 17:58 [PATCH] xfsprogs: ensure growfs rejects non-existent mount point Bill O'Donnell
2017-04-07 18:33 ` Darrick J. Wong
2017-04-07 18:51 ` Eric Sandeen
2017-04-11 23:20   ` Bill O'Donnell
2017-04-11 17:22 ` [PATCH v2] " Bill O'Donnell
2017-04-19 22:05   ` Eric Sandeen
2017-04-19 22:08     ` Bill O'Donnell
2017-04-20 22:22   ` Eric Sandeen
2017-04-20 22:43     ` Eric Sandeen
2017-04-24 14:29 ` [PATCH v3] " Bill O'Donnell
2017-04-26 22:23   ` Eric Sandeen
2017-04-27 18:23 ` [PATCH v4] xfs_growfs: ensure target path is an active xfs mountpoint Bill O'Donnell
2017-04-27 19:15   ` Eric Sandeen
2017-05-03 16:08     ` Darrick J. Wong

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).