From: Krystian Kaniewski <krystianmkaniewski@gmail.com>
To: Joseph Qi <joseph.qi@linux.alibaba.com>
Cc: Mark Fasheh <mark@fasheh.com>, Joel Becker <jlbec@evilplan.org>,
Andrew Morton <akpm@linux-foundation.org>,
kernel test robot <lkp@intel.com>,
oe-kbuild-all@lists.linux.dev, ocfs2-devel@lists.linux.dev,
linux-kernel@vger.kernel.org,
Linux Memory Management List <linux-mm@kvack.org>
Subject: Re: [PATCH] ocfs2: remove unnecessary ret variable in ocfs2_calc_xattr_init()
Date: Tue, 8 Sep 2026 10:32:36 +0200 [thread overview]
Message-ID: <9fd0ed6b-e732-4485-a7b5-0380b07d3fc4@gmail.com> (raw)
In-Reply-To: <b63bd2bd-229f-4636-9c89-8f1686ab087d@linux.alibaba.com>
Hey Joseph,
Thanks for letting me know and let's drop this patch then. I've just
received an email a few days ago after my patch was applied to upstream
Linux and there was this finding, however I didn't expect it's already
addressed.
On 9/8/2026 3:23 AM, Joseph Qi wrote:
> Hi,
> This has already been addressed by:
> ed57836ff300 ocfs2: make ocfs2_calc_xattr_init() return void
>
> Thanks,
> Joseph
>
> On 9/7/26 9:22 PM, Krystian Kaniewski wrote:
>> Commit bd7c05fb4a47 ("ocfs2: fix circular locking dependency in
>> ocfs2_init_acl()") removed the only code that could change ret in
>> ocfs2_calc_xattr_init(). The variable is now always zero, so remove it
>> and return zero directly.
>>
>> This fixes the reported Coccinelle warning without changing behavior.
>>
>> Fixes: bd7c05fb4a47 ("ocfs2: fix circular locking dependency in ocfs2_init_acl()")
>> Reported-by: kernel test robot <lkp@intel.com>
>> Closes: https://lore.kernel.org/oe-kbuild-all/202609040247.8B3lmoqX-lkp@intel.com/
>> Signed-off-by: Krystian Kaniewski <krystianmkaniewski@gmail.com>
>> ---
>> fs/ocfs2/xattr.c | 5 ++---
>> 1 file changed, 2 insertions(+), 3 deletions(-)
>>
>> diff --git a/fs/ocfs2/xattr.c b/fs/ocfs2/xattr.c
>> index 35bcbb0ff607..ab3b645983c9 100644
>> --- a/fs/ocfs2/xattr.c
>> +++ b/fs/ocfs2/xattr.c
>> @@ -640,7 +640,6 @@ int ocfs2_calc_xattr_init(struct inode *dir, umode_t mode,
>> int *want_clusters, int *xattr_credits,
>> int *want_meta, struct ocfs2_acl_state *acl_state)
>> {
>> - int ret = 0;
>> struct ocfs2_super *osb = OCFS2_SB(dir->i_sb);
>> int s_size = 0, a_size = 0, acl_len = 0, new_clusters;
>>
>> @@ -662,7 +661,7 @@ int ocfs2_calc_xattr_init(struct inode *dir, umode_t mode,
>> }
>>
>> if (!(s_size + a_size))
>> - return ret;
>> + return 0;
>>
>> /*
>> * The max space of security xattr taken inline is
>> @@ -729,7 +728,7 @@ int ocfs2_calc_xattr_init(struct inode *dir, umode_t mode,
>> }
>> }
>>
>> - return ret;
>> + return 0;
>> }
>>
>> static int ocfs2_xattr_extend_allocation(struct inode *inode,
>>
>> base-commit: bc35965f6940a9bf834d54187b6088b8eb09206d
prev parent reply other threads:[~2026-09-08 8:32 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-03 18:10 fs/ocfs2/xattr.c:643:5-8: Unneeded variable: "ret". Return "0" on line 665 kernel test robot
2026-09-07 13:22 ` [PATCH] ocfs2: remove unnecessary ret variable in ocfs2_calc_xattr_init() Krystian Kaniewski
2026-09-08 1:23 ` Joseph Qi
2026-09-08 8:32 ` Krystian Kaniewski [this message]
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=9fd0ed6b-e732-4485-a7b5-0380b07d3fc4@gmail.com \
--to=krystianmkaniewski@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=jlbec@evilplan.org \
--cc=joseph.qi@linux.alibaba.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=lkp@intel.com \
--cc=mark@fasheh.com \
--cc=ocfs2-devel@lists.linux.dev \
--cc=oe-kbuild-all@lists.linux.dev \
/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
all inboxes | Powered by JetHome®