Skip to content

Commit

Permalink
exfat: fix timing of synchronizing bitmap and inode
Browse files Browse the repository at this point in the history
Commit(f55c096 exfat: do not zero the extended part) changed
the timing of synchronizing bitmap and inode in exfat_cont_expand().
The change caused xfstests generic/013 to fail if 'dirsync' or 'sync'
is enabled. So this commit restores the timing.

Fixes: f55c096 ("exfat: do not zero the extended part")
Signed-off-by: Yuezhang Mo <Yuezhang.Mo@sony.com>
Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
  • Loading branch information
Yuezhang Mo authored and Namjae Jeon committed Mar 31, 2024
1 parent 4cece76 commit d7ed523
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions fs/exfat/file.c
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ static int exfat_cont_expand(struct inode *inode, loff_t size)
clu.flags = ei->flags;

ret = exfat_alloc_cluster(inode, new_num_clusters - num_clusters,
&clu, IS_DIRSYNC(inode));
&clu, inode_needs_sync(inode));
if (ret)
return ret;

Expand All @@ -77,12 +77,11 @@ static int exfat_cont_expand(struct inode *inode, loff_t size)
ei->i_size_aligned = round_up(size, sb->s_blocksize);
ei->i_size_ondisk = ei->i_size_aligned;
inode->i_blocks = round_up(size, sbi->cluster_size) >> 9;
mark_inode_dirty(inode);

if (IS_DIRSYNC(inode))
if (IS_SYNC(inode))
return write_inode_now(inode, 1);

mark_inode_dirty(inode);

return 0;

free_clu:
Expand Down

0 comments on commit d7ed523

Please sign in to comment.