From: Li Zhong <floridsleeves@gmail.com>
To: linux-kernel@vger.kernel.org, linux-ext4@vger.kernel.org
Cc: adilger.kernel@dilger.ca, tytso@mit.edu,
Li Zhong <floridsleeves@gmail.com>
Subject: [PATCH v2] fs/ext4/xattr: check the return value of ext4_xattr_inode_dec_ref()
Date: Fri, 16 Sep 2022 17:28:16 -0700 [thread overview]
Message-ID: <20220917002816.3804400-1-floridsleeves@gmail.com> (raw)
Check the return value of ext4_xattr_inode_dec_ref(), which could return
error code and need to be warned.
Signed-off-by: Li Zhong <floridsleeves@gmail.com>
---
fs/ext4/xattr.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/fs/ext4/xattr.c b/fs/ext4/xattr.c
index 533216e80fa2..e6d62fd4ac31 100644
--- a/fs/ext4/xattr.c
+++ b/fs/ext4/xattr.c
@@ -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;
}
--
2.25.1
next reply other threads:[~2022-09-17 0:28 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-09-17 0:28 Li Zhong [this message]
2022-11-29 21:12 ` [PATCH v2] fs/ext4/xattr: check the return value of ext4_xattr_inode_dec_ref() Theodore Ts'o
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220917002816.3804400-1-floridsleeves@gmail.com \
--to=floridsleeves@gmail.com \
--cc=adilger.kernel@dilger.ca \
--cc=linux-ext4@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=tytso@mit.edu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox