]> git.baikalelectronics.ru Git - kernel.git/commit
mtd: mtdblock: call mtd_sync() only if opened for write
authorAlexander Stein <alexander.stein@systec-electronic.com>
Tue, 10 Jan 2012 12:26:58 +0000 (13:26 +0100)
committerDavid Woodhouse <David.Woodhouse@intel.com>
Mon, 26 Mar 2012 23:11:11 +0000 (00:11 +0100)
commitc847e72ec12e4e8447853ef043ca52493e6d551b
tree288f6f9cdb1866ea9648c6590448254c40af2c81
parentea2121bc823a866deaeaafddf952d27c22dda732
mtd: mtdblock: call mtd_sync() only if opened for write

Because it is useless to call it if the device is opened in R/O mode, and also
harmful: on CFI NOR flash it may block for long time waiting for erase
operations to complete is another partition with a R/W file-system on this
chip.

Artem Bityutskiy: write commit message, amend the patch to match the latest
tree (we use mtd_sync(), not mtd->sync() nowadays).

Signed-off-by: Alexander Stein <alexander.stein@systec-electronic.com>
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
drivers/mtd/mtd_blkdevs.c
drivers/mtd/mtdblock.c
include/linux/mtd/blktrans.h