Re: [PATCH] cachefiles: fix __cachefiles_prepare_write() error handling

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

 



Arnd Bergmann <arnd@xxxxxxxxxx> wrote:

>  	pos = cachefiles_inject_remove_error();
> -	if (pos == 0)
> -		ret = vfs_fallocate(file, FALLOC_FL_PUNCH_HOLE | FALLOC_FL_KEEP_SIZE,
> -				    *_start, *_len);
> +	if (pos != 0)
> +		return 0;
> +
> +	ret = vfs_fallocate(file, FALLOC_FL_PUNCH_HOLE | FALLOC_FL_KEEP_SIZE,
> +			    *_start, *_len);
>  	if (ret < 0) {

The right fix is to use "ret" rather than "pos".  I've fixed this already on
my fscache-rewrite branch.  Hopefully I'll be able to push that over to my
next branch shortly.

David

--
Linux-cachefs mailing list
Linux-cachefs@xxxxxxxxxx
https://listman.redhat.com/mailman/listinfo/linux-cachefs




[Index of Archives]     [LARTC]     [Bugtraq]     [Yosemite Forum]
  Powered by Linux