Re: [PATCH 1/4] common: Fix file leak in _get_max_file_size

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



On Thu, Sep 22, 2022 at 03:48:19PM +0200, Pavel Reichl wrote:
> This is obviously mostly problematic for FS lacking support for sparse
> files.
> 
> Signed-off-by: Pavel Reichl <preichl@xxxxxxxxxx>
> ---
>  common/rc         | 1 +
>  tests/generic/692 | 0
>  2 files changed, 1 insertion(+)
>  mode change 100644 => 100755 tests/generic/692
> 
> diff --git a/common/rc b/common/rc
> index 228fcb37..c9078649 100644
> --- a/common/rc
> +++ b/common/rc
> @@ -4637,6 +4637,7 @@ _get_max_file_size()
>  			l=$m
>  		fi
>  	done
> +	rm -f $testfile

OK, as "truncate" will allocate real space in exfat and other fs not
support sparse file, I think we'd better to remove it. If you find
more similar situation, please remove them in same one patch :)

>  	echo $l
>  }
>  
> diff --git a/tests/generic/692 b/tests/generic/692
> old mode 100644
> new mode 100755

Hmm... is this another fix? Although I don't know if it's worth to be a single
patch, if it doesn't cause anything wrong?

Thanks,
Zorro

> -- 
> 2.37.3
> 




[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