lkml.org 
[lkml]   [2022]   [Feb]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRE: [PATCH] exfat: do not clear VolumeDirty in writeback
Date
Hi, Yuezhang.

> And VolumeDirty will be set again when updating the parent directory. It means that BootSector will be written twice in
> each writeback, that will shorten the life of the device.

I have the same concern.
From a lifespan point of view, we should probably clear dirty with just sync_fs().

> sync_blockdev(sb->s_bdev);
> - if (exfat_clear_volume_dirty(sb))
> + if (__exfat_clear_volume_dirty(sb))

If SB_SYNCHRONOUS or SB_DIRSYNC is not present, isn't dirty cleared?

> +int exfat_clear_volume_dirty(struct super_block *sb) {
> + if (sb->s_flags & (SB_SYNCHRONOUS | SB_DIRSYNC))
> + return __exfat_clear_volume_dirty(sb);

Even when only one of SB or DIR is synced, dirty will be cleared.
Isn't it necessary to have both SB_SYNCHRONOUS and SB_DIRSYNC?
And, I think it would be better to use IS_SYNC or IS_DIRSYNC macro here.

BR


\
 
 \ /
  Last update: 2022-02-28 08:34    [W:0.230 / U:0.140 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site