* Re: [PATCH] losetup: add option for O_DIRECT
[not found] <3bc8237c0808121426m6fada313r33ed4c419386a1@mail.gmail.com>
@ 2008-08-13 8:15 ` Karel Zak
2008-08-13 14:08 ` Archie Cobbs
0 siblings, 1 reply; 2+ messages in thread
From: Karel Zak @ 2008-08-13 8:15 UTC (permalink / raw)
To: linux-kernel; +Cc: util-linux-ng, Archie Cobbs
On Tue, Aug 12, 2008 at 04:26:10PM -0500, Archie Cobbs wrote:
> On Thu, Aug 7, 2008 at 1:26 PM, Archie Cobbs <archie@dellroad.org> wrote:
> > I have an application involving the loopback device where it would be
> > valuable for the underlying file to be opened with the O_DIRECT flag.
> >
> > Any thoughts one way or the other about adding support to losetup(8)
> > and mount(8) for a 'direct' option that would enable this?
> >
> > I will propose a patch if people think this would be a reasonable thing to do.
>
> Add support for opening loopback files with O_DIRECT.
[...]
> mode = (*options & SETLOOP_RDONLY) ? O_RDONLY : O_RDWR;
> + if (*options & SETLOOP_DIRECT)
> + mode |= O_DIRECT;
> if ((ffd = open(file, mode)) < 0) {
Do you remember http://lkml.org/lkml/2007/1/10/233 ?
.. use O_DIRECT for files is BAD idea (and loop device is nothing
other than a file on standard FS).
I'm really not sure if we want to support this feature. I'm also not
sure if kernel loop device code is ready for O_DIRECT. (BTW, O_DIRECT
reads and writes must be aligned, ...)
Sorry, but I have to see ACK/NACK from relevant kernel person.
Redirecting to lkml.
Karel
--
Karel Zak <kzak@redhat.com>
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] losetup: add option for O_DIRECT
2008-08-13 8:15 ` [PATCH] losetup: add option for O_DIRECT Karel Zak
@ 2008-08-13 14:08 ` Archie Cobbs
0 siblings, 0 replies; 2+ messages in thread
From: Archie Cobbs @ 2008-08-13 14:08 UTC (permalink / raw)
To: Karel Zak; +Cc: linux-kernel, util-linux-ng
On Wed, Aug 13, 2008 at 3:15 AM, Karel Zak <kzak@redhat.com> wrote:
> On Tue, Aug 12, 2008 at 04:26:10PM -0500, Archie Cobbs wrote:
> > On Thu, Aug 7, 2008 at 1:26 PM, Archie Cobbs <archie@dellroad.org> wrote:
> > > I have an application involving the loopback device where it would be
> > > valuable for the underlying file to be opened with the O_DIRECT flag.
> > >
> > > Any thoughts one way or the other about adding support to losetup(8)
> > > and mount(8) for a 'direct' option that would enable this?
> > >
> > > I will propose a patch if people think this would be a reasonable thing to do.
> >
> > Add support for opening loopback files with O_DIRECT.
> [...]
>
> > mode = (*options & SETLOOP_RDONLY) ? O_RDONLY : O_RDWR;
> > + if (*options & SETLOOP_DIRECT)
> > + mode |= O_DIRECT;
> > if ((ffd = open(file, mode)) < 0) {
>
>
> Do you remember http://lkml.org/lkml/2007/1/10/233 ?
Yes... I understand there is a valid debate on the merits of O_DIRECT.
It is an interesting question and I don't claim to know the "right" answer.
For example, another way to achieve this same effect, though it would
require kernel changes, is to have some additional way(s) to configure
the loopback device using new LOOP_* ioctls.
In any case, that debate does not seem to be over yet. So my opinion:
if and when O_DIRECT is removed from Linux then we can revert this
patch too :-)
> Sorry, but I have to see ACK/NACK from relevant kernel person.
> Redirecting to lkml.
No problem. Please CC me on lkml responses if possible.
Thanks,
-Archie
--
Archie L. Cobbs
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2008-08-13 14:08 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <3bc8237c0808121426m6fada313r33ed4c419386a1@mail.gmail.com>
2008-08-13 8:15 ` [PATCH] losetup: add option for O_DIRECT Karel Zak
2008-08-13 14:08 ` Archie Cobbs
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox