From patchwork Tue Sep 5 21:24:47 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Omar Sandoval X-Patchwork-Id: 9939629 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 291B660350 for ; Tue, 5 Sep 2017 21:25:04 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0E83328A11 for ; Tue, 5 Sep 2017 21:25:04 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id F359928A18; Tue, 5 Sep 2017 21:25:03 +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,DKIM_SIGNED, DKIM_VALID,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 70E3728A11 for ; Tue, 5 Sep 2017 21:25:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752717AbdIEVZC (ORCPT ); Tue, 5 Sep 2017 17:25:02 -0400 Received: from mail-pg0-f51.google.com ([74.125.83.51]:33806 "EHLO mail-pg0-f51.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752628AbdIEVZB (ORCPT ); Tue, 5 Sep 2017 17:25:01 -0400 Received: by mail-pg0-f51.google.com with SMTP id 63so2553876pgc.1 for ; Tue, 05 Sep 2017 14:25:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=osandov-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id; bh=ccwlMtdrnjQVJmcm3hiqq/+FAn8IwksXqIwktc8wnio=; b=ZZehLDx+EKRRJm07dV3SRmOCRJ3q9Df8ZxIWr5cYi8/Tk6cmzmRwwOFu+n4zhtltLm CuMDkURfuwSLtJUBe3IePUFnAYJzFjwTL/YQDBC64WarqEqtp/T4RHiU/btWVQ0qO9qt zqPZG6OYcPQ0H23TOPM7DIPZhIKGM9A4hdbYgc5Xrv7p1CXTqiXxhTM02L1opndnDLy4 N+VtbwRPo5fAhcej0CAZ0VRWxG7CwQpOTZXNusjrj7wEmx+aKM9tPTY8wY6TB+7/Hdyk Hp01JS49+tQAHLSUO9uc/Uypb1/C+fGgXfSD9yJ+nw9/GrLU/430s77qjmciHLzOK0U/ TBgQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=ccwlMtdrnjQVJmcm3hiqq/+FAn8IwksXqIwktc8wnio=; b=a5JhdlBuDq/YHa16aFNVJFMOBPiWujqvHKfRcZ6lTYvCzdOE7S6XvtvIypJ4EQqjwv kAjMTCWlfcRRWyDfi1JZSF3FKdEEMhrKFYpzKwS4WQFS+gicQhykSS4mz/nZ3IOwg9k1 ScDDI9ca84NfCyLUeqr05LFArZaMtItcpn0znTio6OejFlxmeLRE8E769/NcCMSSZelz cs7hC0c7Aw4qlwPPFe3UO7u4W8IFa1rlZCdEYT9EOP6osAGWKFNmULtjsOU8UUSB9K2k aZIvDSp12u1nsWXOlNfwhaHVS+7SjrUqVjQV8F8F6kTXEvuxc4v3KEBR1rMROnRilaC/ N0JA== X-Gm-Message-State: AHPjjUim/pO6ueMyx+4skETERKO6uc2pjQG01e+o3/eM6TOeQiXoVKRZ NbOyhzF0CssajqHQ6ycAdQ== X-Google-Smtp-Source: ADKCNb7tyNSQ/WjFoEoCePeT+dg5Md3nnjTdSXcsi8waPQyMBNBR2pSr2Sqli/FslxMaNCMMNMiZKQ== X-Received: by 10.84.194.131 with SMTP id h3mr5840151pld.204.1504646701017; Tue, 05 Sep 2017 14:25:01 -0700 (PDT) Received: from vader.thefacebook.com ([2620:10d:c090:200::7:4508]) by smtp.gmail.com with ESMTPSA id q14sm2183543pgq.54.2017.09.05.14.24.59 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 05 Sep 2017 14:25:00 -0700 (PDT) From: Omar Sandoval To: linux-block@vger.kernel.org Cc: kernel-team@fb.com, Hannes Reinecke , Ming Lei , Karel Zak , Milan Broz , Chandan Rajendra , Christoph Hellwig , linux-xfs@vger.kernel.org Subject: [PATCH] loop: set physical block size to logical block size Date: Tue, 5 Sep 2017 14:24:47 -0700 Message-Id: <8b3faca77b098c23827e48fc8f5b2ad973f3c23d.1504646604.git.osandov@fb.com> X-Mailer: git-send-email 2.14.1 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: Omar Sandoval Commit 6c6b6f28b333 ("loop: set physical block size to PAGE_SIZE") caused mkfs.xfs to barf on ppc64 [1]. Always using PAGE_SIZE as the physical block size still makes the most sense semantically, but let's just lie and always set it to the same value as the logical block size (same goes for io_min). In the future we might want to at least bump up io_min to PAGE_SIZE but I'm sick of these stupid changes so let's play it safe. 1: https://marc.info/?l=linux-xfs&m=150459024723753&w=2 Signed-off-by: Omar Sandoval Tested-by: Chandan Rajendra --- drivers/block/loop.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/block/loop.c b/drivers/block/loop.c index 78c47c4b584d..85de67334695 100644 --- a/drivers/block/loop.c +++ b/drivers/block/loop.c @@ -1036,6 +1036,8 @@ static int loop_clr_fd(struct loop_device *lo) memset(lo->lo_crypt_name, 0, LO_NAME_SIZE); memset(lo->lo_file_name, 0, LO_NAME_SIZE); blk_queue_logical_block_size(lo->lo_queue, 512); + blk_queue_physical_block_size(lo->lo_queue, 512); + blk_queue_io_min(lo->lo_queue, 512); if (bdev) { bdput(bdev); invalidate_bdev(bdev); @@ -1330,6 +1332,8 @@ static int loop_set_block_size(struct loop_device *lo, unsigned long arg) blk_mq_freeze_queue(lo->lo_queue); blk_queue_logical_block_size(lo->lo_queue, arg); + blk_queue_physical_block_size(lo->lo_queue, arg); + blk_queue_io_min(lo->lo_queue, arg); loop_update_dio(lo); blk_mq_unfreeze_queue(lo->lo_queue); @@ -1777,8 +1781,6 @@ static int loop_add(struct loop_device **l, int i) } lo->lo_queue->queuedata = lo; - blk_queue_physical_block_size(lo->lo_queue, PAGE_SIZE); - blk_queue_max_hw_sectors(lo->lo_queue, BLK_DEF_MAX_SECTORS); /*