diff mbox

[v2] common/rc: Fix _supports_filetype function

Message ID 1484554040-4231-1-git-send-email-yangx.jy@cn.fujitsu.com (mailing list archive)
State New, archived
Headers show

Commit Message

Xiao Yang Jan. 16, 2017, 8:07 a.m. UTC
generic/401 failed on RHEL6.8GA because "--output=xxx"
option is not supported by df.  So we remove it.

Signed-off-by: Xiao Yang <yangx.jy@cn.fujitsu.com>
---
 common/rc | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

Comments

Eryu Guan Jan. 16, 2017, 8:20 a.m. UTC | #1
On Mon, Jan 16, 2017 at 04:07:20PM +0800, Xiao Yang wrote:
> generic/401 failed on RHEL6.8GA because "--output=xxx"
> option is not supported by df.  So we remove it.
> 
> Signed-off-by: Xiao Yang <yangx.jy@cn.fujitsu.com>
> ---
>  common/rc | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/common/rc b/common/rc
> index 892c46e..87ef849 100644
> --- a/common/rc
> +++ b/common/rc
> @@ -268,14 +268,14 @@ _supports_filetype()
>  {
>  	local dir=$1
>  
> -	local fstyp=$(df --output=fstype $dir | tail -1)
> +	local fstyp=`$DF_PROG $dir | tail -1 | $AWK_PROG '{print $2}'`
>  	case "$fstyp" in
>  	xfs)
>  		xfs_info $dir | grep -q "ftype=1"
>  		;;
>  	ext2|ext3|ext4)
> -		tune2fs -l $(df --output=source $dir | tail -1) | \
> -		   grep -q filetype
> +		local mntdir=`$DF_PROG $dir | tail -1 | $AWK_PROG '{print $1}'`
                      ^^^^^^ this actually is the underlying device

I'll rename it to "dev" on commit.

Thanks,
Eryu

> +		tune2fs -l $mntdir | grep -q filetype
>  		;;
>  	*)
>  		local testfile=$dir/$$.ftype
> -- 
> 1.8.3.1
> 
> 
> 
> --
> 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
Xiao Yang Jan. 16, 2017, 8:24 a.m. UTC | #2
On 2017/01/16 16:20, Eryu Guan wrote:
> On Mon, Jan 16, 2017 at 04:07:20PM +0800, Xiao Yang wrote:
>> generic/401 failed on RHEL6.8GA because "--output=xxx"
>> option is not supported by df.  So we remove it.
>>
>> Signed-off-by: Xiao Yang<yangx.jy@cn.fujitsu.com>
>> ---
>>   common/rc | 6 +++---
>>   1 file changed, 3 insertions(+), 3 deletions(-)
>>
>> diff --git a/common/rc b/common/rc
>> index 892c46e..87ef849 100644
>> --- a/common/rc
>> +++ b/common/rc
>> @@ -268,14 +268,14 @@ _supports_filetype()
>>   {
>>   	local dir=$1
>>
>> -	local fstyp=$(df --output=fstype $dir | tail -1)
>> +	local fstyp=`$DF_PROG $dir | tail -1 | $AWK_PROG '{print $2}'`
>>   	case "$fstyp" in
>>   	xfs)
>>   		xfs_info $dir | grep -q "ftype=1"
>>   		;;
>>   	ext2|ext3|ext4)
>> -		tune2fs -l $(df --output=source $dir | tail -1) | \
>> -		   grep -q filetype
>> +		local mntdir=`$DF_PROG $dir | tail -1 | $AWK_PROG '{print $1}'`
>                        ^^^^^^ this actually is the underlying device
>
> I'll rename it to "dev" on commit.
Hi Eryu

Agree it. :-)

Best Regards,
Xiao Yang
> Thanks,
> Eryu
>
>> +		tune2fs -l $mntdir | grep -q filetype
>>   		;;
>>   	*)
>>   		local testfile=$dir/$$.ftype
>> -- 
>> 1.8.3.1
>>
>>
>>
>> --
>> 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
>
>
>



--
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/rc b/common/rc
index 892c46e..87ef849 100644
--- a/common/rc
+++ b/common/rc
@@ -268,14 +268,14 @@  _supports_filetype()
 {
 	local dir=$1
 
-	local fstyp=$(df --output=fstype $dir | tail -1)
+	local fstyp=`$DF_PROG $dir | tail -1 | $AWK_PROG '{print $2}'`
 	case "$fstyp" in
 	xfs)
 		xfs_info $dir | grep -q "ftype=1"
 		;;
 	ext2|ext3|ext4)
-		tune2fs -l $(df --output=source $dir | tail -1) | \
-		   grep -q filetype
+		local mntdir=`$DF_PROG $dir | tail -1 | $AWK_PROG '{print $1}'`
+		tune2fs -l $mntdir | grep -q filetype
 		;;
 	*)
 		local testfile=$dir/$$.ftype