Skip to contentSkip to conversation

ext4: stop update inode before return

PATCH In review Pan Bian 2 participants 2 messages Jan 19, 2021 – Jan 20, 2021 ext4 file system

lore
Share & tools
lore

Pan Bian

author
#0 lore raw

PATCH 1/1 ext4: stop update inode before return

Stop inode updating before returning the error code.

Fixes aa75f4d3daae ("ext4: main fast-commit commit path")
---
 fs/ext4/inode.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
fs/ext4/inode.c +3 -1
index c173c8405856..64039bbb656d 100644
@@ -5389,8 +5389,10 @@ int ext4_setattr(struct dentry *dentry, struct iattr *attr)
 			inode->i_gid = attr->ia_gid;
 		error = ext4_mark_inode_dirty(handle, inode);
 		ext4_journal_stop(handle);
-		if (unlikely(error))
+		if (unlikely(error)) {
+			ext4_fc_stop_update(inode);
 			return error;
+		}
 	}
 
 	if (attr->ia_valid & ATTR_SIZE) {
Signature · 1 line
2.17.1
Reviewed-by on v1 1/1
#1 lore raw

Thanks Pan for the fix. Looks good to me.

Quoted 28 lines · Pan Bian

Stop inode updating before returning the error code.

Fixes aa75f4d3daae ("ext4: main fast-commit commit path")
---
 fs/ext4/inode.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
fs/ext4/inode.c +3 -2
index c173c8405856..64039bbb656d 100644
@@ -5389,8 +5389,10 @@ int ext4_setattr(struct dentry *dentry, struct iattr *attr)
                        inode->i_gid = attr->ia_gid;
                error = ext4_mark_inode_dirty(handle, inode);
                ext4_journal_stop(handle);
-               if (unlikely(error))
+               if (unlikely(error)) {
+                       ext4_fc_stop_update(inode);
                        return error;
+               }
        }
 
        if (attr->ia_valid & ATTR_SIZE) {
--

2.17.1