From: Rohan Puri <rohan.puri15@gmail.com>
To: "Lukáš Czerner" <lczerner@redhat.com>
Cc: hch@infradead.org, viro@zeniv.linux.org.uk,
Linux FS Devel <linux-fsdevel@vger.kernel.org>
Subject: Re: [PATCH 1/2] Remove misleading comment in do_fallocate()
Date: Fri, 18 Jul 2014 18:02:49 +0530 [thread overview]
Message-ID: <CALJfu6ND7f-CDFJhftiwrTZmMW==NYp8Piok3Sh=TCPXPQFLTA@mail.gmail.com> (raw)
In-Reply-To: <alpine.LFD.2.00.1407181314430.12453@localhost.localdomain>
On Fri, Jul 18, 2014 at 4:47 PM, Lukáš Czerner <lczerner@redhat.com> wrote:
> On Fri, 18 Jul 2014, Rohan Puri wrote:
>
>> Date: Fri, 18 Jul 2014 16:13:21 +0530
>> From: Rohan Puri <rohan.puri15@gmail.com>
>> To: Lukáš Czerner <lczerner@redhat.com>
>> Cc: hch@infradead.org, viro@zeniv.linux.org.uk,
>> Linux FS Devel <linux-fsdevel@vger.kernel.org>
>> Subject: Re: [PATCH 1/2] Remove misleading comment in do_fallocate()
>>
>> On Fri, Jul 18, 2014 at 4:05 PM, Lukáš Czerner <lczerner@redhat.com> wrote:
>>
>> > On Fri, 18 Jul 2014, Rohan Puri wrote:
>> >
>> > > Date: Fri, 18 Jul 2014 15:27:26 +0530
>> > > From: Rohan Puri <rohan.puri15@gmail.com>
>> > > To: hch@infradead.org, viro@zeniv.linux.org.uk
>> > > Cc: linux-fsdevel@vger.kernel.org
>> > > Subject: [PATCH 1/2] Remove misleading comment in do_fallocate()
>> > >
>> > > Preallocation for directory gets blocked at 2 places & never gets
>> > propogated
>> > > to the underlying file system : -
>> > >
>> > > - open(2) with O_DIRECTORY | O_WRONLY or O_DIRECTORY | O_RDWR
>> > > at do_last()->may_open().
>> > > - open(2) with O_DIRECTORY | O_RDONLY -> fallocate(2) at do_fallocate().
>> > >
>> > > Signed-off-by: Rohan Puri <rohan.puri15@gmail.com>
>> > > ---
>> > > fs/open.c | 4 ----
>> > > 1 file changed, 4 deletions(-)
>> > >
>> > > diff --git a/fs/open.c b/fs/open.c
>> > > index 9d64679..5d4f372 100644
>> > > --- a/fs/open.c
>> > > +++ b/fs/open.c
>> > > @@ -280,10 +280,6 @@ int do_fallocate(struct file *file, int mode,
>> > loff_t offset, loff_t len)
>> > > if (S_ISFIFO(inode->i_mode))
>> > > return -ESPIPE;
>> > >
>> > > - /*
>> > > - * Let individual file system decide if it supports preallocation
>> > > - * for directories or not.
>> > > - */
>> >
>> > What's wrong about this comment ? We're only going to let through
>> > regular files and directories and it's up to the file system to
>> > decide what it want to support.
>> >
>> I agree, but AFAIK for directories we are never going to reach upto the
>> file systems, since directory file opened with O_WRONLY or O_RDWR flag gets
>> blocked by open(2)->do_last()->may_open() and directory with O_RDONLY gets
>> blocked by do_fallocate() returning -EBADF.
>
> That's something that needs to be resolved when someone decides to
> add fallocate support for directories. There has already been a
> small discussion about that idea.
>
> So I think that the comment is just fine from the fallocate
> perspective.
sounds good. Thanks Lukas for clarification :)
>
> -Lukas
>
>> So this comment is misleading in terms that for directory we never go to
>> file systems during fallocate.
>>
>> >
>> > -Lukas
>> >
>> > > if (!S_ISREG(inode->i_mode) && !S_ISDIR(inode->i_mode))
>> > > return -ENODEV;
>> > >
>> > >
>> >
>>
>> - Rohan
>>
- Rohan
--
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2014-07-18 12:32 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-07-18 9:50 [PATCH 0/2] fallocate(2) related cleanups Rohan Puri
2014-07-18 9:57 ` [PATCH 1/2] Remove misleading comment in do_fallocate() Rohan Puri
2014-07-18 10:35 ` Lukáš Czerner
[not found] ` <CALJfu6Ok_jdNqacsEKnnVvzxSxCuRC7dA0abve28BASaAgB31A@mail.gmail.com>
2014-07-18 10:47 ` Fwd: " Rohan Puri
2014-07-18 11:17 ` Lukáš Czerner
2014-07-18 12:32 ` Rohan Puri [this message]
2014-07-18 9:58 ` [PATCH 2/2] Remove redundant inode mode checks for ceph & ext4 Rohan Puri
2014-07-18 10:32 ` Lukáš Czerner
2014-07-18 10:46 ` Rohan Puri
2014-07-18 11:18 ` Lukáš Czerner
2014-07-18 12:33 ` Rohan Puri
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CALJfu6ND7f-CDFJhftiwrTZmMW==NYp8Piok3Sh=TCPXPQFLTA@mail.gmail.com' \
--to=rohan.puri15@gmail.com \
--cc=hch@infradead.org \
--cc=lczerner@redhat.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=viro@zeniv.linux.org.uk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).