Re: [PATCH] reiserfs: Fix corruption during shrinking of xattrs

From: Christian Kujau
Date: Wed Apr 14 2010 - 04:32:53 EST


On Tue, 13 Apr 2010 at 15:39, Jeff Mahoney wrote:
> This patch fixes it to use new_size.

Tested-by: Christian Kujau <lists@xxxxxxxxxxxxxxx>

With this patch applied (to today's mainline git, 2.6.34-rc4) I was able
to create 30k files with xattrs on the same test system that was failing
to do so before.

Thanks for the fix!

Christian.
--
BOFH excuse #88:

Boss' kid fucked up the machinediff --git a/fs/reiserfs/xattr.c b/fs/reiserfs/xattr.c
index 4f9586b..2058c28 100644
--- a/fs/reiserfs/xattr.c
+++ b/fs/reiserfs/xattr.c
@@ -554,7 +554,7 @@ reiserfs_xattr_set_handle(struct reiserfs_transaction_handle *th,
if (!err && new_size < i_size_read(dentry->d_inode)) {
struct iattr newattrs = {
.ia_ctime = current_fs_time(inode->i_sb),
- .ia_size = buffer_size,
+ .ia_size = new_size,
.ia_valid = ATTR_SIZE | ATTR_CTIME,
};