Skip to contentSkip to conversation

ext2_setattr retval fix

PATCH In review [email protected] 1 participant 1 message Jun 26, 2004

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/6 ext2_setattr retval fix

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.

---

 25-akpm/fs/ext2/inode.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
fs/ext2/inode.c renamed from fs/ext2/inode.c~setattr-retval-fixes +2 -2
diff -puN fs/ext2/inode.c~setattr-retval-fixes fs/ext2/inode.c
@@ -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;
 }

_