Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754617Ab1BOQgo (ORCPT ); Tue, 15 Feb 2011 11:36:44 -0500 Received: from mx1.redhat.com ([209.132.183.28]:29000 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752715Ab1BOQgn (ORCPT ); Tue, 15 Feb 2011 11:36:43 -0500 Message-ID: <4D5AAB8F.50901@redhat.com> Date: Tue, 15 Feb 2011 17:36:31 +0100 From: Milan Broz User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.13) Gecko/20101213 Thunderbird/3.1.7 MIME-Version: 1.0 To: Tejun Heo CC: Alasdair G Kergon , device-mapper development , Jens Axboe , Tao Ma , linux-kernel@vger.kernel.org Subject: Re: [dm-devel] [PATCH][RFC] dm: Do not open log and cow device read-write for read-only mappings References: <4D5A6EF4.3030905@redhat.com> <20110215124629.GF5825@agk-dp.fab.redhat.com> <20110215152033.GK3160@htj.dyndns.org> <20110215154625.GG5825@agk-dp.fab.redhat.com> <20110215155018.GM3160@htj.dyndns.org> <4D5AA45C.7050600@redhat.com> <20110215161228.GN3160@htj.dyndns.org> In-Reply-To: <20110215161228.GN3160@htj.dyndns.org> X-Enigmail-Version: 1.1.2 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1398 Lines: 31 On 02/15/2011 05:12 PM, Tejun Heo wrote: > On Tue, Feb 15, 2011 at 05:05:48PM +0100, Milan Broz wrote: >> On 02/15/2011 04:50 PM, Tejun Heo wrote: >>>> That's why I'm arguing EACCES is not a good error to return and EROFS is >>>> more appropriate. >>> >>> Frankly, I don't really mind one way or the other but EROFS isn't >>> usually used in those areas. It might make sense for this use case >>> and then there will be cases it just feels awkward. This being a dm >>> thing, wouldn't it be just better to let dm massage the return value? >> >> It is not DM thing. That code was checking for generic block device. >> No DM there (it was from cryptsetup code but not related to DM part). > > Hmmm... I'm confused now. Where was that -EROFS from then? I don't > recall changing -EROFS to -EACCES. What did I miss? Well, I am also not sure about that. But the problem is that read-write open fails now while it worked before. (TBH I have no idea when that EROFS fallback worked - because the code opened device RW, issued EROGET ioctl and set read-only... for years.) Anyway I think EROFS is used on block devices, just grep kernel source. Milan -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/