Re: [PATCH v3 RESEND] staging: erofs: fix an error handling in erofs_readdir()

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

 



On Sun, Aug 18, 2019 at 11:21:11AM +0800, Gao Xiang wrote:
> +		if (dentry_page == ERR_PTR(-ENOMEM)) {
> +			errln("no memory to readdir of logical block %u of nid %llu",
> +			      i, EROFS_V(dir)->nid);

I don't think you need the error message.  If we get a memory allocation
failure, there's already going to be a lot of spew in the logs from the
mm system.  And if we do fail to allocate memory, we don't need to know
the logical block number or the nid -- it has nothiing to do with those;
the system simply ran out of memory.

> +			err = -ENOMEM;
> +			break;
> +		} else if (IS_ERR(dentry_page)) {
> +			errln("fail to readdir of logical block %u of nid %llu",
> +			      i, EROFS_V(dir)->nid);
> +			err = -EFSCORRUPTED;
> +			break;
> +		}
>  
>  		de = (struct erofs_dirent *)kmap(dentry_page);
>  
> -- 
> 2.17.1
> 



[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]

  Powered by Linux