[Yaffs] [PATCH] more fix for inode_setattr

Top Page
Attachments:
Message as email
+ (text/plain)
+ 11-check-inode_setattr-return-value.diff (text/plain)
Delete this message
Reply to this message
Author: Luc Van Oostenryck
Date:  
To: yaffs
Subject: [Yaffs] [PATCH] more fix for inode_setattr
I think that we must only call inode_setattr() if yaffs_SetAttributes() succeed.

It seems logical and it's done like this in other filesystems.
diff --git a/fs/yaffs2/yaffs_fs.c b/fs/yaffs2/yaffs_fs.c
--- a/fs/yaffs2/yaffs_fs.c
+++ b/fs/yaffs2/yaffs_fs.c
@@ -1200,7 +1200,8 @@ static int yaffs_setattr(struct dentry *
             error = -EPERM;
         }
         yaffs_GrossUnlock(dev);
-        error = inode_setattr(inode,attr);
+        if (!error)
+            error = inode_setattr(inode,attr);
     }
     return error;
 }