[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20110215124629.GF5825@agk-dp.fab.redhat.com>
Date: Tue, 15 Feb 2011 12:46:29 +0000
From: Alasdair G Kergon <agk@...hat.com>
To: Tejun Heo <tj@...nel.org>
Cc: device-mapper development <dm-devel@...hat.com>,
Milan Broz <mbroz@...hat.com>, Jens Axboe <axboe@...nel.dk>,
Tao Ma <tm@....ma>, linux-kernel@...r.kernel.org
Subject: Re: [dm-devel] [PATCH][RFC] dm: Do not open log and cow device
read-write for read-only mappings
On Tue, Feb 15, 2011 at 01:17:56PM +0100, Milan Broz wrote:
> fd = open(device, O_RDWR | flags);
> if (fd == -1 && errno == EROFS) {
> *readonly = 1;
> fd = open(device, O_RDONLY | flags);
> }
Would it be reasonable for your patch to return EROFS rather than
EACCES?
man 2 open:
int open(const char *pathname, int flags, mode_t mode);
EROFS pathname refers to a file on a read-only file system and write
access was requested.
EACCES The requested access to the file is not allowed, or search per‐
mission is denied for one of the directories in the path prefix
of pathname, or the file did not exist yet and write access to
the parent directory is not allowed. (See also path_resolu‐
tion(7).)
Alasdair
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists