Skip to contentSkip to conversation

fs/ext4/xattr: check the return value of ext4_xattr_inode_dec_ref()

PATCH Applied Li Zhong 2 participants 2 messages Sep 17, 2022 – Nov 29, 2022 ext4 file system

lore
Share & tools
lore

Li Zhong

author
#0 lore raw

PATCH v2 1/1 fs/ext4/xattr: check the return value of ext4_xattr_inode_dec_ref()

Check the return value of ext4_xattr_inode_dec_ref(), which could return error code and need to be warned.

---
 fs/ext4/xattr.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
fs/ext4/xattr.c +2 -1
index 533216e80fa2..e6d62fd4ac31 100644
@@ -1540,7 +1540,8 @@ static int ext4_xattr_inode_lookup_create(handle_t *handle, struct inode *inode,
 
 	err = ext4_xattr_inode_write(handle, ea_inode, value, value_len);
 	if (err) {
-		ext4_xattr_inode_dec_ref(handle, ea_inode);
+		if (ext4_xattr_inode_dec_ref(handle, ea_inode))
+			ext4_warning_inode(ea_inode, "cleanup dec ref error %d", err);
 		iput(ea_inode);
 		return err;
 	}
Signature · 1 line
2.25.1
maintainer Applied
#1 lore raw
Quoted 4 lines · Li Zhong

Check the return value of ext4_xattr_inode_dec_ref(), which could return error code and need to be warned.

Applied, thanks!

[1/1] fs/ext4/xattr: check the return value of ext4_xattr_inode_dec_ref()

      commit: 883a86e4276a9facf1a0fe6950e504f52b841853

Best regards,

Signature · 1 line
Theodore Ts'o <[email protected]>