From patchwork Wed Oct 4 13:55:07 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Goldwyn Rodrigues X-Patchwork-Id: 9984775 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id A864360237 for ; Wed, 4 Oct 2017 13:55:30 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9D50728633 for ; Wed, 4 Oct 2017 13:55:30 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9242528770; Wed, 4 Oct 2017 13:55:30 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2D56928633 for ; Wed, 4 Oct 2017 13:55:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752255AbdJDNz3 (ORCPT ); Wed, 4 Oct 2017 09:55:29 -0400 Received: from mx2.suse.de ([195.135.220.15]:33887 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752231AbdJDNz3 (ORCPT ); Wed, 4 Oct 2017 09:55:29 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 21B88ADD8; Wed, 4 Oct 2017 13:55:28 +0000 (UTC) From: Goldwyn Rodrigues To: linux-block@vger.kernel.org Cc: axboe@kernel.dk, shli@kernel.org, Goldwyn Rodrigues Subject: [PATCH 5/9] md: raid5 nowait support Date: Wed, 4 Oct 2017 08:55:07 -0500 Message-Id: <20171004135511.26110-6-rgoldwyn@suse.de> X-Mailer: git-send-email 2.14.2 In-Reply-To: <20171004135511.26110-1-rgoldwyn@suse.de> References: <20171004135511.26110-1-rgoldwyn@suse.de> Sender: linux-block-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Goldwyn Rodrigues Return EAGAIN in case RAID5 would block because of waiting due to reshaping. Signed-off-by: Goldwyn Rodrigues --- drivers/md/raid5.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c index 928e24a07133..707a3907d100 100644 --- a/drivers/md/raid5.c +++ b/drivers/md/raid5.c @@ -5601,6 +5601,13 @@ static bool raid5_make_request(struct mddev *mddev, struct bio * bi) last_sector = bio_end_sector(bi); bi->bi_next = NULL; + if ((bi->bi_opf & REQ_NOWAIT) && + conf->reshape_progress != MaxSector && + (mddev->reshape_backwards ? logical_sector < conf->reshape_safe : last_sector >= conf->reshape_safe)) { + bio_wouldblock_error(bi); + return true; + } + prepare_to_wait(&conf->wait_for_overlap, &w, TASK_UNINTERRUPTIBLE); for (;logical_sector < last_sector; logical_sector += STRIPE_SECTORS) { int previous;