Skip to content

Commit d7ed523

Browse files
YuezhangMonamjaejeon
authored andcommitted
exfat: fix timing of synchronizing bitmap and inode
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 <[email protected]> Signed-off-by: Namjae Jeon <[email protected]>
1 parent 4cece76 commit d7ed523

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

fs/exfat/file.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ static int exfat_cont_expand(struct inode *inode, loff_t size)
5151
clu.flags = ei->flags;
5252

5353
ret = exfat_alloc_cluster(inode, new_num_clusters - num_clusters,
54-
&clu, IS_DIRSYNC(inode));
54+
&clu, inode_needs_sync(inode));
5555
if (ret)
5656
return ret;
5757

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

81-
if (IS_DIRSYNC(inode))
82+
if (IS_SYNC(inode))
8283
return write_inode_now(inode, 1);
8384

84-
mark_inode_dirty(inode);
85-
8685
return 0;
8786

8887
free_clu:

0 commit comments

Comments
 (0)