All of lore.kernel.org
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@lst.de>
To: Kees Cook <keescook@chromium.org>
Cc: linux-kernel@vger.kernel.org, Christoph Hellwig <hch@lst.de>,
	Al Viro <viro@zeniv.linux.org.uk>,
	gmpy.liaowx@gmail.com, Anton Vorontsov <anton@enomsg.org>,
	Colin Cross <ccross@android.com>, Tony Luck <tony.luck@intel.com>,
	Jonathan Corbet <corbet@lwn.net>,
	Miquel Raynal <miquel.raynal@bootlin.com>,
	Richard Weinberger <richard@nod.at>,
	Vignesh Raghavendra <vigneshr@ti.com>,
	linux-doc@vger.kernel.org, linux-mtd@lists.infradead.org,
	linux-block@vger.kernel.org, linux-fsdevel@vger.kernel.org
Subject: Re: [PATCH v2 1/4] pstore/blk: Improve failure reporting
Date: Wed, 16 Jun 2021 05:51:10 +0200	[thread overview]
Message-ID: <20210616035109.GA25873@lst.de> (raw)
In-Reply-To: <20210615212121.1200820-2-keescook@chromium.org>

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..

WARNING: multiple messages have this Message-ID
From: Christoph Hellwig <hch@lst.de>
To: Kees Cook <keescook@chromium.org>
Cc: linux-kernel@vger.kernel.org, Christoph Hellwig <hch@lst.de>,
	Al Viro <viro@zeniv.linux.org.uk>,
	gmpy.liaowx@gmail.com, Anton Vorontsov <anton@enomsg.org>,
	Colin Cross <ccross@android.com>, Tony Luck <tony.luck@intel.com>,
	Jonathan Corbet <corbet@lwn.net>,
	Miquel Raynal <miquel.raynal@bootlin.com>,
	Richard Weinberger <richard@nod.at>,
	Vignesh Raghavendra <vigneshr@ti.com>,
	linux-doc@vger.kernel.org, linux-mtd@lists.infradead.org,
	linux-block@vger.kernel.org, linux-fsdevel@vger.kernel.org
Subject: Re: [PATCH v2 1/4] pstore/blk: Improve failure reporting
Date: Wed, 16 Jun 2021 05:51:10 +0200	[thread overview]
Message-ID: <20210616035109.GA25873@lst.de> (raw)
In-Reply-To: <20210615212121.1200820-2-keescook@chromium.org>

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..

______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

  reply	other threads:[~2021-06-16  3:51 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-15 21:21 [PATCH v2 0/4] Include zone in pstore_device_info Kees Cook
2021-06-15 21:21 ` Kees Cook
2021-06-15 21:21 ` [PATCH v2 1/4] pstore/blk: Improve failure reporting Kees Cook
2021-06-15 21:21   ` Kees Cook
2021-06-16  3:51   ` Christoph Hellwig [this message]
2021-06-16  3:51     ` Christoph Hellwig
2021-06-15 21:21 ` [PATCH v2 2/4] pstore/blk: Use the normal block device I/O path Kees Cook
2021-06-15 21:21   ` Kees Cook
2021-06-16  3:52   ` Christoph Hellwig
2021-06-16  3:52     ` Christoph Hellwig
2021-06-15 21:21 ` [PATCH v2 3/4] pstore/blk: Include zone in pstore_device_info Kees Cook
2021-06-15 21:21   ` Kees Cook
2021-06-16  4:02   ` Christoph Hellwig
2021-06-16  4:02     ` Christoph Hellwig
2021-06-16 14:41     ` Kees Cook
2021-06-16 14:41       ` Kees Cook
2021-06-15 21:21 ` [PATCH v2 4/4] pstore/blk: Fix kerndoc and redundancy on blkdev param Kees Cook
2021-06-15 21:21   ` Kees Cook
2021-06-16  3:53   ` Christoph Hellwig
2021-06-16  3:53     ` Christoph Hellwig

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210616035109.GA25873@lst.de \
    --to=hch@lst.de \
    --cc=anton@enomsg.org \
    --cc=ccross@android.com \
    --cc=corbet@lwn.net \
    --cc=gmpy.liaowx@gmail.com \
    --cc=keescook@chromium.org \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mtd@lists.infradead.org \
    --cc=miquel.raynal@bootlin.com \
    --cc=richard@nod.at \
    --cc=tony.luck@intel.com \
    --cc=vigneshr@ti.com \
    --cc=viro@zeniv.linux.org.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.