From: Namjae Jeon <linkinjeon@kernel.org>
To: sj1557.seo@samsung.com, yuezhang.mo@sony.com, brauner@kernel.org,
djwong@kernel.org, hch@lst.de
Cc: linux-fsdevel@vger.kernel.org, anmuxixixi@gmail.com,
dxdt@dev.snart.me, chizhiling@kylinos.cn, chizhiling@163.com,
linux-kernel@vger.kernel.org, Namjae Jeon <linkinjeon@kernel.org>
Subject: [PATCH v3 11/11] exfat: make exfat_truncate() return error code
Date: Wed, 13 May 2026 20:21:56 +0900 [thread overview]
Message-ID: <20260513112156.9122-12-linkinjeon@kernel.org> (raw)
In-Reply-To: <20260513112156.9122-1-linkinjeon@kernel.org>
Convert exfat_truncate() to return int, and make it return the error
code on failure. Update exfat_setattr() to handle the returned error
appropriately.
Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
---
fs/exfat/file.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/fs/exfat/file.c b/fs/exfat/file.c
index 6ae2f72621ab..2b650a73c5c8 100644
--- a/fs/exfat/file.c
+++ b/fs/exfat/file.c
@@ -292,7 +292,7 @@ int __exfat_truncate(struct inode *inode)
return 0;
}
-static void exfat_truncate(struct inode *inode)
+static int exfat_truncate(struct inode *inode)
{
struct super_block *sb = inode->i_sb;
struct exfat_sb_info *sbi = EXFAT_SB(sb);
@@ -315,6 +315,8 @@ static void exfat_truncate(struct inode *inode)
inode->i_blocks = round_up(i_size_read(inode), sbi->cluster_size) >> 9;
write_size:
mutex_unlock(&sbi->s_lock);
+
+ return err;
}
int exfat_getattr(struct mnt_idmap *idmap, const struct path *path,
@@ -400,7 +402,7 @@ int exfat_setattr(struct mnt_idmap *idmap, struct dentry *dentry,
* __exfat_write_inode() is called from exfat_truncate(), inode
* is already written by it, so mark_inode_dirty() is unneeded.
*/
- exfat_truncate(inode);
+ error = exfat_truncate(inode);
up_write(&EXFAT_I(inode)->truncate_lock);
} else
mark_inode_dirty(inode);
--
2.25.1
prev parent reply other threads:[~2026-05-13 11:22 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-13 11:21 [PATCH v3 00/11] exfat: convert to iomap Namjae Jeon
2026-05-13 11:21 ` [PATCH v3 01/11] iomap: introduce IOMAP_F_ZERO_TAIL flag Namjae Jeon
2026-05-13 11:21 ` [PATCH v3 02/11] exfat: replace unsafe macros with static inline functions Namjae Jeon
2026-05-13 11:21 ` [PATCH v3 03/11] exfat: add balloc parameter to exfat_map_cluster() for iomap support Namjae Jeon
2026-05-13 11:21 ` [PATCH v3 04/11] exfat: add exfat_file_open() Namjae Jeon
2026-05-13 12:06 ` CharSyam
2026-05-13 14:11 ` Namjae Jeon
2026-05-13 11:21 ` [PATCH v3 05/11] exfat: add support for multi-cluster allocation Namjae Jeon
2026-05-13 11:21 ` [PATCH v3 06/11] exfat: add data_start_bytes and exfat_cluster_to_phys() helper Namjae Jeon
2026-05-13 15:17 ` CharSyam
2026-05-13 23:43 ` Namjae Jeon
2026-05-13 11:21 ` [PATCH v3 07/11] exfat: fix implicit declaration of brelse() Namjae Jeon
2026-05-13 11:21 ` [PATCH v3 08/11] exfat: add iomap buffered I/O support Namjae Jeon
2026-05-13 11:21 ` [PATCH v3 09/11] exfat: add iomap direct " Namjae Jeon
2026-05-13 11:21 ` [PATCH v3 10/11] exfat: add support for SEEK_HOLE and SEEK_DATA in llseek Namjae Jeon
2026-05-13 11:21 ` Namjae Jeon [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=20260513112156.9122-12-linkinjeon@kernel.org \
--to=linkinjeon@kernel.org \
--cc=anmuxixixi@gmail.com \
--cc=brauner@kernel.org \
--cc=chizhiling@163.com \
--cc=chizhiling@kylinos.cn \
--cc=djwong@kernel.org \
--cc=dxdt@dev.snart.me \
--cc=hch@lst.de \
--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