Re: [PATCH 2/2] fstests: groupfile generation needs force overwrite

[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]



On Mon, Oct 11, 2021 at 10:06:59AM +1100, Dave Chinner wrote:
> From: Dave Chinner <dchinner@xxxxxxxxxx>
> 
> Having built fstests as root as part of a run script, I get failures
> then trying to run it as a user because of the group list
> generation. The issue occurs because the group list files are owned
> by root, and so I get an interactive prompt to overwrite them such
> as:
> 
> Building btrfs
>  [GROUP] /home/dave/src/xfstests-dev/tests/btrfs/group.list
> mv: replace 'group.list', overriding mode 0644 (rw-r--r--)? y
> Building ceph
>  [GROUP] /home/dave/src/xfstests-dev/tests/ceph/group.list
> mv: replace 'group.list', overriding mode 0644 (rw-r--r--)? y
> Building cifs
>  [GROUP] /home/dave/src/xfstests-dev/tests/cifs/group.list
> mv: replace 'group.list', overriding mode 0644 (rw-r--r--)? y
> Building ext4
>  [GROUP] /home/dave/src/xfstests-dev/tests/ext4/group.list
> ...
> 
> Use 'mv -f' to ignore such trivial issues so that the new group
> lists are written correctly.
> 
> Signed-off-by: Dave Chinner <dchinner@xxxxxxxxxx>

Oops, sorry I didn't catch this.
Reviewed-by: Darrick J. Wong <djwong@xxxxxxxxxx>

--D

> ---
>  tools/mkgroupfile | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/tools/mkgroupfile b/tools/mkgroupfile
> index 634ec92c..3844e57d 100755
> --- a/tools/mkgroupfile
> +++ b/tools/mkgroupfile
> @@ -24,7 +24,7 @@ cleanup() {
>  	test -z "$ngroupfile" && return
>  
>  	if [ $ret -eq 0 ]; then
> -		mv "$ngroupfile" "$groupfile"
> +		mv -f "$ngroupfile" "$groupfile"
>  	else
>  		rm -f "$ngroupfile"
>  	fi
> -- 
> 2.33.0
> 



[Index of Archives]     [Linux Filesystems Development]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux