From patchwork Thu Aug 11 03:44:53 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Wheeler X-Patchwork-Id: 9274417 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 98D7660231 for ; Thu, 11 Aug 2016 03:45:50 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7AEBA284DA for ; Thu, 11 Aug 2016 03:45:50 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6AC2C284DD; Thu, 11 Aug 2016 03:45:50 +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 DDC54284DA for ; Thu, 11 Aug 2016 03:45:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932407AbcHKDps (ORCPT ); Wed, 10 Aug 2016 23:45:48 -0400 Received: from mx.ewheeler.net ([66.155.3.69]:45677 "EHLO mail.ewheeler.net" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S932291AbcHKDpr (ORCPT ); Wed, 10 Aug 2016 23:45:47 -0400 Received: from localhost (localhost [127.0.0.1]) by mail.ewheeler.net (Postfix) with ESMTP id 913E3A0C51; Wed, 10 Aug 2016 20:44:54 -0700 (PDT) X-Virus-Scanned: amavisd-new at ewheeler.net Received: from mail.ewheeler.net ([127.0.0.1]) by localhost (mail.ewheeler.net [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 7msLN_3zJC0U; Wed, 10 Aug 2016 20:44:53 -0700 (PDT) Received: from mx.ewheeler.net (mx.ewheeler.net [66.155.3.69]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.ewheeler.net (Postfix) with ESMTPSA id CC350A0C50; Wed, 10 Aug 2016 20:44:53 -0700 (PDT) Date: Wed, 10 Aug 2016 20:44:53 -0700 (PDT) From: Eric Wheeler X-X-Sender: lists@mail.ewheeler.net To: Shaohua Li , Ming Lei , linux-bcache@vger.kernel.org, linux-raid@vger.kernel.org, Ming Lin , Vlad-Cosmin Miu , rjones@redhat.com, Kent Overstreet , jmoyer@redhat.com, axboe@fb.com, Sebastian Roesner , linux-block@vger.kernel.org Subject: [PATCH] NULL pointer in raid1_make_request passed to bio_trim when adding md as bcache caching dev Message-ID: User-Agent: Alpine 2.11 (LRH 23 2013-08-11) MIME-Version: 1.0 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 On Sun, 10 Apr 2016 20:01:30 +0200, Sebastian Roesner wrote: > Am 01.04.2016 um 20:14 schrieb Eric Wheeler: > > On Mon, 28 Mar 2016, Shaohua Li wrote: > > > On Sat, Mar 26, 2016 at 05:46:16PM +0100, Sebastian Roesner wrote: > > > > Hello Ming, Eric, > > > > > > > > Am 26.03.2016 um 16:40 schrieb Ming Lei: > > > > I was able to reproduce it on a non-productive system, but only after > > > > copying the bcache superblocks/partition starts from the original system, > > > > with new created ones it worked fine. > > > > > > 320 bvecs exceeds what bio-clone_set can handle. Could you please try below patch? > > > > > Hey Sebastian, > > > > Have you had a chance to test the patch below from Shaohua Li? > > I just tried the patch and it did not crash anymore. Hello all, It doesn't look like this made it into v4.8-rc1 and it is known to fix at least Sebastian's issue. Can this get into v4.8? --- Eric Wheeler commit 92761dad7ff6e1bf25de247e0064dd398e797599 Author: Shaohua Li Date: Mon Mar 28 10:54:35 2016 -0700 block: don't make BLK_DEF_MAX_SECTORS too big bio_alloc_bioset() allocates bvecs from bvec_slabs which can only allocate maximum 256 bvec (eg, 1M for 4k pages). We can't bump BLK_DEF_MAX_SECTORS to exceed this value otherwise bio_alloc_bioset will fail. This fixes commit 30e2bc08b2bb7c069. We probably should make the bvec_slabs hold bigger bvecs if bigger bio size is required. Signed-off-by: Shaohua Li -- To unsubscribe from this list: send the line "unsubscribe linux-bcache" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html -- To unsubscribe from this list: send the line "unsubscribe linux-block" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h index 7e5d7e0..da64325 100644 --- a/include/linux/blkdev.h +++ b/include/linux/blkdev.h @@ -1153,7 +1153,11 @@ extern int blk_verify_command(unsigned char *cmd, fmode_t has_write_perm); enum blk_default_limits { BLK_MAX_SEGMENTS = 128, BLK_SAFE_MAX_SECTORS = 255, - BLK_DEF_MAX_SECTORS = 2560, + /* + * if you change this, please also change bvec_alloc and BIO_MAX_PAGES. + * Otherwise bio_alloc_bioset will break. + */ + BLK_DEF_MAX_SECTORS = BIO_MAX_SECTORS, BLK_MAX_SEGMENT_SIZE = 65536, BLK_SEG_BOUNDARY_MASK = 0xFFFFFFFFUL, };