From: Valdis.Kletnieks@vt.edu
To: Andreas Gruenbacher <agruen@suse.de>
Cc: Andrew Morton <akpm@osdl.org>, Linus Torvalds <torvalds@osdl.org>,
Andrew Tridgell <tridge@osdl.org>,
"Stephen C. Tweedie" <sct@redhat.com>,
Andreas Dilger <adilger@clusterfs.com>,
Alex Tomas <alex@clusterfs.com>,
linux-kernel@vger.kernel.org
Subject: Re: Fix ea-in-inode default ACL creation
Date: Thu, 20 Jan 2005 13:56:43 -0500 [thread overview]
Message-ID: <200501201856.j0KIuiif016865@turing-police.cc.vt.edu> (raw)
In-Reply-To: Your message of "Thu, 20 Jan 2005 19:22:25 +0100." <1106245344.15959.13.camel@winden.suse.de>
[-- Attachment #1: Type: text/plain, Size: 1800 bytes --]
On Thu, 20 Jan 2005 19:22:25 +0100, Andreas Gruenbacher said:
> When a new inode is created, ext3_new_inode sets the EXT3_STATE_NEW
> flag, which tells ext3_do_update_inode to zero out the inode before
> filling in the inode's data. When a file is created in a directory with
> a default acl, the new inode inherits the directory's default acl; this
> generates attributes. The attributes are created before
> ext3_do_update_inode is called to write out the inode. In case of
> in-inode attributes, the new inode's attributes are written, and then
> zeroed out again by ext3_do_update_inode. Bad thing.
>
> Fix this by recognizing the EXT3_STATE_NEW case in
> ext3_xattr_set_handle, and zeroing out the inode there already when
> necessary.
>
> Signed-off-by: Andreas Gruenbacher <agruen@suse.de>
>
> Index: linux-2.6.11-latest/fs/ext3/xattr.c
> ===================================================================
> --- linux-2.6.11-latest.orig/fs/ext3/xattr.c
> +++ linux-2.6.11-latest/fs/ext3/xattr.c
> @@ -954,6 +954,13 @@ ext3_xattr_set_handle(handle_t *handle,
> error = ext3_get_inode_loc(inode, &is.iloc);
> if (error)
> goto cleanup;
> +
> + if (EXT3_I(inode)->i_state & EXT3_STATE_NEW) {
> + struct ext3_inode *raw_inode = ext3_raw_inode(&is.iloc);
> + memset(raw_inode, 0, EXT3_SB(inode->i_sb)->s_inode_size);
> + EXT3_I(inode)->i_state &= ~EXT3_STATE_NEW;
> + }
> +
> error = ext3_xattr_ibody_find(inode, &i, &is);
> if (error)
> goto cleanup;
Maybe I'm a total idiot, but I'm failing to see how adding *another* zero
operation (although quite likely needed at that point) is going to help the
fact that we zero something out after we've stored data we want to keep in it.
Is there a missing hunk that *removes* the too-late memset-to-zero in
ext3_do_update_inode?
[-- Attachment #2: Type: application/pgp-signature, Size: 226 bytes --]
next prev parent reply other threads:[~2005-01-20 19:03 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-01-20 18:22 Andreas Gruenbacher
2005-01-20 18:56 ` Valdis.Kletnieks [this message]
2005-01-20 19:07 ` Andreas Dilger
2005-01-20 19:09 ` Andreas Gruenbacher
2005-01-20 19:21 ` Valdis.Kletnieks
2005-01-21 21:36 ` Stephen C. Tweedie
2005-01-21 21:48 ` Andreas Gruenbacher
2005-01-21 22:06 ` Stephen C. Tweedie
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=200501201856.j0KIuiif016865@turing-police.cc.vt.edu \
--to=valdis.kletnieks@vt.edu \
--cc=adilger@clusterfs.com \
--cc=agruen@suse.de \
--cc=akpm@osdl.org \
--cc=alex@clusterfs.com \
--cc=linux-kernel@vger.kernel.org \
--cc=sct@redhat.com \
--cc=torvalds@osdl.org \
--cc=tridge@osdl.org \
/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
all inboxes | Powered by JetHome®