Skip to contentSkip to conversation

xfs_info: limit findmnt to find mounted xfs filesystems

PATCH In review Amir Goldstein 4 participants 4 messages Jun 17, 2019 – Jun 25, 2019

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 xfs_info: limit findmnt to find mounted xfs filesystems

When running xfstests with -overlay, the xfs mount point (a.k.a $OVL_BASE_SCRATCH_MNT) is used as the $SCRATCH_DEV argument to the overlay mount, like this:

/dev/vdf /vdf xfs rw,relatime,attr2,inode64,noquota 0 0
/vdf /vdf/ovl-mnt overlay rw,lowerdir=/vdf/lower,upperdir=/vdf/upper...

Ever since commit bbb43745, when xfs_info started using findmnt, when calling the helper _supports_filetype /vdf it returns false, and reports: "/vdf/ovl-mnt: Not on a mounted XFS filesystem".

Fix this ambiguity by preferring to query a mounted XFS filesystem, if one can be found.

Fixes bbb43745 ("xfs_info: use findmnt to handle mounted block devices")

---

Eric,

FYI, I don't *need* to fix xfs_info in order to fix xfstests and I do plan to send an independent fix to xfstests, but this seems like a correct fix regardless of the specific xfstests regression.

Thanks,
Amir.

 spaceman/xfs_info.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
spaceman/xfs_info.sh +1 -1
index 1bf6d2c3..3b10dc14 100755
@@ -40,7 +40,7 @@ case $# in
 
 		# If we find a mountpoint for the device, do a live query;
 		# otherwise try reading the fs with xfs_db.
-		if mountpt="$(findmnt -f -n -o TARGET "${arg}" 2> /dev/null)"; then
+		if mountpt="$(findmnt -t xfs -f -n -o TARGET "${arg}" 2> /dev/null)"; then
 			xfs_spaceman -p xfs_info -c "info" $OPTS "${mountpt}"
 			status=$?
 		else
Signature · 1 line
2.17.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 11 lines · Amir Goldstein

When running xfstests with -overlay, the xfs mount point (a.k.a $OVL_BASE_SCRATCH_MNT) is used as the $SCRATCH_DEV argument to the overlay mount, like this:

/dev/vdf /vdf xfs rw,relatime,attr2,inode64,noquota 0 0
/vdf /vdf/ovl-mnt overlay rw,lowerdir=/vdf/lower,upperdir=/vdf/upper...

Ever since commit bbb43745, when xfs_info started using findmnt, when calling the helper _supports_filetype /vdf it returns false, and reports: "/vdf/ovl-mnt: Not on a mounted XFS filesystem".

Quoted 5 lines

Fix this ambiguity by preferring to query a mounted XFS filesystem, if one can be found.

Fixes bbb43745 ("xfs_info: use findmnt to handle mounted block devices")

Looks good to me, so long as findmnt /has/ a -t option in, uh, whatever enterprise distro(s) for which the xfsprogs maintainer might be a stakeholder. :)

--D

Quoted 31 lines

---

Eric,

FYI, I don't *need* to fix xfs_info in order to fix xfstests and I do plan to send an independent fix to xfstests, but this seems like a correct fix regardless of the specific xfstests regression.

Thanks,
Amir.

 spaceman/xfs_info.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
spaceman/xfs_info.sh +1 -1
index 1bf6d2c3..3b10dc14 100755
@@ -40,7 +40,7 @@ case $# in
 
 		# If we find a mountpoint for the device, do a live query;
 		# otherwise try reading the fs with xfs_db.
-		if mountpt="$(findmnt -f -n -o TARGET "${arg}" 2> /dev/null)"; then
+		if mountpt="$(findmnt -t xfs -f -n -o TARGET "${arg}" 2> /dev/null)"; then
 			xfs_spaceman -p xfs_info -c "info" $OPTS "${mountpt}"
 			status=$?
 		else
Signature · 1 line
2.17.1
#2 lore raw
Quoted 15 lines · Darrick J. Wong
Quoted 14 lines · Amir Goldstein

When running xfstests with -overlay, the xfs mount point (a.k.a $OVL_BASE_SCRATCH_MNT) is used as the $SCRATCH_DEV argument to the overlay mount, like this:

/dev/vdf /vdf xfs rw,relatime,attr2,inode64,noquota 0 0
/vdf /vdf/ovl-mnt overlay rw,lowerdir=/vdf/lower,upperdir=/vdf/upper...

Ever since commit bbb43745, when xfs_info started using findmnt, when calling the helper _supports_filetype /vdf it returns false, and reports: "/vdf/ovl-mnt: Not on a mounted XFS filesystem".

Fix this ambiguity by preferring to query a mounted XFS filesystem, if one can be found.

Quoted 6 lines
Quoted 2 lines
Fixes bbb43745 ("xfs_info: use findmnt to handle mounted block devices")

Looks good to me, so long as findmnt /has/ a -t option in, uh, whatever enterprise distro(s) for which the xfsprogs maintainer might be a stakeholder. :)

:D

-t goes way back so this should be no problem.

Thanks, Amir.

-Eric

Quoted 36 lines

--D

Quoted 31 lines

---

Eric,

FYI, I don't *need* to fix xfs_info in order to fix xfstests and I do plan to send an independent fix to xfstests, but this seems like a correct fix regardless of the specific xfstests regression.

Thanks,
Amir.

 spaceman/xfs_info.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
spaceman/xfs_info.sh +1 -1
index 1bf6d2c3..3b10dc14 100755
@@ -40,7 +40,7 @@ case $# in
 
 		# If we find a mountpoint for the device, do a live query;
 		# otherwise try reading the fs with xfs_db.
-		if mountpt="$(findmnt -f -n -o TARGET "${arg}" 2> /dev/null)"; then
+		if mountpt="$(findmnt -t xfs -f -n -o TARGET "${arg}" 2> /dev/null)"; then
 			xfs_spaceman -p xfs_info -c "info" $OPTS "${mountpt}"
 			status=$?
 		else
Signature · 1 line
2.17.1