Chao Yu c72db71ed6 f2fs: fix panic of IO alignment feature
Since 07173c3ec276 ("block: enable multipage bvecs"), one bio vector
can store multi pages, so that we can not calculate max IO size of
bio as PAGE_SIZE * bio->bi_max_vecs. However IO alignment feature of
f2fs always has that assumption, so finally, it may cause panic during
IO submission as below stack.

 kernel BUG at fs/f2fs/data.c:317!
 RIP: 0010:__submit_merged_bio+0x8b0/0x8c0
 Call Trace:
  f2fs_submit_page_write+0x3cd/0xdd0
  do_write_page+0x15d/0x360
  f2fs_outplace_write_data+0xd7/0x210
  f2fs_do_write_data_page+0x43b/0xf30
  __write_data_page+0xcf6/0x1140
  f2fs_write_cache_pages+0x3ba/0xb40
  f2fs_write_data_pages+0x3dd/0x8b0
  do_writepages+0xbb/0x1e0
  __writeback_single_inode+0xb6/0x800
  writeback_sb_inodes+0x441/0x910
  wb_writeback+0x261/0x650
  wb_workfn+0x1f9/0x7a0
  process_one_work+0x503/0x970
  worker_thread+0x7d/0x820
  kthread+0x1ad/0x210
  ret_from_fork+0x35/0x40

This patch adds one extra condition to check left space in bio while
trying merging page to bio, to avoid panic.

This bug was reported in bugzilla:

https://bugzilla.kernel.org/show_bug.cgi?id=204043

Signed-off-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
2019-08-23 07:57:10 -07:00
..
2019-07-18 11:05:25 -07:00
2019-07-17 09:55:43 -07:00
2019-06-20 09:23:22 +02:00
2019-05-31 11:13:10 +02:00
2019-07-15 20:18:40 -07:00
2019-07-11 18:11:21 -07:00
2019-07-08 09:54:55 -07:00
2019-07-19 17:13:56 -07:00
2019-07-18 14:32:33 -07:00
2019-07-12 15:13:55 -07:00
2019-07-18 09:12:34 -07:00
2019-07-08 18:55:42 -07:00
2019-07-10 09:00:57 -06:00
2019-05-14 19:52:50 -07:00
2019-07-01 08:18:54 -06:00
2019-04-09 17:05:46 -07:00
2019-05-07 08:39:02 -06:00
2019-03-07 12:20:11 -08:00
2019-07-15 21:20:52 -07:00
2019-06-12 20:27:13 +02:00
2019-07-18 09:49:30 +02:00
2019-07-27 08:25:51 -07:00
2019-06-24 10:23:16 +02:00
2019-07-17 09:55:43 -07:00
2019-02-28 03:28:53 -05:00
2019-06-12 20:30:39 +02:00
2019-02-28 08:24:23 -07:00
2019-07-23 13:59:33 -07:00
\n
2019-07-10 20:09:17 -07:00
2019-07-12 15:13:55 -07:00
2019-04-22 09:48:12 -06:00
2019-02-15 16:54:38 +01:00
2019-06-25 12:59:43 +10:00
2019-07-05 21:34:50 +02:00
2019-06-26 13:19:46 -07:00
2019-07-14 19:42:11 -07:00
2019-02-23 10:53:31 +01:00
2019-06-10 13:00:24 +02:00
2019-04-08 22:56:14 +02:00
2019-03-28 10:58:28 +01:00
2019-07-08 19:36:47 -07:00
2019-07-05 15:19:10 -07:00
2019-03-07 18:32:03 -08:00
2019-01-30 20:51:47 -05:00
2019-07-08 19:25:19 -07:00
2019-06-13 09:02:33 -04:00
2019-02-20 07:22:17 -07:00
2019-02-20 07:22:10 -07:00
2019-07-09 14:15:37 -07:00
2019-02-08 15:02:49 -08:00
2019-07-26 17:01:29 -06:00
2019-07-17 09:55:43 -07:00
2019-08-12 10:47:55 +02:00
2019-07-16 19:23:25 -07:00
2019-04-26 11:09:55 -07:00
2019-07-15 20:44:49 -07:00
2019-05-14 19:52:51 -07:00
2019-06-12 11:42:13 +02:00
2019-06-15 12:25:49 +02:00
2019-05-14 19:52:48 -07:00
2019-04-02 17:57:35 +02:00
2019-05-08 22:14:36 +02:00
2019-05-31 12:37:46 -07:00
2019-05-16 15:51:55 -07:00
2019-07-09 14:32:14 -06:00
2019-02-07 16:38:35 +01:00
2019-07-08 10:51:25 +02:00
2019-07-12 11:05:43 -07:00
2019-03-10 12:47:57 -07:00
2019-06-27 21:22:15 +08:00
2019-05-06 19:40:31 -07:00
2019-02-07 00:13:27 +01:00
2019-07-07 11:50:03 +02:00
2019-07-13 10:36:53 -07:00
2019-01-11 18:05:40 -08:00
2019-06-05 11:54:38 +02:00
2019-05-15 17:35:54 +01:00
2019-07-18 10:20:13 -06:00
2019-07-14 16:51:47 -07:00
2019-07-10 09:00:57 -06:00