linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dave Kleikamp <shaggy@linux.vnet.ibm.com>
To: Jan Kara <jack@suse.cz>
Cc: akpm@osdl.org, linux-ext4@vger.kernel.org
Subject: Re: [PATCH] Copy i_flags to ext3 inode flags on write (version 2)
Date: Tue, 24 Apr 2007 10:14:37 -0500	[thread overview]
Message-ID: <1177427677.15516.21.camel@kleikamp.austin.ibm.com> (raw)
In-Reply-To: <20070417103855.GB11815@duck.suse.cz>

On Tue, 2007-04-17 at 12:38 +0200, Jan Kara wrote:
>   Hi,
> 
>   attached is a second version of a patch that stores inode flags such as
> S_IMMUTABLE, S_APPEND, etc. from i_flags to EXT3_I(inode)->i_flags when
> inode is written to disk. The same thing is done on GETFLAGS ioctl.
>   Quota code changes these flags on quota files (to make it harder for
> sysadmin to screw himself) and these changes were not correctly
> propagated into the filesystem (especially, lsattr did not show them and
> users were wondering...). Andrew, could you please put the patch into your
> queue? Thanks.

I think you need a call to ext3_get_inode_flags in one more place.  In
ext3_ioctl(), EXT3_IOC_SETFLAGS modifies the flags based on what is in
ei->i_flags, so this code should make sure that ei->i_flags is in sync
with inode->i_flags.

Signed-off-by: Dave Kleikamp <shaggy@linux.vnet.ibm.com>

diff -Nurp linux-orig/fs/ext3/ioctl.c linux/fs/ext3/ioctl.c
--- linux-orig/fs/ext3/ioctl.c	2007-04-24 10:04:50.000000000 -0500
+++ linux/fs/ext3/ioctl.c	2007-04-24 10:05:59.000000000 -0500
@@ -51,6 +51,7 @@ int ext3_ioctl (struct inode * inode, st
 			flags &= ~EXT3_DIRSYNC_FL;
 
 		mutex_lock(&inode->i_mutex);
+		ext3_get_inode_flags(ei);
 		oldflags = ei->i_flags;
 
 		/* The JOURNAL_DATA flag is modifiable only by root */

-- 
David Kleikamp
IBM Linux Technology Center

  parent reply	other threads:[~2007-04-24 15:15 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-04-17 10:38 [PATCH] Copy i_flags to ext3 inode flags on write (version 2) Jan Kara
2007-04-20  7:53 ` Andrew Morton
2007-04-23 18:33   ` Jan Kara
2007-04-24 15:14 ` Dave Kleikamp [this message]
2007-04-24 15:35   ` Jan Kara
2007-04-24 15:44     ` Dave Kleikamp

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=1177427677.15516.21.camel@kleikamp.austin.ibm.com \
    --to=shaggy@linux.vnet.ibm.com \
    --cc=akpm@osdl.org \
    --cc=jack@suse.cz \
    --cc=linux-ext4@vger.kernel.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;
as well as URLs for NNTP newsgroup(s).