From: Richard Weinberger <richard@nod.at>
To: Romain Izard <romain.izard.pro@gmail.com>
Cc: Artem Bityutskiy <dedekind1@gmail.com>,
David Woodhouse <dwmw2@infradead.org>,
Brian Norris <computersforpeace@gmail.com>,
Boris Brezillon <boris.brezillon@free-electrons.com>,
Marek Vasut <marek.vasut@gmail.com>,
Cyrille Pitchen <cyrille.pitchen@wedev4u.fr>,
linux-mtd@lists.infradead.org, linux-block@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH RESEND] mtd: ubi: block: Fix error for write access
Date: Fri, 02 Mar 2018 13:21:27 +0100 [thread overview]
Message-ID: <304002421.gctIWao8Ge@blindfold> (raw)
In-Reply-To: <20180302111618.22820-1-romain.izard.pro@gmail.com>
Am Freitag, 2. M�rz 2018, 12:16:18 CET schrieb Romain Izard:
> When opening a device with write access, ubiblock_open returns an error
> code. Currently, this error code is -EPERM, but this is not the right
> value.
>
> The open function for other block devices returns -EROFS when opening
> read-only devices with FMODE_WRITE set. When used with dm-verity, the
> veritysetup userspace tool is expecting EROFS, and refuses to use the
> ubiblock device.
>
> Use -EROFS for ubiblock as well. As a result, veritysetup accepts the
> ubiblock device as valid.
>
> Fixes: 9d54c8a33eec (UBI: R/O block driver on top of UBI volumes)
> Signed-off-by: Romain Izard <romain.izard.pro@gmail.com>
> ---
> drivers/mtd/ubi/block.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/mtd/ubi/block.c b/drivers/mtd/ubi/block.c
> index b210fdb31c98..4533423cf2aa 100644
> --- a/drivers/mtd/ubi/block.c
> +++ b/drivers/mtd/ubi/block.c
> @@ -242,7 +242,7 @@ static int ubiblock_open(struct block_device *bdev,
> fmode_t mode) * in any case.
> */
> if (mode & FMODE_WRITE) {
> - ret = -EPERM;
> + ret = -EROFS;
Queued for -next.
Thanks,
//richard
prev parent reply other threads:[~2018-03-02 12:20 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-03-02 11:16 [PATCH RESEND] mtd: ubi: block: Fix error for write access Romain Izard
2018-03-02 12:21 ` Richard Weinberger [this message]
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=304002421.gctIWao8Ge@blindfold \
--to=richard@nod.at \
--cc=boris.brezillon@free-electrons.com \
--cc=computersforpeace@gmail.com \
--cc=cyrille.pitchen@wedev4u.fr \
--cc=dedekind1@gmail.com \
--cc=dwmw2@infradead.org \
--cc=linux-block@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mtd@lists.infradead.org \
--cc=marek.vasut@gmail.com \
--cc=romain.izard.pro@gmail.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox