aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMing Lei <[email protected]>2021-10-25 10:54:26 +0800
committerJens Axboe <[email protected]>2021-11-02 14:43:12 -0600
commit00c5495c54f785beb0f6a34f7a3674d3ea0997d5 (patch)
tree6291fd387dabbb936239a97b9866fe175b5d1959
parent5a4b653655d554b5f51a5d2252882708c56a6f7e (diff)
zram: replace fsync_bdev with sync_blockdev
When calling fsync_bdev(), zram driver guarantees that the bdev won't be opened by anyone, then there can't be one active fs/superblock over the zram bdev, so replace fsync_bdev with sync_blockdev. Reviewed-by: Luis Chamberlain <[email protected]> Signed-off-by: Ming Lei <[email protected]> Acked-by: Minchan Kim <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jens Axboe <[email protected]>
-rw-r--r--drivers/block/zram/zram_drv.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/block/zram/zram_drv.c b/drivers/block/zram/zram_drv.c
index 2dfa3a396c7c..edc6bd640559 100644
--- a/drivers/block/zram/zram_drv.c
+++ b/drivers/block/zram/zram_drv.c
@@ -1790,7 +1790,7 @@ static ssize_t reset_store(struct device *dev,
mutex_unlock(&bdev->bd_disk->open_mutex);
/* Make sure all the pending I/O are finished */
- fsync_bdev(bdev);
+ sync_blockdev(bdev);
zram_reset_device(zram);
mutex_lock(&bdev->bd_disk->open_mutex);
@@ -1995,7 +1995,7 @@ static int zram_remove(struct zram *zram)
;
} else {
/* Make sure all the pending I/O are finished */
- fsync_bdev(bdev);
+ sync_blockdev(bdev);
zram_reset_device(zram);
}