linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Haotian Zhang <vulab@iscas.ac.cn>
To: linkinjeon@kernel.org, sj1557.seo@samsung.com, yuezhang.mo@sony.com
Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org,
	Haotian Zhang <vulab@iscas.ac.cn>
Subject: [PATCH v2] fs: exfat: improve error code handling in exfat_find_empty_entry()
Date: Fri,  5 Dec 2025 09:59:04 +0800	[thread overview]
Message-ID: <20251205015904.1186-1-vulab@iscas.ac.cn> (raw)
In-Reply-To: <20251203070813.1448-1-vulab@iscas.ac.cn>

Change the type of 'ret' from unsigned int to int in
exfat_find_empty_entry(). Although the implicit type conversion
(int -> unsigned int -> int) does not cause actual bugs in
practice, using int directly is more appropriate for storing
error codes returned by exfat_alloc_cluster().

This improves code clarity and consistency with standard error
handling practices.

Signed-off-by: Haotian Zhang <vulab@iscas.ac.cn>
---
 fs/exfat/namei.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/fs/exfat/namei.c b/fs/exfat/namei.c
index f5f1c4e8a29f..f2a87ecd79f9 100644
--- a/fs/exfat/namei.c
+++ b/fs/exfat/namei.c
@@ -304,8 +304,8 @@ static int exfat_find_empty_entry(struct inode *inode,
 		struct exfat_chain *p_dir, int num_entries,
 		struct exfat_entry_set_cache *es)
 {
-	int dentry;
-	unsigned int ret, last_clu;
+	int dentry, ret;
+	unsigned int last_clu;
 	loff_t size = 0;
 	struct exfat_chain clu;
 	struct super_block *sb = inode->i_sb;
-- 
2.50.1.windows.1


  parent reply	other threads:[~2025-12-05  1:59 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20251203070828epcas1p219623b1095d4f34a5af5adada269b14f@epcas1p2.samsung.com>
2025-12-03  7:08 ` [PATCH] fs: exfat: Fix corrupted error code handling in exfat_find_empty_entry() Haotian Zhang
2025-12-04 11:58   ` Sungjong Seo
2025-12-05  1:59   ` Haotian Zhang [this message]
2025-12-05  6:05     ` [PATCH v2] fs: exfat: improve " Sungjong Seo
2025-12-06 10:44     ` Namjae Jeon

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=20251205015904.1186-1-vulab@iscas.ac.cn \
    --to=vulab@iscas.ac.cn \
    --cc=linkinjeon@kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sj1557.seo@samsung.com \
    --cc=yuezhang.mo@sony.com \
    /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;
as well as URLs for NNTP newsgroup(s).