[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CA+dCu8_bMXy3FN9BWFUwCcg4=peH93Mv7CcypShfQETA71Hebw@mail.gmail.com>
Date: Sun, 30 Oct 2011 09:23:47 +0800
From: Eryu Guan <guaneryu@...il.com>
To: "Ted Ts'o" <tytso@....edu>
Cc: linux-ext4@...r.kernel.org
Subject: Re: [PATCH] ext4: Avoid creating new file in append-only dir when
open(2) return error
On Sun, Oct 30, 2011 at 2:54 AM, Ted Ts'o <tytso@....edu> wrote:
> On Sat, Oct 29, 2011 at 02:02:41AM +0800, Eryu Guan wrote:
>> Newly created file on ext4 inherits inode flags from parent directory,
>> so new inode created in append-only directory has S_APPEND flag set,
>> may_open() called by do_last() checks that flag then returns -EPERM,
>> but at that time the new inode is already created.
>
> I have the following patch in the ext4 tree that should take care of
> this issue for ext2/3/4.
>
> - Ted
>
> ext2,ext3,ext4: don't inherit APPEND_FL or IMMUTABLE_FL for new inodes
>
> This doesn't make much sense, and it exposes a bug in the kernel where
> attempts to create a new file in an append-only directory using
> O_CREAT will fail (but still leave a zero-length file). This was
> discovered when xfstests #79 was generalized so it could run on all
> file systems.
>
I also found this by checking xfstests 079 and wanted to fix it in a way not
changing the current behavior. Masking out EXTN_APPEND_FL from inherit bits
makes more sense.
I think I should resend the comment cleanup part.
Thanks!
Eryu Guan
--
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists