From: Linus Torvalds Date: Wed, 14 Dec 2016 17:07:36 +0000 (-0800) Subject: Merge tag 'for-f2fs-4.10' of git://git.kernel.org/pub/scm/linux/kernel/git/jaegeuk... X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=09cb6464fe5e7fcd5177911429badd139c4481b7;p=linux-beck.git Merge tag 'for-f2fs-4.10' of git://git.kernel.org/pub/scm/linux/kernel/git/jaegeuk/f2fs Pull f2fs updates from Jaegeuk Kim: "This patch series contains several performance tuning patches regarding to the IO submission flow, in addition to supporting new features such as a ZBC-base drive and multiple devices. It also includes some major bug fixes such as: - checkpoint version control - fdatasync-related roll-forward recovery routine - memory boundary or null-pointer access in corner cases - missing error cases It has various minor clean-up patches as well" * tag 'for-f2fs-4.10' of git://git.kernel.org/pub/scm/linux/kernel/git/jaegeuk/f2fs: (66 commits) f2fs: fix a missing size change in f2fs_setattr f2fs: fix to access nullified flush_cmd_control pointer f2fs: free meta pages if sanity check for ckpt is failed f2fs: detect wrong layout f2fs: call sync_fs when f2fs is idle Revert "f2fs: use percpu_counter for # of dirty pages in inode" f2fs: return AOP_WRITEPAGE_ACTIVATE for writepage f2fs: do not activate auto_recovery for fallocated i_size f2fs: fix to determine start_cp_addr by sbi->cur_cp_pack f2fs: fix 32-bit build f2fs: set ->owner for debugfs status file's file_operations f2fs: fix incorrect free inode count in ->statfs f2fs: drop duplicate header timer.h f2fs: fix wrong AUTO_RECOVER condition f2fs: do not recover i_size if it's valid f2fs: fix fdatasync f2fs: fix to account total free nid correctly f2fs: fix an infinite loop when flush nodes in cp f2fs: don't wait writeback for datas during checkpoint f2fs: fix wrong written_valid_blocks counting ... --- 09cb6464fe5e7fcd5177911429badd139c4481b7 diff --cc fs/f2fs/segment.c index f1b4a1775ebe,d7d5727fe8b2..0738f48293cc --- a/fs/f2fs/segment.c +++ b/fs/f2fs/segment.c @@@ -400,6 -404,33 +404,33 @@@ void f2fs_balance_fs_bg(struct f2fs_sb_ } } + static int __submit_flush_wait(struct block_device *bdev) + { + struct bio *bio = f2fs_bio_alloc(0); + int ret; + - bio_set_op_attrs(bio, REQ_OP_WRITE, WRITE_FLUSH); ++ bio->bi_opf = REQ_OP_WRITE | REQ_PREFLUSH; + bio->bi_bdev = bdev; + ret = submit_bio_wait(bio); + bio_put(bio); + return ret; + } + + static int submit_flush_wait(struct f2fs_sb_info *sbi) + { + int ret = __submit_flush_wait(sbi->sb->s_bdev); + int i; + + if (sbi->s_ndevs && !ret) { + for (i = 1; i < sbi->s_ndevs; i++) { + ret = __submit_flush_wait(FDEV(i).bdev); + if (ret) + break; + } + } + return ret; + } + static int issue_flush_thread(void *data) { struct f2fs_sb_info *sbi = data;