Re: [PATCH 3/4] ovl: convert ovl_real_fdget_meta() callers to ovl_real_file_meta()

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

 



On Fri, Oct 04, 2024 at 12:23:41PM +0200, Amir Goldstein wrote:

>  	if (upper_meta) {
>  		ovl_path_upper(dentry, &realpath);
>  		if (!realpath.dentry)
> -			return 0;
> +			return NULL;
>  	} else {
>  		/* lazy lookup and verify of lowerdata */
>  		err = ovl_verify_lowerdata(dentry);
>  		if (err)
> -			return err;
> +			return ERR_PTR(err);

Ugh...  That kind of calling conventions is generally a bad idea.

> +	return realfile;

... especially since it's NULL/ERR_PTR()/pointer to object.


> +	realfile = ovl_real_file_meta(file, !datasync);
> +	if (IS_ERR_OR_NULL(realfile))
> +		return PTR_ERR(realfile);

Please, don't.  IS_ERR_OR_NULL is bogus 9 times out of 10 (at least).
And you still have breakage in llseek et.al.




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

  Powered by Linux