[PATCH 6/7] ext4: use nofail variant of inode_setattr()

From: Dmitry Monakhov
Date: Fri Feb 19 2010 - 14:49:37 EST


After we updated i_disk_size and stop the journal it is
too late for error handling from inode_setattr().
Since inode_change_ok() is now responsible for all
necessery checks we may call __inode_setattr() which can
not fail.

Signed-off-by: Dmitry Monakhov <dmonakhov@xxxxxxxxxx>
---
fs/ext4/inode.c | 7 +++++--
1 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c
index 218ea0b..1748265 100644
--- a/fs/ext4/inode.c
+++ b/fs/ext4/inode.c
@@ -5436,8 +5436,11 @@ int ext4_setattr(struct dentry *dentry, struct iattr *attr)
}
}
}
-
- rc = inode_setattr(inode, attr);
+ /*
+ * All necessery check already done in inode_check_ok(),
+ * it is safe to use nofail version here.
+ */
+ __inode_setattr(inode, attr);

/* If inode_setattr's call to ext4_truncate failed to get a
* transaction handle at all, we need to clean up the in-core
--
1.6.6

--
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/