Re: [dm-devel] [PATCH][RFC] dm: Do not open log and cow deviceread-write for read-only mappings

From: Tejun Heo
Date: Tue Feb 15 2011 - 11:41:39 EST


Hello,

On Tue, Feb 15, 2011 at 05:36:31PM +0100, Milan Broz wrote:
> 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.

Ah, okay, so the fallback was there just in case. It didn't really
trigger and right it wouldn't have triggered until now, so your
assertion about how many programs would break is kinda bogus. You
just have single isolated case which hasn't been excercised till now.
There may as well be code pieces which check against EACCES or what
not.

That said, maybe -EROFS is the better fit. I really have no idea.
Maybe we should just revert and leave rw accesses to ro block devices
alone. Jens, what do you think?

Thanks.

--
tejun
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/