Ilya Dryomov
4a4c6a0890
block: get rid of blk_integrity_revalidate()
...
commit 19b7ccf865 upstream.
Commit 25520d55cd ("block: Inline blk_integrity in struct gendisk")
introduced blk_integrity_revalidate(), which seems to assume ownership
of the stable pages flag and unilaterally clears it if no blk_integrity
profile is registered:
if (bi->profile)
disk->queue->backing_dev_info->capabilities |=
BDI_CAP_STABLE_WRITES;
else
disk->queue->backing_dev_info->capabilities &=
~BDI_CAP_STABLE_WRITES;
It's called from revalidate_disk() and rescan_partitions(), making it
impossible to enable stable pages for drivers that support partitions
and don't use blk_integrity: while the call in revalidate_disk() can be
trivially worked around (see zram, which doesn't support partitions and
hence gets away with zram_revalidate_disk()), rescan_partitions() can
be triggered from userspace at any time. This breaks rbd, where the
ceph messenger is responsible for generating/verifying CRCs.
Since blk_integrity_{un,}register() "must" be used for (un)registering
the integrity profile with the block layer, move BDI_CAP_STABLE_WRITES
setting there. This way drivers that call blk_integrity_register() and
use integrity infrastructure won't interfere with drivers that don't
but still want stable pages.
Fixes: 25520d55cd ("block: Inline blk_integrity in struct gendisk")
Cc: "Martin K. Petersen" <martin.petersen@oracle.com >
Cc: Christoph Hellwig <hch@lst.de >
Cc: Mike Snitzer <snitzer@redhat.com >
Tested-by: Dan Williams <dan.j.williams@intel.com >
Signed-off-by: Ilya Dryomov <idryomov@gmail.com >
[idryomov@gmail.com: backport to < 4.11: bdi is embedded in queue]
Signed-off-by: Jens Axboe <axboe@fb.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-05-14 13:32:59 +02:00
..
2016-08-10 11:49:24 +02:00
2017-02-18 16:39:26 +01:00
2017-03-15 09:57:15 +08:00
2015-10-21 18:05:50 -05:00
2015-10-20 18:10:25 +02:00
2016-10-28 03:01:34 -04:00
2017-03-15 09:57:14 +08:00
2016-10-16 17:36:14 +02:00
2015-12-08 12:42:44 -05:00
2016-08-20 18:09:25 +02:00
2016-09-24 10:07:42 +02:00
2017-05-08 07:46:01 +02:00
2016-06-24 10:18:24 -07:00
2015-10-27 11:24:23 +01:00
2016-04-12 09:08:32 -07:00
2015-12-07 14:14:03 -05:00
2015-11-10 15:00:03 -08:00
2015-11-10 14:48:36 -08:00
2017-02-01 08:30:53 +01:00
2017-05-14 13:32:56 +02:00
2016-09-07 08:32:45 +02:00
2016-03-09 15:34:52 -08:00
2015-11-03 17:22:17 -08:00
2015-11-04 08:23:51 -05:00
2016-08-20 18:09:24 +02:00
2016-08-20 18:09:24 +02:00
2016-08-20 18:09:24 +02:00
2015-12-09 10:35:16 -08:00
2015-11-11 09:37:34 -07:00
2015-10-27 15:04:56 +09:00
2015-11-07 10:40:47 -07:00
2016-09-15 08:27:47 +02:00
2016-07-11 09:31:11 -07:00
2015-11-11 02:19:33 -05:00
2017-01-12 11:22:50 +01:00
2016-05-04 14:48:49 -07:00
2017-04-21 09:30:04 +02:00
2016-05-11 11:21:11 +02:00
2015-10-23 17:55:10 +09:00
2015-11-05 19:34:48 -08:00
2016-12-08 07:15:24 +01:00
2016-02-25 12:01:16 -08:00
2015-11-20 16:17:32 -08:00
2016-02-17 12:30:57 -08:00
2015-11-10 12:06:23 +01:00
2016-12-15 08:49:23 -08:00
2015-12-02 23:50:33 +01:00
2017-02-14 15:22:51 -08:00
2016-05-04 14:48:49 -07:00
2017-01-12 11:22:50 +01:00
2016-07-27 09:47:33 -07:00
2017-03-22 12:04:15 +01:00
2015-11-02 13:14:44 -08:00
2016-10-28 03:01:26 -04:00
2016-04-12 09:08:39 -07:00
2016-08-16 09:30:49 +02:00
2015-10-23 17:55:10 +09:00
2015-11-06 17:50:42 -08:00
2015-11-18 16:27:46 -05:00
2015-11-04 21:50:37 -08:00
2016-03-03 15:07:09 -08:00
2015-12-11 11:05:57 -08:00
2017-05-14 13:32:59 +02:00
2015-11-10 09:33:06 -08:00
2015-10-31 16:12:10 -07:00
2015-10-30 01:47:27 -04:00
2016-11-21 10:06:40 +01:00
2016-10-22 12:26:56 +02:00
2016-09-30 10:18:37 +02:00
2016-01-07 12:17:39 -05:00
2015-11-04 18:10:13 -08:00
2017-05-14 13:32:59 +02:00
2015-11-20 16:17:32 -08:00
2016-05-11 11:21:13 +02:00
2015-11-05 09:51:50 -08:00
2015-11-09 15:11:24 -08:00
2016-02-17 12:30:57 -08:00
2015-11-06 17:50:42 -08:00
2015-11-05 19:34:48 -08:00
2016-03-03 15:07:16 -08:00
2015-10-20 17:47:45 +02:00
2016-09-07 08:32:44 +02:00
2016-04-20 15:42:02 +09:00
2015-10-23 05:44:28 -07:00
2015-11-05 14:51:32 -08:00
2017-03-12 06:37:25 +01:00
2015-10-27 08:36:08 +09:00
2015-11-04 11:30:57 -08:00
2015-10-22 00:00:49 +02:00
2015-12-02 23:37:16 -05:00
2016-09-24 10:07:43 +02:00
2015-10-30 10:13:26 +01:00
2017-01-19 20:17:19 +01:00
2016-07-27 09:47:29 -07:00
2015-11-09 15:11:24 -08:00
2016-10-28 03:01:30 -04:00
2015-10-21 15:18:36 +01:00
2015-10-21 15:18:36 +01:00
2015-12-12 10:15:34 -08:00
2015-11-28 19:33:29 -08:00
2017-04-08 09:53:32 +02:00
2015-10-26 09:10:56 +01:00
2016-03-09 15:34:52 -08:00
2017-03-18 19:09:58 +08:00
2016-10-28 03:01:32 -04:00
2015-11-23 09:44:58 +01:00
2017-03-26 12:13:18 +02:00
2015-11-17 15:25:43 -05:00
2015-11-10 12:06:16 +01:00
2015-11-05 19:34:48 -08:00
2016-08-16 09:30:51 +02:00
2017-02-09 08:02:47 +01:00
2015-10-27 18:55:31 -07:00
2017-01-06 11:16:11 +01:00
2016-10-20 10:00:47 +02:00
2015-12-18 14:25:40 -08:00
2015-11-06 17:50:42 -08:00
2015-11-06 11:04:07 -08:00
2016-03-09 15:34:56 -08:00
2015-11-06 17:50:42 -08:00
2017-04-30 05:49:28 +02:00
2015-10-20 22:10:45 +08:00
2016-11-15 07:46:37 +01:00
2016-11-15 07:46:37 +01:00
2016-09-07 08:32:38 +02:00
2016-07-11 09:31:11 -07:00
2015-11-03 11:29:57 -05:00
2017-02-18 16:39:27 +01:00
2015-11-06 19:33:12 +01:00
2017-02-01 08:30:53 +01:00
2016-03-03 15:07:28 -08:00
2015-11-23 21:57:44 -05:00
2015-11-05 19:34:48 -08:00
2016-10-07 15:23:41 +02:00
2015-11-10 17:27:12 -06:00
2015-11-16 09:03:21 +05:30
2015-12-09 09:23:28 -06:00
2015-11-12 11:50:33 -08:00
2015-11-10 17:27:12 -06:00
2015-10-28 10:05:58 -07:00
2015-11-05 19:34:48 -08:00
2015-11-06 17:50:42 -08:00
2015-11-06 17:50:42 -08:00
2016-09-30 10:18:37 +02:00
2016-09-07 08:32:37 +02:00
2016-12-08 07:15:24 +01:00
2017-02-09 08:02:46 +01:00
2016-09-15 08:27:46 +02:00
2015-10-23 05:57:43 -07:00
2016-06-07 18:14:35 -07:00
2015-10-28 04:33:04 +01:00
2016-10-31 04:13:58 -06:00
2015-10-21 14:46:56 -06:00
2015-11-07 01:29:22 +01:00
2015-11-23 09:44:58 +01:00
2015-10-22 08:59:18 -07:00
2015-11-03 11:08:22 -05:00
2017-01-06 11:16:11 +01:00
2016-11-10 16:36:37 +01:00
2015-10-30 11:18:05 +09:00
2016-02-25 12:01:23 -08:00
2015-11-06 17:50:42 -08:00
2015-12-04 14:38:26 -05:00
2015-11-02 14:23:38 -05:00
2016-02-25 12:01:21 -08:00
2017-04-21 09:30:04 +02:00
2015-11-19 16:22:43 +01:00
2015-10-27 19:55:13 -07:00
2016-10-28 03:01:32 -04:00
2016-09-07 08:32:44 +02:00
2016-03-03 15:07:23 -08:00
2016-06-01 12:15:54 -07:00
2016-07-27 09:47:31 -07:00
2015-11-22 11:58:44 -08:00
2016-09-30 10:18:37 +02:00
2015-10-20 10:23:55 +02:00
2016-07-11 09:31:11 -07:00
2015-12-12 10:15:34 -08:00
2016-10-28 03:01:30 -04:00
2015-10-26 10:11:58 +09:00
2016-10-28 03:01:34 -04:00
2015-11-25 15:49:13 +00:00
2016-10-07 15:23:46 +02:00
2015-11-13 21:53:18 -08:00
2015-10-21 14:42:38 -06:00
2017-02-04 09:45:08 +01:00
2016-04-12 09:08:35 -07:00
2016-09-15 08:27:47 +02:00
2016-03-09 15:34:52 -08:00
2015-11-05 19:34:48 -08:00
2016-03-16 08:42:58 -07:00
2016-06-01 12:15:52 -07:00
2015-11-25 15:49:13 +00:00
2015-11-05 19:34:48 -08:00
2016-03-03 15:07:08 -08:00
2016-12-10 19:07:25 +01:00
2015-11-23 09:44:58 +01:00
2016-04-20 15:42:07 +09:00
2017-03-26 12:13:16 +02:00
2015-12-04 08:38:42 -07:00
2015-11-05 11:07:36 +10:00
2015-11-05 19:34:48 -08:00
2015-11-01 17:09:15 -08:00
2015-12-29 17:45:49 -08:00
2015-12-13 14:30:59 -08:00
2015-11-03 20:46:26 +01:00
2016-03-09 15:34:52 -08:00
2015-11-13 20:34:33 -05:00
2015-11-06 17:50:42 -08:00
2015-11-06 17:50:42 -08:00
2015-11-06 17:50:42 -08:00