# Re: \[PATCH v2 1/4\] pstore/blk: Improve failure reporting

- From: Christoph Hellwig \<hch@lst.de\>
- Date: 2021-06-16 03:51:15 
- List: linux-block
- Page: https://ratatoskr.run/linux-block/2021/06/207961
- Thread: https://ratatoskr.run/linux-doc/2021/06/207924/t.md

```text
On Tue, Jun 15, 2021 at 02:21:18PM -0700, Kees Cook wrote:
> -	if (!dev || !dev->total_size || !dev->read || !dev->write)
> +	if (!dev || !dev->total_size || !dev->read || !dev->write) {
> +		if (!dev)
> +			pr_err("NULL device info\n");
> +		else {
> +			if (!dev->total_size)
> +				pr_err("zero sized device\n");
> +			if (!dev->read)
> +				pr_err("no read handler for device\n");
> +			if (!dev->write)
> +				pr_err("no write handler for device\n");
> +		}
>  		return -EINVAL;
> +	}

I still find this style of checks pretty strange..
```
