Skip to content

Commit 59c30e3

Browse files
Sungjong Seonamjaejeon
authored andcommitted
exfat: fix potential wrong error return from get_block
If there is no error, get_block() should return 0. However, when bh_read() returns 1, get_block() also returns 1 in the same manner. Let's set err to 0, if there is no error from bh_read() Fixes: 11a347f ("exfat: change to get file size from DataLength") Cc: stable@vger.kernel.org Signed-off-by: Sungjong Seo <sj1557.seo@samsung.com> Reviewed-by: Yuezhang Mo <Yuezhang.Mo@sony.com> Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
1 parent 47e3536 commit 59c30e3

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

fs/exfat/inode.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -391,6 +391,8 @@ static int exfat_get_block(struct inode *inode, sector_t iblock,
391391
/* Zero unwritten part of a block */
392392
memset(bh_result->b_data + size, 0,
393393
bh_result->b_size - size);
394+
395+
err = 0;
394396
} else {
395397
/*
396398
* The range has not been written, clear the mapped flag

0 commit comments

Comments
 (0)