From 8b0c471773819c8201dc0b0123e1580639ee1570 Mon Sep 17 00:00:00 2001 From: Tetsuhiro Kohada Date: Wed, 24 Jun 2020 09:54:54 +0900 Subject: exfat: add error check when updating dir-entries Add error check when synchronously updating dir-entries. Suggested-by: Sungjong Seo Signed-off-by: Tetsuhiro Kohada Signed-off-by: Namjae Jeon --- fs/exfat/file.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'fs/exfat/file.c') diff --git a/fs/exfat/file.c b/fs/exfat/file.c index a6a063830edc..6bdabfd4b134 100644 --- a/fs/exfat/file.c +++ b/fs/exfat/file.c @@ -154,6 +154,7 @@ int __exfat_truncate(struct inode *inode, loff_t new_size) struct timespec64 ts; struct exfat_dentry *ep, *ep2; struct exfat_entry_set_cache *es; + int err; es = exfat_get_dentry_set(sb, &(ei->dir), ei->entry, ES_ALL_ENTRIES); @@ -188,7 +189,9 @@ int __exfat_truncate(struct inode *inode, loff_t new_size) } exfat_update_dir_chksum_with_entry_set(es); - exfat_free_dentry_set(es, inode_needs_sync(inode)); + err = exfat_free_dentry_set(es, inode_needs_sync(inode)); + if (err) + return err; } /* cut off from the FAT chain */ -- cgit v1.2.3