aboutsummaryrefslogtreecommitdiff
path: root/block/blk-settings.c
diff options
context:
space:
mode:
Diffstat (limited to 'block/blk-settings.c')
-rw-r--r--block/blk-settings.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/block/blk-settings.c b/block/blk-settings.c
index 536ee202fcdc..bf4622c19b5c 100644
--- a/block/blk-settings.c
+++ b/block/blk-settings.c
@@ -459,6 +459,15 @@ int blk_stack_limits(struct queue_limits *t, struct queue_limits *b,
t->features |= (b->features & BLK_FEAT_INHERIT_MASK);
+ /*
+ * BLK_FEAT_NOWAIT needs to be supported both by the stacking driver
+ * and all underlying devices. The stacking driver sets the flag
+ * before stacking the limits, and this will clear the flag if any
+ * of the underlying devices does not support it.
+ */
+ if (!(b->features & BLK_FEAT_NOWAIT))
+ t->features &= ~BLK_FEAT_NOWAIT;
+
t->max_sectors = min_not_zero(t->max_sectors, b->max_sectors);
t->max_user_sectors = min_not_zero(t->max_user_sectors,
b->max_user_sectors);