Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp326435pxu; Fri, 23 Oct 2020 01:33:40 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzP3/ywXJiajsm5/0ihC0Bo1caFYHlnF12LAJLF33TlZ1kNBz0KYxOZZPzDoMBg1OwhtzJd X-Received: by 2002:a17:906:354c:: with SMTP id s12mr917471eja.263.1603442020163; Fri, 23 Oct 2020 01:33:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603442020; cv=none; d=google.com; s=arc-20160816; b=rl+HktU59NmLdJ92Wg8XKPT2U7KLYJAvG2IevFX7HRqyZ2q94Qj33TgvsGdeSdXi6l Jcv6V4c2oyYCz4sOU95PuRUOohu0AKF0+0UPDxEKMO54TyTwz1fHq9moV4UB7HovQlKa 6PqCRAL8xaNoHgFuDt8K3lvZnwnTkf3usWf7DXYSkqJA0XV8pCgWDUdoBHUV/KB/080s P1UL0fn6lQZsh+b7z5sLj1ir31haz/IrX/TIU1079StUu+jksxyd9JGrs40CqngsCpQR kv5lf1Mp0uqr8o6BGt5SqMWVQiy2JBFeHCgGugM+zo+tsmlWgciUjI9YbagN+dWCqVzk 7tQQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=5aZPshIdzYGdOyeUaVThuatYClUPIqWMANiMs5m6ywA=; b=mBTZt7c3zizXR8OhKhDueQmTrfK3ePM3haEXoKRGD5Ea4nQ2cNuxIdkr20EN3gaksS K5803L8/z4N9VHATosaeBzt++nyNB9nzBP3/vgsujAbbNov5DYQLDvOVwsGNMqbhOj9w e35GnotKE4fztYqfT8g4/joTq+wDj5E2uJmeFi/ugLOyBkl/jYrtr+WP0/5oNAsatyzO 1B6M0lwa3xre+34hH2xPHuw7iwRybgUY8uo6tbzFtC3McyJ/tKwKPNZkWVJyW8Cjyov0 DU9mTYvX2YuBZNhdQ727Rt4VBMYtC/2ubZy+zGzhYW1/BybDsNpZGiWhEcxTD/QneZLu XBYA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=r3jTgQk+; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id gz9si417965ejb.203.2020.10.23.01.33.18; Fri, 23 Oct 2020 01:33:40 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=r3jTgQk+; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S460459AbgJWI3a (ORCPT + 99 others); Fri, 23 Oct 2020 04:29:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58366 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S375737AbgJWI33 (ORCPT ); Fri, 23 Oct 2020 04:29:29 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8AC4AC0613CE; Fri, 23 Oct 2020 01:29:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=5aZPshIdzYGdOyeUaVThuatYClUPIqWMANiMs5m6ywA=; b=r3jTgQk+GfQ6Hx0b/c0vTrdVhN 9uGnyvOKocl2KWwpmv/Xi+BPfdgpjfav5jCSdAnMDUVBLEhCjI81pSsId/BZEQoLeGku+SksbPy7Q LJY47mE+ptCJfWTKM/HV7SzJrj383ul1bpZsVzUovCsvw7dCwZFOQ6qgNN/VKJGyhCupMGJ5I6/74 A+D62bGn/9uUbIkrO6n8cPO8xblOSYq0U3NbjkxCJcji1ygq396b9Fo59eTPiNOA7CJvCTyLjlBaO 3DldTbrN6kkO3UpAwqf1bQMLRaxXn5PLqRvKh+UqWU5jpU6Bg/3oC2h6QipENF1uqGTGqKVE113Kp yyzQ+dhw==; Received: from hch by casper.infradead.org with local (Exim 4.92.3 #3 (Red Hat Linux)) id 1kVsRz-00044z-Pb; Fri, 23 Oct 2020 08:29:27 +0000 Date: Fri, 23 Oct 2020 09:29:27 +0100 From: Christoph Hellwig To: Christopher Unkel Cc: linux-raid@vger.kernel.org, linux-kernel@vger.kernel.org, Song Liu Subject: Re: [PATCH 1/3] md: align superblock writes to physical blocks Message-ID: <20201023082927.GA15144@infradead.org> References: <20201023033130.11354-1-cunkel@drivescale.com> <20201023033130.11354-2-cunkel@drivescale.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20201023033130.11354-2-cunkel@drivescale.com> X-SRS-Rewrite: SMTP reverse-path rewritten from by casper.infradead.org. See http://www.infradead.org/rpr.html Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > + /* Respect physical block size if feasible. */ > + bmask = queue_physical_block_size(rdev->bdev->bd_disk->queue)-1; > + if (!((rdev->sb_start * 512) & bmask) && (rdev->sb_size & bmask)) { > + int candidate_size = (rdev->sb_size | bmask) + 1; > + > + if (minor_version) { > + int sectors = candidate_size / 512; > + > + if (rdev->data_offset >= sb_start + sectors > + && rdev->new_data_offset >= sb_start + sectors) Linux coding style wants operators before the continuing line. > + rdev->sb_size = candidate_size; > + } else if (bmask <= 4095) > + rdev->sb_size = candidate_size; > + } I also think this code would benefit from being factored into a helper.