Received: by 2002:ab2:6309:0:b0:1fb:d597:ff75 with SMTP id s9csp1100631lqt; Fri, 7 Jun 2024 08:03:33 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXB4A/mEyh0ADMqRpCTH/xlUbccmO5ma1pWgI+LpjS06igGA9iNANXHVvNde8hlHSLkWAvVpUCdujxaF0br7rvc6vieAlby6MaiLtD1bg== X-Google-Smtp-Source: AGHT+IGDy2lRGwnfUO6zr88m1k9m4AmyN3HQ/ePP+0lKROIvPl9A7odo+k92vMubobQlHuzCsnyj X-Received: by 2002:a17:906:3753:b0:a68:cd1b:5926 with SMTP id a640c23a62f3a-a6cd7891928mr198795266b.40.1717772613289; Fri, 07 Jun 2024 08:03:33 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717772613; cv=pass; d=google.com; s=arc-20160816; b=OYERn6mF/VGnjcsM6nhlGGrS5xCDJhtfYFEg0B9xIdZ+hxJOFWP7qbsbsceDl1B5H/ BbDZbpiHAkkKN1olHkdf9AvZ6+yHKBmt8sFsQCXjiWwBWCdhlBw7QYXIzE6CgCZj62Gs oP42EZHoUsKboIwFRxilj7V3wOyZoXRVwG9QU/tlPKTc91bnDdof2BKTt7Wum/cNArAk QPM/myspBWNLpXfWFIDIfWxV8egseFk4aL4fLQzjqoiRq8e61sQWq5Li8BCAR89GdLaz 6CrDHzxams2luFc18hakUeZ2fsUzzN/aQZjnnPVGpOxAKYlII9CtWpKopu0Js1aSX0uT xEWg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=Si+AaspsxfVPlRl2lS+XF/iVPhaV4Y/0cfkhGRX9a7A=; fh=pqFiGWrwOnMOz7J5JEcls+uL5JrBxW7q4gBZg6HAuoA=; b=vcmy6kOhqxC6n5k++dqyj0XLwX7H/VC7uWmlgM56UtSxKNeGz/AgAuommT4GmjeZrU y0XN2U4gtGjTOqB8QAK5VPpOge2YdS3fcA1rK+WNLJQuR0LEgWx/c+ItZRBg9pOhDWh0 NVic5dE4/ueEw0AH2i4dsuG3N03GojIxDsUpQeE/5SLDsj7xHGLegwtmXyas3f0brMGI AcL5fHhsMAt6+1SLEWRDxHhTESslgEZ5mh4QwR4sWlTd+NK5VNr1YMjNf3DwdHdhqzfb e4Jx3bgeLy3YkqXgdAod4jJ7Fy+jCxZi3X09dRgfEcLg0Fu3PmZJ6NiKRBF9CYZVccRw IFrg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@pankajraghav.com header.s=MBO0001 header.b=ipibfMCc; arc=pass (i=1 spf=pass spfdomain=pankajraghav.com dkim=pass dkdomain=pankajraghav.com dmarc=pass fromdomain=pankajraghav.com); spf=pass (google.com: domain of linux-kernel+bounces-206336-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-206336-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=pankajraghav.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id a640c23a62f3a-a6c8058d987si196595166b.30.2024.06.07.08.03.33 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 07 Jun 2024 08:03:33 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-206336-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@pankajraghav.com header.s=MBO0001 header.b=ipibfMCc; arc=pass (i=1 spf=pass spfdomain=pankajraghav.com dkim=pass dkdomain=pankajraghav.com dmarc=pass fromdomain=pankajraghav.com); spf=pass (google.com: domain of linux-kernel+bounces-206336-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-206336-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=pankajraghav.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 07BE31F225C8 for ; Fri, 7 Jun 2024 15:03:33 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id DD85719E7C6; Fri, 7 Jun 2024 14:59:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=pankajraghav.com header.i=@pankajraghav.com header.b="ipibfMCc" Received: from mout-p-102.mailbox.org (mout-p-102.mailbox.org [80.241.56.152]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6DA0C19DF73; Fri, 7 Jun 2024 14:59:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=80.241.56.152 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717772392; cv=none; b=cNo/ld53edPWxvCkMASMlVPumf2omWFbpy4Abo4RHzsi1dLR9Kl5Wrj+uI6cmQboCUKnLeVQOL68nH6NgjoShiwzFhEsV3NiYt8Bab+CFf6+0XYhR0jwJEuiOQq6cOADnmjULbeZtFkP7cbtFF06+qNBEVOvtbF0fFgh+R5EVT4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717772392; c=relaxed/simple; bh=lryBDk3jbEQfMlK5kCYC8JLoqnCigGEH+zKdkVn9K8Q=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=dL1JpN7qFF5qbia0gzlTTWc51YNwdw9QeVVZ/TAJEt+nlCBJn+4i5x9slNvnRsHH49q6NfxFoBQ5t6tSrVofUmisI9ULZZ4dkCR7Vk1DUlogpENnGh2RqYRR3OAA82T14wBDYrbDyXRF2q6KPXsinTrSTyYONQzYFVN2BZRYhso= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=pankajraghav.com; spf=pass smtp.mailfrom=pankajraghav.com; dkim=pass (2048-bit key) header.d=pankajraghav.com header.i=@pankajraghav.com header.b=ipibfMCc; arc=none smtp.client-ip=80.241.56.152 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=pankajraghav.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=pankajraghav.com Received: from smtp102.mailbox.org (smtp102.mailbox.org [10.196.197.102]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-p-102.mailbox.org (Postfix) with ESMTPS id 4VwkrK5f8Nz9slT; Fri, 7 Jun 2024 16:59:45 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pankajraghav.com; s=MBO0001; t=1717772385; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Si+AaspsxfVPlRl2lS+XF/iVPhaV4Y/0cfkhGRX9a7A=; b=ipibfMCcjAJSHX3K3J8PQnqGVKt9ACztRTpPrEYNtUQOBwkE5tuUBCkJ1NEhEbAIgX22Vr 8ZMBlDyAlLQOlxff6A6gb3CGFCr3npI2926nhh457x12GrYZ+5vuQTGvfBhUCb4MVIJJFP 6vLHCY956wJpI3OyKxVjlkj4YSIjNNCH0fCKRrKsZYyqUMda22pbi2Ze9Q+TliKg51buIE IVZjdpD45TfZGSvWF/o2Gc8Ou37qiBGaO77XkcmPrdVh6uzxEQw7z4Vhmx7g1chNrifJ3B 58zwc4kj6LfNQ1u++f2ihUmK8wbv6GteLXO4JjZayvOkWS/rL6gskNB5XST9xg== From: "Pankaj Raghav (Samsung)" To: david@fromorbit.com, djwong@kernel.org, chandan.babu@oracle.com, brauner@kernel.org, akpm@linux-foundation.org, willy@infradead.org Cc: mcgrof@kernel.org, linux-mm@kvack.org, hare@suse.de, linux-kernel@vger.kernel.org, yang@os.amperecomputing.com, Zi Yan , linux-xfs@vger.kernel.org, p.raghav@samsung.com, linux-fsdevel@vger.kernel.org, kernel@pankajraghav.com, hch@lst.de, gost.dev@samsung.com, cl@os.amperecomputing.com, john.g.garry@oracle.com Subject: [PATCH v7 09/11] xfs: expose block size in stat Date: Fri, 7 Jun 2024 14:59:00 +0000 Message-ID: <20240607145902.1137853-10-kernel@pankajraghav.com> In-Reply-To: <20240607145902.1137853-1-kernel@pankajraghav.com> References: <20240607145902.1137853-1-kernel@pankajraghav.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: Pankaj Raghav For block size larger than page size, the unit of efficient IO is the block size, not the page size. Leaving stat() to report PAGE_SIZE as the block size causes test programs like fsx to issue illegal ranges for operations that require block size alignment (e.g. fallocate() insert range). Hence update the preferred IO size to reflect the block size in this case. This change is based on a patch originally from Dave Chinner.[1] [1] https://lwn.net/ml/linux-fsdevel/20181107063127.3902-16-david@fromorbit.com/ Reviewed-by: Darrick J. Wong Signed-off-by: Luis Chamberlain Signed-off-by: Pankaj Raghav --- fs/xfs/xfs_iops.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/xfs/xfs_iops.c b/fs/xfs/xfs_iops.c index ff222827e550..a7883303dee8 100644 --- a/fs/xfs/xfs_iops.c +++ b/fs/xfs/xfs_iops.c @@ -560,7 +560,7 @@ xfs_stat_blksize( return 1U << mp->m_allocsize_log; } - return PAGE_SIZE; + return max_t(uint32_t, PAGE_SIZE, mp->m_sb.sb_blocksize); } STATIC int -- 2.44.1