Received: by 2002:ab2:2994:0:b0:1ef:ca3e:3cd5 with SMTP id n20csp107356lqb; Thu, 14 Mar 2024 06:47:19 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUF8Yay9lZ6RQcAyYCEdMSwzM9/Iv90tD0Vj5IlLkmAfhLcZufOXjyZjT6A7KORiSQdP2rfFy1mFHemWTAUF17KIzw9q5kxH5Xo/g4Dtg== X-Google-Smtp-Source: AGHT+IF7AIp1E0uSyp5tRkN0WOS3Ar/UHcQvCOo9WhgSqNqzbyDRUvcCp1k2pbWAYlxRir32vteD X-Received: by 2002:a05:622a:1916:b0:430:a087:7a53 with SMTP id w22-20020a05622a191600b00430a0877a53mr1174968qtc.68.1710424038712; Thu, 14 Mar 2024 06:47:18 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1710424038; cv=pass; d=google.com; s=arc-20160816; b=B+G9kXDEM/2zyDNjEv7lRNaiqLkeGp6LN8FKeOSMEv51abqsws4EHm0HeaYS+I3Vqb zRDKOkLTWxYILZC7pvNBWm3xBr18swCMM3GpDuhIRsWXD9qPbwL52ltnheO/Sz5JDUv4 qmKs+VkzxNxaN9hyP5mDXVC5HUwosMHNN/uc1uVjLXljrfhNpmZiZZIP6BtGB8iQjMup TF2q9tG9IAB7HCFr5klAcQ2WWXaemzODL3lv3S3GmQ56cEMblLqc3XxdTW3UVNR0iGqv mBBEzrt+33ya8nugRkuus+ZKolyusSw+qPCzAVigBxgP8T3IWcK3zXML0w0BxkF5T8Tx ZXuA== 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=hTTuIiANd5kCHMpVIcnhOGjU1SgMYOpCUNpWo+aN5OQ=; fh=j3uz2NgZFfq57/Snoylk35aIHaL6SCDmmQDWQGY3sTA=; b=FZLN3zP6LbqGUUmmwsYeFFfMG8klfvtPO5UCHUbbMm3L+X3pLE0OMcA5NWk+3IvaSw N1jIopXTNw+4C9ub/p4HVbCIthnWLGylX6vdAhcyoGM8hrV5mNcVM0E7cp9nCSnhkFa6 bC4mB+F9t1fm/yDnhJ6j3dXOaW9hIegDZ3uKOJiU5FUbqaKYf73IcuAyfI9uWVKFkyv0 BYyEiB8RuQpsQw9xICntGCfdHa0oW8/aLAKFC0OxdrHOq0nLuU+hOlI+q4RI9SXkIQV/ DDQcdqvNBlVyxR2nIITt2j0RveNN6CwSi6ReG/lpHmpbZZLXaJP4Khz6m9bVg9LoFfTd 9kkg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@pankajraghav.com header.s=MBO0001 header.b="mZa/2rNz"; 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-102181-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-102181-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=pankajraghav.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id r3-20020ac85c83000000b0042ef4fb3b28si1596963qta.341.2024.03.14.06.47.18 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Mar 2024 06:47:18 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-102181-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@pankajraghav.com header.s=MBO0001 header.b="mZa/2rNz"; 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-102181-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-102181-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id ED1081C24EF5 for ; Wed, 13 Mar 2024 18:18:37 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 32B5360BAF; Wed, 13 Mar 2024 17:03:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=pankajraghav.com header.i=@pankajraghav.com header.b="mZa/2rNz" Received: from mout-p-103.mailbox.org (mout-p-103.mailbox.org [80.241.56.161]) (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 9F7FA60B9B; Wed, 13 Mar 2024 17:03:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=80.241.56.161 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710349421; cv=none; b=moW+8TI1pbEdZooqRvqiRmPBUStxzus6Osiqf6SuVcI7GYi3CK93u6dFNPldrWZsqi5iL4FeZ0u3f9M0J5VJO6nrLSe9ixG3va86nXFOGsZtDLX5o82FLByiJJGudq/wXvy7jsjUyh5hFod/sZlrTmhFN5uD2v2RvHjw+QWu63s= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710349421; c=relaxed/simple; bh=8h2k716LEkRXj/j4QF0KIKvbMa13OHXZcCU5xl00czw=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=GOKwJD44+CS9fjuiYZkThOKMpeua7tSx6+XxfBCuufi6qGG9nrF7Lz5P8ZreU5p8c9oyJeaLgLuTyCLKTY+Z8CLqYfVXlv2y0dKMMkiqLJ/UUvr+/RB6D8x/kvLIJbVvbnWCKdvttkuSKnxD5IsWc1GA+fj/KmFNqBm42Gi+ROI= 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=mZa/2rNz; arc=none smtp.client-ip=80.241.56.161 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 smtp202.mailbox.org (smtp202.mailbox.org [IPv6:2001:67c:2050:b231:465::202]) (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-103.mailbox.org (Postfix) with ESMTPS id 4Tvxfr5XYdz9svD; Wed, 13 Mar 2024 18:03:32 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pankajraghav.com; s=MBO0001; t=1710349412; 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=hTTuIiANd5kCHMpVIcnhOGjU1SgMYOpCUNpWo+aN5OQ=; b=mZa/2rNzUk5ItRGjmpFKbIx/e9/B2IW9ObJbSGaxYPcM6/REiNCqEk1WTvXyVIEg1IRLvo diMbHNgV0MF5F7anhDmyOFyn+elkV53QF7ODdqxDx3aNbteQwUgYMBNmP0FX6xERwETv8v J09mtYXdl9rfRkqC58xp6gSWM+i40fSvzFOJP+TdAu3FZq0m5EC1qZoNbnrd7jm1YKBAHd +vribik6eOON1VvDG9qzhVhSqph3+50/mkKuElzubYMNsOZc9lddHkPGrZzxIO+BWa9plt dDJmdXsM+i/9cSpi6ibNvk1ucveXD2OXrIf9fZ21iljyuGKrUV+HA1m+kDNgfQ== From: "Pankaj Raghav (Samsung)" To: willy@infradead.org, linux-xfs@vger.kernel.org, linux-fsdevel@vger.kernel.org Cc: gost.dev@samsung.com, chandan.babu@oracle.com, hare@suse.de, mcgrof@kernel.org, djwong@kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, david@fromorbit.com, akpm@linux-foundation.org, Pankaj Raghav Subject: [PATCH v3 09/11] xfs: expose block size in stat Date: Wed, 13 Mar 2024 18:02:51 +0100 Message-ID: <20240313170253.2324812-10-kernel@pankajraghav.com> In-Reply-To: <20240313170253.2324812-1-kernel@pankajraghav.com> References: <20240313170253.2324812-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 X-Rspamd-Queue-Id: 4Tvxfr5XYdz9svD 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/ Signed-off-by: Pankaj Raghav Signed-off-by: Luis Chamberlain --- 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 a0d77f5f512e..7ee829f7d708 100644 --- a/fs/xfs/xfs_iops.c +++ b/fs/xfs/xfs_iops.c @@ -543,7 +543,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.43.0