[PATCH 0/1] hfsplus: skip unnecessary volume header sync

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



hfsplus_sync_fs always updates volume header information to disk with every
sync. Not only it causes extra writes to disk but also causes problem for
system tools trying to monitor disk activity to reduce power consumption,
by switching disk to low power mode. We also call hfsplus_sync_fs from
unmount, which is not required.

Test:
------
$ $ sudo mount -t hfsplus -o umask=0000 /dev/sdb1 /mnt/tmp
$ cat /proc/diskstats 
  8      17 sdb1 36289 138 291192 8857 1283 34862 288838 1114187 0 17196 1123002
$ sync
$ cat /proc/diskstats 
  8      17 sdb1 36289 138 291192 8857 1284 34862 288839 1114188 0 17197 1123003
$ sync
$ cat /proc/diskstats 
  8      17 sdb1 36289 138 291192 8857 1285 34862 288840 1114189 0 17198 1123004
$ sync
$ cat /proc/diskstats 
  8      17 sdb1 36289 138 291192 8857 1286 34862 288841 1114190 0 17198 1123004

We, can clearly see that field 5, 7 increasing without actually writing into the
volume.

Please Note:
-----------
hfsplus_sync_volume_header() is added to call from mount/unmount sequence,
since we just want to write the dirty/clean state to disk. For unmount,
hfsplus_sync_fs is already called from sync_filesystem(). For mount, it
gets called from delayed_sync_fs().

Also, there was a error in error propagation. It it also fixed in this patch.
-->snip<--
if (!error)
        error2 = error;
-->snap<--

The disk is only flushed if there was no error. Previously it was always flushed
without checking the error.

Sougata Santra (1):
  hfsplus: skip unnecessary volume header sync

 fs/hfsplus/super.c | 101 +++++++++++++++++++++++++++++++++++++++++------------
 1 file changed, 79 insertions(+), 22 deletions(-)



--
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]
  Powered by Linux