Received: by 10.223.185.116 with SMTP id b49csp8751407wrg; Fri, 2 Mar 2018 07:21:08 -0800 (PST) X-Google-Smtp-Source: AG47ELvEJlrwKw92byktqoFwawi4vtqzdegVn9Sf51hSqocQe+VG2IShEuQxtwSODi4bUhOT949B X-Received: by 10.101.97.139 with SMTP id c11mr4810602pgv.443.1520004068741; Fri, 02 Mar 2018 07:21:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520004068; cv=none; d=google.com; s=arc-20160816; b=vvjpNSpCD3UVdHUB+e9WtqHCcKqeACfcvX/iB1WFfQoY9vpCcjXLw6M58K/n6ARURq KKQCc3KuUTocrTtURPExYaz/J3MwXrTdhA99t6PukkiUUy0WmhBnKyXfkevitG5cMEsK hSi7Y2LKUNKsa9OWXO3TbLbekY7k3KlR8JjiTVrSk0Hwniht+yBNTUa9M4Gn5hWe6+iT +Mf+vCcds2xDuhr6YuAvDscRo19gA3yuFE8iqzxxBPEknbzEwbIks9pZeN+uCUfwZTMD 64JLxJYYYfYPwxbRbYBZnjwCDp1v9+SGVTMvXWkT/wM+Lu/LNF5uRupAaXAGhvsatRg/ COzQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=tqOPuPPThrPutfpmFxZlEy3f31mF9g3HmSx1vEO+S34=; b=KFAj3oY/k/v5254UB2HRtOld9dDY7OJaQu6VgKzZmyeJ3YHGnXAiFv3Ka1mVrn49kl c61iHP4LTmOOCtKx47naNaVNbto0aKtTs+bKCWoDkGLfstvjfp0Ubg/cWEUlWUUlT4dJ iY5Zy7V4H5PMQe+z9YmT3sSc1HCVRPTEFZFFc8g5IvUlLlgbI3xrnB+dwa40BjonLqiv at/Wjr1Ty2mKk+oqpr40Pr13mpClJXgxjZQALrsNwVtHwok+5WNytAPYFaUuxyIldasy XogrliHkQHDmTLBDJdFWnxX9lb/syiqe2kwUt66kTivFYEIb1uuRUtimi6iJq+hkXeQ6 ELRA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l69si5029525pfk.180.2018.03.02.07.20.54; Fri, 02 Mar 2018 07:21:08 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1427482AbeCBMUP convert rfc822-to-8bit (ORCPT + 99 others); Fri, 2 Mar 2018 07:20:15 -0500 Received: from lilium.sigma-star.at ([109.75.188.150]:54568 "EHLO lilium.sigma-star.at" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1423042AbeCBMUF (ORCPT ); Fri, 2 Mar 2018 07:20:05 -0500 Received: from localhost (localhost [127.0.0.1]) by lilium.sigma-star.at (Postfix) with ESMTP id 04C79181878A6; Fri, 2 Mar 2018 13:20:04 +0100 (CET) From: Richard Weinberger To: Romain Izard Cc: Artem Bityutskiy , David Woodhouse , Brian Norris , Boris Brezillon , Marek Vasut , Cyrille Pitchen , 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 Message-ID: <304002421.gctIWao8Ge@blindfold> In-Reply-To: <20180302111618.22820-1-romain.izard.pro@gmail.com> References: <20180302111618.22820-1-romain.izard.pro@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8BIT Content-Type: text/plain; charset="iso-8859-1" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 > --- > 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