[PATCH 08/25] ext234: have setattr functions call attr_kill_to_mode

From: Jeff Layton
Date: Mon Aug 06 2007 - 10:07:30 EST


.. and only save off ia_valid once it returns

Signed-off-by: Jeff Layton <jlayton@xxxxxxxxxx>
---
fs/ext2/inode.c | 1 +
fs/ext3/inode.c | 5 ++++-
fs/ext4/inode.c | 5 ++++-
3 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/fs/ext2/inode.c b/fs/ext2/inode.c
index 0079b2c..33dfc48 100644
--- a/fs/ext2/inode.c
+++ b/fs/ext2/inode.c
@@ -1311,6 +1311,7 @@ int ext2_setattr(struct dentry *dentry, struct iattr *iattr)
struct inode *inode = dentry->d_inode;
int error;

+ attr_kill_to_mode(inode, iattr);
error = inode_change_ok(inode, iattr);
if (error)
return error;
diff --git a/fs/ext3/inode.c b/fs/ext3/inode.c
index de4e316..5ca1085 100644
--- a/fs/ext3/inode.c
+++ b/fs/ext3/inode.c
@@ -2919,7 +2919,10 @@ int ext3_setattr(struct dentry *dentry, struct iattr *attr)
{
struct inode *inode = dentry->d_inode;
int error, rc = 0;
- const unsigned int ia_valid = attr->ia_valid;
+ unsigned int ia_valid;
+
+ attr_kill_to_mode(inode, attr);
+ ia_valid = attr->ia_valid;

error = inode_change_ok(inode, attr);
if (error)
diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c
index a4848e0..9a51e44 100644
--- a/fs/ext4/inode.c
+++ b/fs/ext4/inode.c
@@ -2935,7 +2935,10 @@ int ext4_setattr(struct dentry *dentry, struct iattr *attr)
{
struct inode *inode = dentry->d_inode;
int error, rc = 0;
- const unsigned int ia_valid = attr->ia_valid;
+ unsigned int ia_valid;
+
+ attr_kill_to_mode(inode, attr);
+ ia_valid = attr->ia_valid;

error = inode_change_ok(inode, attr);
if (error)
--
1.5.2.2

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/