From mboxrd@z Thu Jan 1 00:00:00 1970 From: akpm@osdl.org Subject: [patch 1/6] ext2_setattr retval fix Date: Sat, 26 Jun 2004 15:00:23 -0700 Sender: linux-fsdevel-owner@vger.kernel.org Message-ID: <200406262201.i5QM1IZ06624@mail.osdl.org> Cc: shaggy@austin.ibm.com, sfrench@us.ibm.com, vandrove@vc.cvut.cz, zippel@linux-m68k.org, agruen@suse.de, linux-fsdevel@vger.kernel.org, akpm@osdl.org Return-path: Received: from fw.osdl.org ([65.172.181.6]:61323 "EHLO mail.osdl.org") by vger.kernel.org with ESMTP id S266461AbUFZWCN (ORCPT ); Sat, 26 Jun 2004 18:02:13 -0400 To: mason@suse.com List-Id: linux-fsdevel.vger.kernel.org ext2_setattr() drops the inode_setattr() return value on the floor. This is very bad - I/O errors during truncate are lost. The patch changes ext2_setattr() so that we no longer call ext2_acl_chmod() if inode_setattr(), which is what ext3 does. Signed-off-by: Andrew Morton --- 25-akpm/fs/ext2/inode.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff -puN fs/ext2/inode.c~setattr-retval-fixes fs/ext2/inode.c --- 25/fs/ext2/inode.c~setattr-retval-fixes 2004-06-26 14:35:58.479309024 -0700 +++ 25-akpm/fs/ext2/inode.c 2004-06-26 14:35:58.483308416 -0700 @@ -1276,8 +1276,8 @@ int ext2_setattr(struct dentry *dentry, if (error) return error; } - inode_setattr(inode, iattr); - if (iattr->ia_valid & ATTR_MODE) + error = inode_setattr(inode, iattr); + if (!error && (iattr->ia_valid & ATTR_MODE)) error = ext2_acl_chmod(inode); return error; } _