From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pj1-f41.google.com (mail-pj1-f41.google.com [209.85.216.41]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 53D0835B144 for ; Fri, 24 Oct 2025 09:18:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.41 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1761297487; cv=none; b=kSu1rvMNAOlkc8RYZjIj4erBgG1DL86qK1D+tzOyiX3BG7OoSru8X5/ArCRsRwSgt77vZsMMQHFBOCYegNUuErlR2WZHLUAZQInYIKckY+F+bc3AWSr6QOCKaw6Fz2r5q7qnvd82EEyBmTHu7+u8NjiNjwDKB/rbwT7fxy5Mc3k= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1761297487; c=relaxed/simple; bh=MkHSCjiuGbedRTO0h6kA5KeA8QWtdD4n/Bl601uZN10=; h=Message-ID:Subject:From:To:Cc:Date:In-Reply-To:References: Content-Type:Mime-Version; b=A3wpKebHs2d5wu7u34s8xZvMib0DA1iXxH4bxwEgouH7wcq2IPmcErRNSe1CZrNaLVoqfbX9GjFS3CWzTcWnCzM5COD/0PLHHprv2nv7QshCmK2Oee2a1lMWxYhxSdS6wE9ONqtxas+gKts6T5qyTVJRHyRoyumIf7crWOcKB2c= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=RpX+1xOz; arc=none smtp.client-ip=209.85.216.41 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="RpX+1xOz" Received: by mail-pj1-f41.google.com with SMTP id 98e67ed59e1d1-33c4252c3c5so1809396a91.0 for ; Fri, 24 Oct 2025 02:18:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1761297486; x=1761902286; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to:date :cc:to:from:subject:message-id:from:to:cc:subject:date:message-id :reply-to; bh=VTneT4Vk3qDp9GQmX9ch/ZDi0+H9sikLlw+PPuUwI9Y=; b=RpX+1xOz0niX0y/9HZZ9qInEjuu1efGesWqva+aXrqsXE0Kfwdjon/xs2ik7yoE2sR PiEqs4p/iiyQo4ofe6/YW+W5/HHTkmAC6pgaQ7oGPGgmCck53Q7Hn6vY1/9ZDv86jGIm XNhmSTkPoPjAEjWyfgswIKZK5FRT76aR9kt48lg4fLdpyYxEl2E3672yIHFstKjLW7vb v0p5KWQ9INgq21NoJ10az/HYRMibotQTYndF1+yVM3hMtptN4numo+n+9diSwC6ofzZz b5lA+YL/bwQTUIQeYsTWSZfAh2dhd2ByMKKw/FIuTfJjR238A9ojPBFWLmieQEvataoQ bayA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1761297486; x=1761902286; h=content-transfer-encoding:mime-version:references:in-reply-to:date :cc:to:from:subject:message-id:x-gm-message-state:from:to:cc:subject :date:message-id:reply-to; bh=VTneT4Vk3qDp9GQmX9ch/ZDi0+H9sikLlw+PPuUwI9Y=; b=Ox6LpXimCLtxUhAYhgKz9QPcfIdSX7hR+G/ejOgURb99h/0Ga+iab4d7x65yJuyChc lSq8CJ7tuq7LwM7sy4cb0ELSgXRBe6odLAINpu+1DwA1kTZ8YBQ0MQjjp+4QdFmxxwXF CN/17BIPA66MBijoqpFwU2H8iXVqgerieqlTIjN5umsB4XkBx0Nzic9uC0mWaYb+0z34 6517vSA9MYhKaHMpmuFI/Beqwdy871XdvOk+Dy/tsRqxkpNhCryAKWFeeYBZN69Z6Bvs cbuPpIHnF58aOvG24e8u2glgcuGh5d0we+ck/wCgfvEvCF15LylKFQH8kJKzn0snPMTI kmLQ== X-Gm-Message-State: AOJu0YxSbNwVVmQjZiats2huRRX4PNYiPnot4g2cpSWwoOiFdqIStCsR 1WOuBVI0BpxcYJO9nnUoraCx0m/HSXIjT3nl6oz4EWQFF8lwmYCyTXGw X-Gm-Gg: ASbGnctX+SUldZi36OWxu1LVRRjUKcxNopAfuO5uOWVnOXs0hvqCFoS2cR9bAJUDdQd EKZXhhHtAHJHeTWSZimU6IOGghUHohn68veDNAIvIz0LJ6yXz3yxXO/V1gW+RlZjXWynQlTm7as a4TIGZ2FKwjd3YNwZqRjGAvh7lHecHoGmD0ax6OwWw+SuiMzxKvyQMCoeU+0WLiUDRZmrRjW3/o W1Mue2WDAiyl5cZaOnzy0O7I/3wk1/XzauswPpQnHt5Ml++eL2lAiiB58p/npuKrp+nsOl92T2W YkAu6+JXKusHHs3Ue/ou/FOuAYggFY3tjyA6Dr6x0Lg3Po2U5X3XOoeV30tqOp1GjgRtTHbUuYy o76pBewLBCzpwAcYVHsa4YcHR5aSqy7L6qPWO2C2RjS1Ar5a4YRSr3iFobpoPq07uUw7sZZJ6/A B/AP9KwhdvrtLdzQWq4oDZCtq62d0w38aCR7XQydLaWR8AxjWuzi42 X-Google-Smtp-Source: AGHT+IHtqGH6GpsWMe5DfeL4ZG5hW8+CzCw1Icbbe6oa59Qq4QMqv2SGK239tZT1wwgZrx9aw6abfg== X-Received: by 2002:a17:90b:3907:b0:32c:2cd:4d67 with SMTP id 98e67ed59e1d1-33fafbac1d9mr7627042a91.13.1761297485604; Fri, 24 Oct 2025 02:18:05 -0700 (PDT) Received: from li-5d80d4cc-2782-11b2-a85c-bed59fe4c9e5.ibm.com ([49.207.202.82]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-33e223cb0a5sm8399329a91.1.2025.10.24.02.18.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Oct 2025 02:18:05 -0700 (PDT) Message-ID: <4e8a9b373fdfeecd3e0de2a91ecdd75fbb94e18e.camel@gmail.com> Subject: Re: [PATCH 8/8] common: fix _require_xfs_io_command pwrite -A for various blocksizes From: "Nirjhar Roy (IBM)" To: "Darrick J. Wong" , zlang@redhat.com Cc: fstests@vger.kernel.org, linux-xfs@vger.kernel.org Date: Fri, 24 Oct 2025 14:48:00 +0530 In-Reply-To: <176054618045.2391029.13403718073912452422.stgit@frogsfrogsfrogs> References: <176054617853.2391029.10911105763476647916.stgit@frogsfrogsfrogs> <176054618045.2391029.13403718073912452422.stgit@frogsfrogsfrogs> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.28.5 (3.28.5-27.el8_10) Precedence: bulk X-Mailing-List: fstests@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 Content-Transfer-Encoding: 7bit On Wed, 2025-10-15 at 09:38 -0700, Darrick J. Wong wrote: > From: Darrick J. Wong > > In this predicate, we should test an atomic write of the minimum > supported size, not just 4k. This fixes a problem where none of the > atomic write tests actually run on a 32k-fsblock xfs because you can't > do a sub-fsblock atomic write. > > Cc: # v2025.04.13 > Fixes: d90ee3b6496346 ("generic: add a test for atomic writes") > Signed-off-by: "Darrick J. Wong" > --- > common/rc | 14 +++++++++++--- > 1 file changed, 11 insertions(+), 3 deletions(-) > > > diff --git a/common/rc b/common/rc > index 1b78cd0c358bb9..dcae5bc33b19ce 100644 > --- a/common/rc > +++ b/common/rc > @@ -3030,16 +3030,24 @@ _require_xfs_io_command() > "pwrite") > # -N (RWF_NOWAIT) only works with direct vectored I/O writes > local pwrite_opts=" " > + local write_size="4k" > if [ "$param" == "-N" ]; then > opts+=" -d" > - pwrite_opts+="-V 1 -b 4k" > + pwrite_opts+="-V 1 -b $write_size" Nit: We can still keep this to 4k (or any random size and not necessarily a size = fsblocksize), right? > fi > if [ "$param" == "-A" ]; then > opts+=" -d" > - pwrite_opts+="-V 1 -b 4k" > + # try to write the minimum supported atomic write size > + write_size="$($XFS_IO_PROG -f -c "statx -r -m $STATX_WRITE_ATOMIC" $testfile 2>/dev/null | \ > + grep atomic_write_unit_min | \ > + grep -o '[0-9]\+')" > + if [ -z "$write_size" ] || [ "$write_size" = "0" ]; then > + write_size="0 --not-supported" > + fi > + pwrite_opts+="-V 1 -b $write_size" > fi > testio=`$XFS_IO_PROG -f $opts -c \ > - "pwrite $pwrite_opts $param 0 4k" $testfile 2>&1` > + "pwrite $pwrite_opts $param 0 $write_size" $testfile 2>&1` This looks good to me: Reviewed-by: Nirjhar Roy (IBM) > param_checked="$pwrite_opts $param" > ;; > "scrub"|"repair") >