Commit ae8fa2831bbc5092ee9d1b90e623af881cf27140

Authored by NeilBrown
1 parent ed9bfdf1a4

md: remove clumsy usage of do_sync_mapping_range from bitmap code

and replace with vfs_fsync which is much neater (but wasn't exported,
or even in existence at the time the code was written).

Cc: Christoph Hellwig <hch@lst.de>
Signed-off-by: NeilBrown <neilb@suse.de>

Showing 1 changed file with 5 additions and 4 deletions Side-by-side Diff

... ... @@ -1624,10 +1624,11 @@
1624 1624 bitmap->offset = mddev->bitmap_offset;
1625 1625 if (file) {
1626 1626 get_file(file);
1627   - do_sync_mapping_range(file->f_mapping, 0, LLONG_MAX,
1628   - SYNC_FILE_RANGE_WAIT_BEFORE |
1629   - SYNC_FILE_RANGE_WRITE |
1630   - SYNC_FILE_RANGE_WAIT_AFTER);
  1627 + /* As future accesses to this file will use bmap,
  1628 + * and bypass the page cache, we must sync the file
  1629 + * first.
  1630 + */
  1631 + vfs_fsync(file, file->f_dentry, 1);
1631 1632 }
1632 1633 /* read superblock from bitmap file (this sets bitmap->chunksize) */
1633 1634 err = bitmap_read_sb(bitmap);