Linux filesystem development
 help / color / mirror / Atom feed
* [PATCH 0/1] hfsplus: skip unnecessary volume header sync
@ 2014-07-17 16:30 Sougata Santra
  0 siblings, 0 replies; only message in thread
From: Sougata Santra @ 2014-07-17 16:30 UTC (permalink / raw)
  To: Andrew Morton
  Cc: hch, linux-fsdevel, Vyacheslav Dubeyko, Sougata Santra,
	Fabian Frederick


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(-)




^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2014-07-17 16:35 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-07-17 16:30 [PATCH 0/1] hfsplus: skip unnecessary volume header sync Sougata Santra

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox