fstab: use fsync_mode=nobarrier

This patch proposes to skip FLUSH commands for UFS when fsync(2) for non-atomic
files is called.

== Pros ==
 - huge gain on random write/fsync test from 30MB/s to 90MB/s
   (e.g., Androbench)
 - extented flash lifetime
   (FLUSH command requires for FTL to write its metadata)

== Cons ==
In terms of stability,
1) checkpoint issues FLUSH, so this doesn't hurt F2FS consistency.
2) atomic write issues FLUSH, so SQLite w/ journal mode would be safe.
3) non-atomic fsync() doesn't issue FLUSH, so there is one scenario to consider
   a. fsync() flushes data blocks to disk, and then node blocks. The last node
      block contains a flag as the candidate for roll-forward recovery.
   b. assuming that storage is able to flush disk cache in out-of-order manner,
      all the cached node blocks are written to the flash cell, followed by all
      the data blocks.
   c. cut power
   d. F2FS conducts roll-back to the last checkpoint w/o risk. Then, it starts
      roll-forward recovery which traverses the node block chain and finds node
      blocks written by b. lastly.
   e. After mount, user can see old or zero data from the recovered node blocks.

Three points persuaded me to go with this:
1) In the above scenario, it won't hurt filesystem consistency.
2) Generally, firmware in embedded UFS/eMMC doesn't do out-of-order writes,
   since it doesn't have large cache to reorder write IOs likewise SSDs.
3) It'd be okay to lose the last-called fsync() due to power-cut, since users
   won't be aware of it mostly.

Bug: 34123235
Change-Id: Ieb163de5136a621d379dd5bcd762b4307b8dd46f
Signed-off-by: Jaegeuk Kim <jaegeuk@google.com>
diff --git a/fstab.hardware b/fstab.hardware
index a6a11d9..6138f7a 100644
--- a/fstab.hardware
+++ b/fstab.hardware
@@ -3,7 +3,7 @@
 #<src>                                              <mnt_point>        <type>      <mnt_flags and options>                               <fs_mgr_flags>
 /dev/block/bootdevice/by-name/system                /                  ext4        ro,barrier=1                                          wait,slotselect,avb
 /dev/block/bootdevice/by-name/metadata              /metadata          ext4        noatime,nosuid,nodev,discard                          wait,check,formattable
-/dev/block/bootdevice/by-name/userdata              /data              f2fs        noatime,nosuid,nodev,discard,reserve_root=32768,resgid=1065       latemount,wait,check,fileencryption=ice,keydirectory=/metadata/vold/metadata_encryption,quota,formattable,sysfs_path=/sys/devices/platform/soc/1d84000.ufshc,reservedsize=128M
+/dev/block/bootdevice/by-name/userdata              /data              f2fs        noatime,nosuid,nodev,discard,reserve_root=32768,resgid=1065,fsync_mode=nobarrier       latemount,wait,check,fileencryption=ice,keydirectory=/metadata/vold/metadata_encryption,quota,formattable,sysfs_path=/sys/devices/platform/soc/1d84000.ufshc,reservedsize=128M
 /dev/block/bootdevice/by-name/misc                  /misc              emmc        defaults                                              defaults
 /dev/block/bootdevice/by-name/modem                 /firmware          vfat        ro,shortname=lower,uid=1000,gid=1000,dmask=227,fmask=337,context=u:object_r:firmware_file:s0   wait,slotselect
 /devices/platform/soc/a600000.ssusb/a600000.dwc3*   auto               vfat        defaults                                              voldmanaged=usb:auto