Received: by 2002:a05:7412:3b8b:b0:fc:a2b0:25d7 with SMTP id nd11csp2953025rdb; Tue, 13 Feb 2024 02:16:17 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVx0mk9VyU0u1ZJ+8E55nGV93wB1AWJDFKWY17ij5zmuNDGx+72dA2Lh+p+9x/Z8fN4YdBGPWoIaXx6kemu6R9GwohffcmnGd08U5MU4Q== X-Google-Smtp-Source: AGHT+IFhXwr7AXdIhQ/s4Zf/igTkzGggOW0m9F4p2eNqNbCBdr/HE4w2Nf5QX1l5PXMVwH7lqgXy X-Received: by 2002:a05:622a:302:b0:42c:6b62:c2e0 with SMTP id q2-20020a05622a030200b0042c6b62c2e0mr9118804qtw.32.1707819377082; Tue, 13 Feb 2024 02:16:17 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707819377; cv=pass; d=google.com; s=arc-20160816; b=g2VjmzVaUftNifsdGo+HKh5+cWr8FoGV9sLPODWzhEQaXG3srMZOCj4VScPOmD1N51 8yex8uyWPIxfiTelJNFigD4QwIOKztVpvazcr+7KDgP8vweb1p2s4pVk17lxGz4IILkL dgAEaBuiD677CyPuMB1+ffvzdlxK0A9SKhOrYecNGfVCrr8mhI6c8wbnzZxTnnY5baeB cgXfklS4JSa+qkQXPx7J/prSApQ5W3WUO2/2Y0g1BKmZm3vcZvtO+4hFI+qBhJR+4ZqE z1skD9nnoxFD8vM9oS2EaXig/7mh2Pd0+RNNdnh5xiFMKWCICqd7gzOvtqZM0RLOIQ8W NJPw== 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:message-id:date:subject:cc:to :from:dkim-signature:dkim-signature:dkim-signature:dkim-signature; bh=oEgrEd2qKlyEuUxaoLleV3eAi1dDAAVhh7sPEQQWhow=; fh=gSlPL2GtWKqbLKC8m67ybAdL/EQ4Nv1pjk8BTmyaEig=; b=YtwX7ZnjViStenrDhpo+LH8DPn9QuDrvkwKd0nmcOM7kWsaWZ8sLC5hgOCDfcfIIBt ZzgaclPXKYcyO6GwiedgvpbEQlluJ9Kwf81/Vv1ZhAcjFNxyAriV1ctgyArZDvAVpcLT wBv4pCICWykgfWELiB2jCVAgaZddZ6p//jFK5XyCCpU2J62xB7BNS2cXbDyL2Caa3gKT ZfnenBaA6C6XO+DLhz8LNeeRtCKuH9M5a8RNNznjjeWR6l2bB9lCvq2jfNzItU4PAhbF qKnpLv8f6OQjhvyvk51TTlAGYexwFcUqfRu8DTZ1/K2BhsbaOYaeTxq9HJpyLmG8ylyc RPZw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=J5ggBIkF; dkim=neutral (no key) header.i=@suse.cz header.s=susede2_ed25519; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=J5ggBIkF; dkim=neutral (no key) header.i=@suse.cz header.s=susede2_ed25519; arc=pass (i=1 spf=pass spfdomain=suse.cz dkim=pass dkdomain=suse.cz dkim=pass dkdomain=suse.cz); spf=pass (google.com: domain of linux-ext4+bounces-1221-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-ext4+bounces-1221-linux.lists.archive=gmail.com@vger.kernel.org" X-Forwarded-Encrypted: i=2; AJvYcCUN/O6K297Y4A6qHwAfnDWpi7nMJ4JfBzZANvq2HIcTUSGTRTfoSGpsjdkkUtQI/1Sgdk/e6E0Za9WPS+0R/vp9OxNngGVdAcVM+fdwHg== Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id s14-20020ac85cce000000b0042db30ae55esi150788qta.278.2024.02.13.02.16.16 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 13 Feb 2024 02:16:17 -0800 (PST) Received-SPF: pass (google.com: domain of linux-ext4+bounces-1221-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=J5ggBIkF; dkim=neutral (no key) header.i=@suse.cz header.s=susede2_ed25519; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=J5ggBIkF; dkim=neutral (no key) header.i=@suse.cz header.s=susede2_ed25519; arc=pass (i=1 spf=pass spfdomain=suse.cz dkim=pass dkdomain=suse.cz dkim=pass dkdomain=suse.cz); spf=pass (google.com: domain of linux-ext4+bounces-1221-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-ext4+bounces-1221-linux.lists.archive=gmail.com@vger.kernel.org" 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 C52071C2170D for ; Tue, 13 Feb 2024 10:16:16 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id AC848225D2; Tue, 13 Feb 2024 10:16:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=suse.cz header.i=@suse.cz header.b="J5ggBIkF"; dkim=permerror (0-bit key) header.d=suse.cz header.i=@suse.cz header.b="Brr2b7dj"; dkim=pass (1024-bit key) header.d=suse.cz header.i=@suse.cz header.b="J5ggBIkF"; dkim=permerror (0-bit key) header.d=suse.cz header.i=@suse.cz header.b="Brr2b7dj" X-Original-To: linux-ext4@vger.kernel.org Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.223.130]) (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 71871249F3 for ; Tue, 13 Feb 2024 10:16:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=195.135.223.130 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707819374; cv=none; b=m7ZfJEm8xS/I5lRC0NyZOWDz/utMR7DEzrJ7oJ3Totbz+9636WF/TD/Tq9jYu9EZw1lytgS13on4OKOXOsH6yr9WBQIoKYAiR7P0cz6Qw+kDO0lm8FEq7w+SeKYiOpYbIq3Buni3yfSQKyXCGwCrLT8xK+w3vAfyJ9fgiZLopdQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707819374; c=relaxed/simple; bh=H5skab7GQRrpfw52hOvc7Xn/wPYxa66PWFHV6YS5lnM=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=KjgPefY12a/pp+Yd0oBHZphmzN8QSbUZt5kep1bclGkFzIISR4yXQ8zeE7EbHLk9vspn8s3lPQ7vCmuzOfXiaou+B940OU/FxavCYUAVFSTrJkgeAheWhI+hqDYDfjtraiAoCRopKrBXHIFjuOCjfeav13flteNowrdK3LuiKGY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=suse.cz; spf=pass smtp.mailfrom=suse.cz; dkim=pass (1024-bit key) header.d=suse.cz header.i=@suse.cz header.b=J5ggBIkF; dkim=permerror (0-bit key) header.d=suse.cz header.i=@suse.cz header.b=Brr2b7dj; dkim=pass (1024-bit key) header.d=suse.cz header.i=@suse.cz header.b=J5ggBIkF; dkim=permerror (0-bit key) header.d=suse.cz header.i=@suse.cz header.b=Brr2b7dj; arc=none smtp.client-ip=195.135.223.130 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=suse.cz Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.cz Received: from imap2.dmz-prg2.suse.org (imap2.dmz-prg2.suse.org [10.150.64.98]) (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 smtp-out1.suse.de (Postfix) with ESMTPS id 8484021AF9; Tue, 13 Feb 2024 10:16:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1707819370; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=oEgrEd2qKlyEuUxaoLleV3eAi1dDAAVhh7sPEQQWhow=; b=J5ggBIkF3+7dSPzUr65ZSTuCUsTK2IKfbz22yh/z/Tnw7eD5fJ3faCjcEmgS06ZYp+UO3s ZBO47O7sZunaTlFa+8AJOn3SLMDeZAh2fMjjYyUBrbqLHJ9fOlmOLSgDBj6siEGSW3wpxo E9gzO5Roqq5wKWsjfc17a14Yo6liTQQ= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1707819370; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=oEgrEd2qKlyEuUxaoLleV3eAi1dDAAVhh7sPEQQWhow=; b=Brr2b7djkFMGdgCinVePyzkzndERR3S8/EgmdW0HyM55X3m+s1FaNztsTEPz+yEqV7htqd M10yDYgbsW8rRUCQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1707819370; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=oEgrEd2qKlyEuUxaoLleV3eAi1dDAAVhh7sPEQQWhow=; b=J5ggBIkF3+7dSPzUr65ZSTuCUsTK2IKfbz22yh/z/Tnw7eD5fJ3faCjcEmgS06ZYp+UO3s ZBO47O7sZunaTlFa+8AJOn3SLMDeZAh2fMjjYyUBrbqLHJ9fOlmOLSgDBj6siEGSW3wpxo E9gzO5Roqq5wKWsjfc17a14Yo6liTQQ= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1707819370; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=oEgrEd2qKlyEuUxaoLleV3eAi1dDAAVhh7sPEQQWhow=; b=Brr2b7djkFMGdgCinVePyzkzndERR3S8/EgmdW0HyM55X3m+s1FaNztsTEPz+yEqV7htqd M10yDYgbsW8rRUCQ== Received: from imap2.dmz-prg2.suse.org (localhost [127.0.0.1]) (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 imap2.dmz-prg2.suse.org (Postfix) with ESMTPS id 79C631329E; Tue, 13 Feb 2024 10:16:10 +0000 (UTC) Received: from dovecot-director2.suse.de ([10.150.64.162]) by imap2.dmz-prg2.suse.org with ESMTPSA id SD64HWpBy2UaLwAAn2gu4w (envelope-from ); Tue, 13 Feb 2024 10:16:10 +0000 Received: by quack3.suse.cz (Postfix, from userid 1000) id 14361A0809; Tue, 13 Feb 2024 11:16:06 +0100 (CET) From: Jan Kara To: Ted Tso Cc: , Jan Kara Subject: [PATCH] ext4: Don't report EOPNOTSUPP errors from discard Date: Tue, 13 Feb 2024 11:16:01 +0100 Message-Id: <20240213101601.17463-1-jack@suse.cz> X-Mailer: git-send-email 2.35.3 Precedence: bulk X-Mailing-List: linux-ext4@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1193; i=jack@suse.cz; h=from:subject; bh=H5skab7GQRrpfw52hOvc7Xn/wPYxa66PWFHV6YS5lnM=; b=owEBbQGS/pANAwAIAZydqgc/ZEDZAcsmYgBly0FhBwwj3DMYe6CCf9CP/WA60ifc3CQ2g97NoEYx u276qoOJATMEAAEIAB0WIQSrWdEr1p4yirVVKBycnaoHP2RA2QUCZctBYQAKCRCcnaoHP2RA2c3CCA CDHICRinfh/gHpm98pZQIzr/RV/GODEbht+qhn9cf1N+T0J5riXHtK/ijr0X5r2K61XrvKbZTB5lEv fDzC5KdqzzyMt9/jAT71ZStoKTZk41SpGBo/EmTUmXDLqAa3QlsPg0/r/HhWMbwnzlVsaz/aAxH0Bn wRP1kFCCgECt1Z97RMaydl1ZN8DYrXopfbrMfDmWIAZx/9AIBq/KdrR+014ttXev1l0netau5/g/El FJMTbmCIEybO2j4ATnC8m6ife2CdoVUhcinRmwKLIoOjkNbx6gk1Fx/HWtvMgJbHc2zCLHYUikKkyp fAjh/E+weseqVtlNQcfhMReiy8OPmO X-Developer-Key: i=jack@suse.cz; a=openpgp; fpr=93C6099A142276A28BBE35D815BC833443038D8C Content-Transfer-Encoding: 8bit Authentication-Results: smtp-out1.suse.de; none X-Spamd-Result: default: False [4.90 / 50.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; R_MISSING_CHARSET(2.50)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; BROKEN_CONTENT_TYPE(1.50)[]; TO_DN_SOME(0.00)[]; RCVD_COUNT_THREE(0.00)[3]; DKIM_SIGNED(0.00)[suse.cz:s=susede2_rsa,suse.cz:s=susede2_ed25519]; MID_CONTAINS_FROM(1.00)[]; DBL_BLOCKED_OPENRESOLVER(0.00)[suse.cz:email]; FUZZY_BLOCKED(0.00)[rspamd.com]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; RCVD_TLS_ALL(0.00)[]; BAYES_HAM(-0.00)[22.06%] X-Spam-Level: **** X-Spam-Score: 4.90 X-Spam-Flag: NO When ext4 is mounted without journal, with discard mount option, and on a device not supporting trim, we print error for each and every freed extent. This is not only useless but actively harmful. Instead ignore the EOPNOTSUPP error. Trim is only advisory anyway and when the filesystem has journal we silently ignore trim error as well. Signed-off-by: Jan Kara --- fs/ext4/mballoc.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/fs/ext4/mballoc.c b/fs/ext4/mballoc.c index e4f7cf9d89c4..aed620cf4d40 100644 --- a/fs/ext4/mballoc.c +++ b/fs/ext4/mballoc.c @@ -6488,7 +6488,13 @@ static void ext4_mb_clear_bb(handle_t *handle, struct inode *inode, if (test_opt(sb, DISCARD)) { err = ext4_issue_discard(sb, block_group, bit, count_clusters, NULL); - if (err && err != -EOPNOTSUPP) + /* + * Ignore EOPNOTSUPP error. This is consistent with + * what happens when using journal. + */ + if (err == -EOPNOTSUPP) + err = 0; + if (err) ext4_msg(sb, KERN_WARNING, "discard request in" " group:%u block:%d count:%lu failed" " with %d", block_group, bit, count, -- 2.35.3