Re: [PATCH] generic/670: allow _mread_range() races with reflink_range()

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



On Wed, Jan 12, 2022 at 05:28:46PM +0800, Shiyang Ruan wrote:
> mread copies data one-byte-at-a-time, so it may races with
> reflink_range() who invalidates page cache of the dest file.
> Allow this race by adjusting the egrep regexp.
> 
> Reported-by: Darrick J. Wong <djwong@xxxxxxxxxx>
> Suggested-by: Darrick J. Wong <djwong@xxxxxxxxxx>
> Signed-off-by: Shiyang Ruan <ruansy.fnst@xxxxxxxxxxx>

Looks reasonable; I'll put this in the test system for tonight and
report back if I see anything strange.  I didn't see anything obvious
after a dozen or so rounds.

Reviewed-by: Darrick J. Wong <djwong@xxxxxxxxxx>

--D

> ---
>  tests/generic/670 | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/tests/generic/670 b/tests/generic/670
> index 83fbd0b9..4a895d90 100755
> --- a/tests/generic/670
> +++ b/tests/generic/670
> @@ -40,7 +40,10 @@ _cp_reflink $testdir/file1 $testdir/file3
>  _scratch_cycle_mount
>  
>  fbytes() {
> -	egrep -v '(61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61|62 62 62 62 62 62 62 62 62 62 62 62 62 62 62 62)'
> +	# Different with generic/164,165, mread copies data from mmapped area
> +	# one-byte-at-a-time, which may cause races during reflink_range().
> +	# So the result of _mread_range() may be a mix of 61 and 62.
> +	egrep -v '((61|62) ){15}(61|62)'
>  }
>  
>  reader() {
> -- 
> 2.34.1
> 
> 
> 



[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