diff mbox

common/xfs: don't call xfs_scrub on a block device

Message ID 20180322024656.GC4810@magnolia (mailing list archive)
State New, archived
Headers show

Commit Message

Darrick J. Wong March 22, 2018, 2:46 a.m. UTC
From: Darrick J. Wong <darrick.wong@oracle.com>

xfs_scrub takes an xfs mountpoint as its argument, not a block device.
Therefore, fix _check_xfs_filesystem to call it correctly.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
---
 common/xfs |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--
To unsubscribe from this list: send the line "unsubscribe fstests" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Comments

Xiao Yang March 29, 2018, 10:25 a.m. UTC | #1
On 2018/03/22 10:46, Darrick J. Wong wrote:
> From: Darrick J. Wong<darrick.wong@oracle.com>
>
> xfs_scrub takes an xfs mountpoint as its argument, not a block device.
> Therefore, fix _check_xfs_filesystem to call it correctly.
Hi Darrick,

According to xfs_scrub manpage, it seems that xfs_scrub can take a mounted block device
as its argument.  Is the xfs_scrub manpage incorrect?

Thanks,
Xiao Yang

> Signed-off-by: Darrick J. Wong<darrick.wong@oracle.com>
> ---
>   common/xfs |    2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/common/xfs b/common/xfs
> index 5dbd81e..1d98ba1 100644
> --- a/common/xfs
> +++ b/common/xfs
> @@ -358,7 +358,7 @@ _check_xfs_filesystem()
>   	# Run online scrub if we can.
>   	mntpt="$(_is_dev_mounted $device)"
>   	if [ -n "$mntpt" ]&&  _supports_xfs_scrub "$mntpt" "$device"; then
> -		"$XFS_SCRUB_PROG" $scrubflag -v -d -n $device>  $tmp.scrub 2>&1
> +		"$XFS_SCRUB_PROG" $scrubflag -v -d -n $mntpt>  $tmp.scrub 2>&1
>   		if [ $? -ne 0 ]; then
>   			_log_err "_check_xfs_filesystem: filesystem on $device failed scrub"
>   			echo "*** xfs_scrub $scrubflag -v -d -n output ***">>  $seqres.full
> --
> To unsubscribe from this list: send the line "unsubscribe fstests" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>
>
>



--
To unsubscribe from this list: send the line "unsubscribe fstests" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Darrick J. Wong March 29, 2018, 3:46 p.m. UTC | #2
On Thu, Mar 29, 2018 at 06:25:52PM +0800, Xiao Yang wrote:
> On 2018/03/22 10:46, Darrick J. Wong wrote:
> >From: Darrick J. Wong<darrick.wong@oracle.com>
> >
> >xfs_scrub takes an xfs mountpoint as its argument, not a block device.
> >Therefore, fix _check_xfs_filesystem to call it correctly.
> Hi Darrick,
> 
> According to xfs_scrub manpage, it seems that xfs_scrub can take a mounted block device
> as its argument.  Is the xfs_scrub manpage incorrect?

Yes, the manpage is wrong and will be fixed in xfsprogs 4.16.

--D

> Thanks,
> Xiao Yang
> 
> >Signed-off-by: Darrick J. Wong<darrick.wong@oracle.com>
> >---
> >  common/xfs |    2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> >diff --git a/common/xfs b/common/xfs
> >index 5dbd81e..1d98ba1 100644
> >--- a/common/xfs
> >+++ b/common/xfs
> >@@ -358,7 +358,7 @@ _check_xfs_filesystem()
> >  	# Run online scrub if we can.
> >  	mntpt="$(_is_dev_mounted $device)"
> >  	if [ -n "$mntpt" ]&&  _supports_xfs_scrub "$mntpt" "$device"; then
> >-		"$XFS_SCRUB_PROG" $scrubflag -v -d -n $device>  $tmp.scrub 2>&1
> >+		"$XFS_SCRUB_PROG" $scrubflag -v -d -n $mntpt>  $tmp.scrub 2>&1
> >  		if [ $? -ne 0 ]; then
> >  			_log_err "_check_xfs_filesystem: filesystem on $device failed scrub"
> >  			echo "*** xfs_scrub $scrubflag -v -d -n output ***">>  $seqres.full
> >--
> >To unsubscribe from this list: send the line "unsubscribe fstests" in
> >the body of a message to majordomo@vger.kernel.org
> >More majordomo info at  http://vger.kernel.org/majordomo-info.html
> >
> >
> >
> 
> 
> 
--
To unsubscribe from this list: send the line "unsubscribe fstests" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/common/xfs b/common/xfs
index 5dbd81e..1d98ba1 100644
--- a/common/xfs
+++ b/common/xfs
@@ -358,7 +358,7 @@  _check_xfs_filesystem()
 	# Run online scrub if we can.
 	mntpt="$(_is_dev_mounted $device)"
 	if [ -n "$mntpt" ] && _supports_xfs_scrub "$mntpt" "$device"; then
-		"$XFS_SCRUB_PROG" $scrubflag -v -d -n $device > $tmp.scrub 2>&1
+		"$XFS_SCRUB_PROG" $scrubflag -v -d -n $mntpt > $tmp.scrub 2>&1
 		if [ $? -ne 0 ]; then
 			_log_err "_check_xfs_filesystem: filesystem on $device failed scrub"
 			echo "*** xfs_scrub $scrubflag -v -d -n output ***" >> $seqres.full