Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp3542792ybl; Tue, 21 Jan 2020 02:44:12 -0800 (PST) X-Google-Smtp-Source: APXvYqy18v6Jclr2z40KBv8MkmkMmC0IT/fgPFAm02RpwuPb8JksCSbgQQ01xq1k2tsKzuOq02WV X-Received: by 2002:a9d:7696:: with SMTP id j22mr3290143otl.188.1579603452199; Tue, 21 Jan 2020 02:44:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579603452; cv=none; d=google.com; s=arc-20160816; b=Q4G0UOIswQVTFIKygoHunmAb/5jftQOlNkIpcLfk1fCHy9tBoPy9MD5zXaPKNiiiLD GmeDh9t0JMCQqWnammElJ/zaVHyXM2El8rpkxiYvjIb8w2114aq+UFxEmuUDLBeKz9DC dXXdLVo1MlOyaGACD9uDviFCvLgPxhmE1rvMTIrCtiqIXKJOryL0Jy5vPfSAQWo8L+ko el0eMoV1CQQoH8tgDl+BmPxnNi1AxHMEF2cfJq4ljef4o9Qgwo7494dz4vItiA899TIN YIM5Lx77zvGsruuPCQokzsPMteyuU2BMnGKtoCM1GOaL+K4DtRiGNvpodgIOkylrRq53 YTnQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:to:from:subject; bh=nWIRl6+N+mT20zH4Jt0j2rQmt4e34GSxWJXONz2ZsGo=; b=WhDo0xKXnj0xwG3BhX027g2k0k9jiONElR1Y5CgCJeQ17QtUyH3FjoSus+lef3fBfL PLM9oXOh4wbtfBnupiW2JxhTUZaorAPQXrCuXE4UaBhL3Z86WSZIUUVR09HKznqidpQL E6k/lFhdni+t+CjyE8q1i86H+dlL3g2vGcpHUxXl9zILZVy/VJvpsrVFjgRXd4fouEKk ax0odteWbmUEsu4NZauT1uRYYjvvR9TuGD7faOyqCVVefOe4QY53BafOixmnVBj96e4g bUYLb4VL7m/3AcjxFbO89ubTs+pYzs7SSUlNREgxJaEekOD82Xtsmo2qnnV6O7lxlwDs H7Qw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=virtuozzo.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i20si19070425oie.119.2020.01.21.02.44.00; Tue, 21 Jan 2020 02:44:12 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=virtuozzo.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729847AbgAUKm7 (ORCPT + 99 others); Tue, 21 Jan 2020 05:42:59 -0500 Received: from relay.sw.ru ([185.231.240.75]:57398 "EHLO relay.sw.ru" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729451AbgAUKm7 (ORCPT ); Tue, 21 Jan 2020 05:42:59 -0500 Received: from dhcp-172-16-24-104.sw.ru ([172.16.24.104] helo=localhost.localdomain) by relay.sw.ru with esmtp (Exim 4.92.3) (envelope-from ) id 1itqzl-0006Qk-6Q; Tue, 21 Jan 2020 13:42:53 +0300 Subject: [PATCH v4 6/7] dm: Directly disable max_allocate_sectors for now From: Kirill Tkhai To: linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, martin.petersen@oracle.com, bob.liu@oracle.com, axboe@kernel.dk, agk@redhat.com, snitzer@redhat.com, dm-devel@redhat.com, song@kernel.org, tytso@mit.edu, adilger.kernel@dilger.ca, Chaitanya.Kulkarni@wdc.com, darrick.wong@oracle.com, ming.lei@redhat.com, osandov@fb.com, jthumshirn@suse.de, minwoo.im.dev@gmail.com, damien.lemoal@wdc.com, andrea.parri@amarulasolutions.com, hare@suse.com, tj@kernel.org, ajay.joshi@wdc.com, sagi@grimberg.me, dsterba@suse.com, chaitanya.kulkarni@wdc.com, bvanassche@acm.org, dhowells@redhat.com, asml.silence@gmail.com, ktkhai@virtuozzo.com Date: Tue, 21 Jan 2020 13:42:52 +0300 Message-ID: <157960337238.108120.18048939587162465175.stgit@localhost.localdomain> In-Reply-To: <157960325642.108120.13626623438131044304.stgit@localhost.localdomain> References: <157960325642.108120.13626623438131044304.stgit@localhost.localdomain> User-Agent: StGit/0.19 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Since dm inherits limits from underlining block devices, this patch directly disables max_allocate_sectors for dm till full allocation support is implemented. This prevents high-level primitives (generic_make_request_checks(), __blkdev_issue_write_zeroes(), ...) from sending REQ_ALLOCATE requests. Signed-off-by: Kirill Tkhai --- drivers/md/dm-table.c | 2 ++ drivers/md/md.h | 1 + 2 files changed, 3 insertions(+) diff --git a/drivers/md/dm-table.c b/drivers/md/dm-table.c index 0a2cc197f62b..e245c0d882aa 100644 --- a/drivers/md/dm-table.c +++ b/drivers/md/dm-table.c @@ -489,6 +489,7 @@ static int dm_set_device_limits(struct dm_target *ti, struct dm_dev *dev, (unsigned long long) start << SECTOR_SHIFT); limits->zoned = blk_queue_zoned_model(q); + blk_queue_max_allocate_sectors(q, 0); return 0; } @@ -1548,6 +1549,7 @@ int dm_calculate_queue_limits(struct dm_table *table, dm_device_name(table->md), (unsigned long long) ti->begin, (unsigned long long) ti->len); + limits->max_allocate_sectors = 0; /* * FIXME: this should likely be moved to blk_stack_limits(), would diff --git a/drivers/md/md.h b/drivers/md/md.h index acd681939112..d9088122674d 100644 --- a/drivers/md/md.h +++ b/drivers/md/md.h @@ -798,5 +798,6 @@ static inline void mddev_check_write_zeroes(struct mddev *mddev, struct bio *bio if (bio_op(bio) == REQ_OP_WRITE_ZEROES && !bio->bi_disk->queue->limits.max_write_zeroes_sectors) mddev->queue->limits.max_write_zeroes_sectors = 0; + blk_queue_max_allocate_sectors(mddev->queue, 0); } #endif /* _MD_MD_H */