All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sagi Grimberg <sagi@grimberg.me>
To: Ilya Dryomov <idryomov@gmail.com>, linux-block@vger.kernel.org
Cc: Christoph Hellwig <hch@infradead.org>, Jens Axboe <axboe@fb.com>,
	Tejun Heo <tj@kernel.org>, David Disseldorp <ddiss@suse.de>
Subject: Re: [PATCH 1/2] block: fail op_is_write() requests to read-only partitions
Date: Tue, 28 Nov 2017 11:07:02 +0200	[thread overview]
Message-ID: <867a243b-61fa-c2bc-779f-0dcd3062a1b5@grimberg.me> (raw)
In-Reply-To: <1510253101-10291-2-git-send-email-idryomov@gmail.com>


> +	if (bio_check_ro(bio)) {

I'd place unlikely statement here, but other than that, looks good to me

Reviewed-by: Sagi Grimberg <sagi@grimberg.me>

> +		printk(KERN_ERR
> +		       "generic_make_request: Trying to write "
> +			"to read-only block-device %s (partno %d)\n",
> +			bio_devname(bio, b), bio->bi_partno);
> +		goto end_io;
> +	}
> +
>   	/*
>   	 * For a REQ_NOWAIT based request, return -EOPNOTSUPP
>   	 * if queue is not a request based queue.
>   	 */
> -
>   	if ((bio->bi_opf & REQ_NOWAIT) && !queue_is_rq_based(q))
>   		goto not_supported;
>   
> 

  reply	other threads:[~2017-11-28  9:07 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-09 18:44 [PATCH 0/2] block: enforce ioctl(BLKROSET) and set_disk_ro() Ilya Dryomov
2017-11-09 18:45 ` [PATCH 1/2] block: fail op_is_write() requests to read-only partitions Ilya Dryomov
2017-11-28  9:07   ` Sagi Grimberg [this message]
2017-11-09 18:45 ` [PATCH 2/2] block: add bdev_read_only() checks to common helpers Ilya Dryomov
2017-11-16  9:02 ` [PATCH 0/2] block: enforce ioctl(BLKROSET) and set_disk_ro() Ilya Dryomov
2017-11-27  9:19   ` Ilya Dryomov

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=867a243b-61fa-c2bc-779f-0dcd3062a1b5@grimberg.me \
    --to=sagi@grimberg.me \
    --cc=axboe@fb.com \
    --cc=ddiss@suse.de \
    --cc=hch@infradead.org \
    --cc=idryomov@gmail.com \
    --cc=linux-block@vger.kernel.org \
    --cc=tj@kernel.org \
    /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.