From patchwork Thu Jun 9 10:53:42 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Luis Henriques X-Patchwork-Id: 12875244 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id CF073C43334 for ; Thu, 9 Jun 2022 10:53:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242163AbiFIKxG (ORCPT ); Thu, 9 Jun 2022 06:53:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49570 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236400AbiFIKxG (ORCPT ); Thu, 9 Jun 2022 06:53:06 -0400 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 48351D12E; Thu, 9 Jun 2022 03:53:05 -0700 (PDT) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 04FD421E0E; Thu, 9 Jun 2022 10:53:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1654771984; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=nHo1V4OXl1fsgoJ0X4r6OgxS7vBNLp6zrOgtEoQsT7A=; b=g5yHi3cy0wdKjPTR4+KFch0zqU9rZcFXZpJp5xZR+T2x5WEwq6PdDMT2Sf1qrQscAc2F49 Ux8FWUhOw4bxic4/LLa8+3UTL2sGB6atDT3kOk9M4hYIfbfCwDVJyBEBLMxjm+//CRpxPE GDB4ZJdjet4+6WvaQPtjf22efpXt7Co= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1654771984; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=nHo1V4OXl1fsgoJ0X4r6OgxS7vBNLp6zrOgtEoQsT7A=; b=pu9H7YpgArBP/0N9t6Go4PzfhmsI1KZ4HU2qGPN79W7OrcLqb20F0vokdQcruFM6PfecVo h2ccF5/zPZFo/JAw== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 831A013456; Thu, 9 Jun 2022 10:53:03 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id CET7HA/RoWK1EAAAMHmgww (envelope-from ); Thu, 09 Jun 2022 10:53:03 +0000 Received: from localhost (brahms.olymp [local]) by brahms.olymp (OpenSMTPD) with ESMTPA id 456a2098; Thu, 9 Jun 2022 10:53:44 +0000 (UTC) From: =?utf-8?q?Lu=C3=ADs_Henriques?= To: fstests@vger.kernel.org Cc: Dave Chinner , "Darrick J. Wong" , Jeff Layton , Xiubo Li , ceph-devel@vger.kernel.org, =?utf-8?q?Lu=C3=ADs_Henriques?= Subject: [PATCH v2 1/2] generic/020: adjust max_attrval_size for ceph Date: Thu, 9 Jun 2022 11:53:42 +0100 Message-Id: <20220609105343.13591-2-lhenriques@suse.de> In-Reply-To: <20220609105343.13591-1-lhenriques@suse.de> References: <20220609105343.13591-1-lhenriques@suse.de> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: fstests@vger.kernel.org CephFS doesn't have a maximum xattr size. Instead, it imposes a maximum size for the full set of xattrs names+values, which by default is 64K. This patch fixes the max_attrval_size so that it is slightly < 64K in order to accommodate any already existing xattrs in the file. Signed-off-by: Luís Henriques Reviewed-by: David Disseldorp --- tests/generic/020 | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/tests/generic/020 b/tests/generic/020 index d8648e96286e..76f13220fe85 100755 --- a/tests/generic/020 +++ b/tests/generic/020 @@ -128,7 +128,7 @@ _attr_get_max() pvfs2) max_attrval_size=8192 ;; - xfs|udf|9p|ceph) + xfs|udf|9p) max_attrval_size=65536 ;; bcachefs) @@ -139,6 +139,14 @@ _attr_get_max() # the underlying filesystem, so just use the lowest value above. max_attrval_size=1024 ;; + ceph) + # CephFS does not have a maximum value for attributes. Instead, + # it imposes a maximum size for the full set of xattrs + # names+values, which by default is 64K. Set this to a value + # that is slightly smaller than 64K so that it can accommodate + # already existing xattrs. + max_attrval_size=65000 + ;; *) # Assume max ~1 block of attrs BLOCK_SIZE=`_get_block_size $TEST_DIR` From patchwork Thu Jun 9 10:53:43 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Luis Henriques X-Patchwork-Id: 12875246 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9E70AC433EF for ; Thu, 9 Jun 2022 10:53:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230108AbiFIKxN (ORCPT ); Thu, 9 Jun 2022 06:53:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49786 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242966AbiFIKxL (ORCPT ); Thu, 9 Jun 2022 06:53:11 -0400 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 52CEBE085; Thu, 9 Jun 2022 03:53:05 -0700 (PDT) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 90A261F909; Thu, 9 Jun 2022 10:53:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1654771984; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=rEmJn680m/TQKB4Uu9ncMP6P+6Qq9FOSqC0c0ffBrNQ=; b=kvFwpF0xpDVIUkb6DFF2EPAltgZHnU1UhjGdNOSb6YL4T+qzYZrVO/H7eDKtbrqaDAJnaj RxV4Q8pvZxJJIrEqHOnhIKNuTfaSr5cnTpxQXXCEe3Wg3BIIIHMC0eKzeosT6ExrRqeas+ bOTUA+G52MZZxJCwBe9R77AXtRw7pnE= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1654771984; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=rEmJn680m/TQKB4Uu9ncMP6P+6Qq9FOSqC0c0ffBrNQ=; b=YV/LYmVrKiXcNCqezPvErvJg3qZYMGFCifHpRGfU6XqqlLHh+PPsaW+6GBsb5h2pJTMPVj HBM7HCwUG3TErsDA== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 1AB1513456; Thu, 9 Jun 2022 10:53:04 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id iPSEAxDRoWK1EAAAMHmgww (envelope-from ); Thu, 09 Jun 2022 10:53:04 +0000 Received: from localhost (brahms.olymp [local]) by brahms.olymp (OpenSMTPD) with ESMTPA id b14799e5; Thu, 9 Jun 2022 10:53:44 +0000 (UTC) From: =?utf-8?q?Lu=C3=ADs_Henriques?= To: fstests@vger.kernel.org Cc: Dave Chinner , "Darrick J. Wong" , Jeff Layton , Xiubo Li , ceph-devel@vger.kernel.org, =?utf-8?q?Lu=C3=ADs_Henriques?= Subject: [PATCH v2 2/2] generic/486: adjust the max xattr size Date: Thu, 9 Jun 2022 11:53:43 +0100 Message-Id: <20220609105343.13591-3-lhenriques@suse.de> In-Reply-To: <20220609105343.13591-1-lhenriques@suse.de> References: <20220609105343.13591-1-lhenriques@suse.de> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: fstests@vger.kernel.org CephFS doesn't have a maximum xattr size. Instead, it imposes a maximum size for the full set of xattrs names+values, which by default is 64K. And since ceph reports 4M as the blocksize (the default ceph object size), generic/486 will fail in this filesystem because it will end up using XATTR_SIZE_MAX to set the size of the 2nd (big) xattr value. The fix is to adjust the max size in attr_replace_test so that it takes into account the initial xattr name and value lengths. Signed-off-by: Luís Henriques --- src/attr_replace_test.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/attr_replace_test.c b/src/attr_replace_test.c index cca8dcf8ff60..1c8d1049a1d8 100644 --- a/src/attr_replace_test.c +++ b/src/attr_replace_test.c @@ -29,6 +29,11 @@ int main(int argc, char *argv[]) char *value; struct stat sbuf; size_t size = sizeof(value); + /* + * Take into account the initial (small) xattr name and value sizes and + * subtract them from the XATTR_SIZE_MAX maximum. + */ + size_t maxsize = XATTR_SIZE_MAX - strlen(name) - 1; if (argc != 2) fail("Usage: %s \n", argv[0]); @@ -46,7 +51,7 @@ int main(int argc, char *argv[]) size = sbuf.st_blksize * 3 / 4; if (!size) fail("Invalid st_blksize(%ld)\n", sbuf.st_blksize); - size = MIN(size, XATTR_SIZE_MAX); + size = MIN(size, maxsize); value = malloc(size); if (!value) fail("Failed to allocate memory\n");