[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CANaxB-x3AEixc0iFH6HEndHrvdS6hTVUXGErJxUwuYQQMKUmsg@mail.gmail.com>
Date: Fri, 28 Dec 2012 18:48:25 +0400
From: Andrey Wagin <avagin@...il.com>
To: Oleg Nesterov <oleg@...hat.com>
Cc: Andrew Vagin <avagin@...allels.com>,
Pavel Emelyanov <xemul@...allels.com>,
David Howells <dhowells@...hat.com>,
linux-kernel@...r.kernel.org, criu@...nvz.org,
Cyrill Gorcunov <gorcunov@...nvz.org>,
Alexander Viro <viro@...iv.linux.org.uk>,
linux-fsdevel@...r.kernel.org,
Thomas Gleixner <tglx@...utronix.de>,
"Paul E. McKenney" <paulmck@...ux.vnet.ibm.com>,
Michael Kerrisk <mtk.manpages@...il.com>
Subject: Re: [CRIU] [PATCH 1/4] signalfd: add ability to return siginfo in a
raw format
2012/12/28 Oleg Nesterov <oleg@...hat.com>:
> On 12/28, Andrey Wagin wrote:
>>
>> 2012/12/28 Oleg Nesterov <oleg@...hat.com>:
>> >> >> @@ -321,6 +372,7 @@ SYSCALL_DEFINE4(signalfd4, int, ufd, sigset_t __user *, user_mask,
>> >> >> }
>> >> >>
>> >> >> file->f_flags |= flags & SFD_RAW;
>> >> >> + file->f_mode |= FMODE_PREAD;
>> >> >>
>> >> >> fd_install(ufd, file);
>> >> >
>> >> > Hmm. Looks like it is based on other patches I didnt see...
>> >> >
>> >> > But I don't understand how FMODE_PREAD connects to this patch, we need
>> >> > this flag set even for regular sys_read() ???
>> >>
>> >> It doesn't need for sys_read(), but this patch is about pread() and
>> >> sys_pread() checks it.
>> >>
>> >> SYSCALL_DEFINE(pread64)(unsigned int fd, char __user *buf,
>> >> size_t count, loff_t pos)
>> >> {
>> >> ....
>> >> if (f.file) {
>> >> ret = -ESPIPE;
>> >> if (f.file->f_mode & FMODE_PREAD)
>> >> ret = vfs_read(f.file, buf, count, &pos);
>> >
>> > And sys_read() checks it too, that was my point.
>>
>> sys_read() doesn't check this flag. I tryed to remove this code from
>> this patch and pread returned ESPIPE as expected.
>
> sys_read() calls vfs_read() which checks f_mode & FMODE_READ at the
> start ?
FMODE_READ != FMODE_PREAD ;)
>
> Oleg.
>
--
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