Received: by 2002:ab2:6857:0:b0:1ef:ffd0:ce49 with SMTP id l23csp1437235lqp; Fri, 22 Mar 2024 15:12:00 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUMC38JSi4WHFiHdboGuHw/rC0oU9v2HDwq/elEXpkKF9SjF6nlnXNnClm8/1PfR8ud+T9qRVb3c/vv6WfMbdfBeWr+KDveshJmBZwC8Q== X-Google-Smtp-Source: AGHT+IH5j55Rqs5H1Q9sVQn+FpwgJ6HYVIAp7/3X/6mPG+sUbCt/2nw8MyJKrY0AxPXlajNg8FPl X-Received: by 2002:a05:6808:2203:b0:3c3:7696:7aa7 with SMTP id bd3-20020a056808220300b003c376967aa7mr1376137oib.11.1711145520062; Fri, 22 Mar 2024 15:12:00 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711145520; cv=pass; d=google.com; s=arc-20160816; b=K1Nyg6mNch71jXrcaXQFBCqnj0RMk3t0pqJ//A4A+jWZje1eYuccBpVCjZj9O4Ex2j GcrJ3lbMISP5mMHTsT2MSii8SBhICemvYtLRf7YMRsG0S25jpxLdr0teppIFdHSgswUt IhTurgrChSovI0SWPWPQENioWYMmo0R5Ok7vsXF36AdDlQqWMT7D28/noYvnSWcIozYK fr2skITYm5DLtZ5KhFYkrK4HwJdn+ptaoy4SER5Z63RwqRCpNPTvcHoS2hTWY290SevU RXVNUOvN2RGSHoj+77TMZrRLJX1XurtwDmOcM2vGzoyfmXQyH10K1a0BPOvJc8lxMv2a dSlg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:list-unsubscribe:list-subscribe:list-id:precedence :user-agent:message-id:date:references:in-reply-to:subject:cc:to :from:dkim-signature:dkim-signature:dkim-signature:dkim-signature; bh=aTZ09ncmKCd8WkUQEbzrII1H6hejyxJNsILQlSmmkc0=; fh=CI7LZpQZNDzzvfwc1LMCI8aXfMDXVgL2A0YL7Sif4xo=; b=G/MepYampB/mNwcKtE0i0EQO2kCMSKyybfJIa3WeHiDgYWs7SVrdFlFvASUhyY9Z0M FdAuV1oiCYSVzweEAFqOgTTIaIKQCp1v1KUqLihF1qX2z3z2foDYciLer1o50DURJBbf i074RokMzDoclW9VWILFYsdgNTHiRazSYOrEFCgYfexVywyHW93viRpQy7rYA61ea01O 0+0cj/osM6pgOlUT7EfTn//aflBoIBeGlpfPpSssPgwMhGqRDL4NorPMvc6bEV7Zede2 wEuT0vHd1Qw8rhFXQ8xELxOm6xbBORlFBBeXzTsGl0z15THieqtRJKXdej0PW74JhLkl yPTg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=i+DCSaHC; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=i+DCSaHC; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519; arc=pass (i=1 spf=pass spfdomain=suse.de dkim=pass dkdomain=suse.de dkim=pass dkdomain=suse.de dmarc=pass fromdomain=suse.de); spf=pass (google.com: domain of linux-kernel+bounces-112061-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-112061-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id h5-20020a05622a170500b004313d9f36desi411022qtk.47.2024.03.22.15.11.59 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Mar 2024 15:12:00 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-112061-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=@suse.de header.s=susede2_rsa header.b=i+DCSaHC; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=i+DCSaHC; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519; arc=pass (i=1 spf=pass spfdomain=suse.de dkim=pass dkdomain=suse.de dkim=pass dkdomain=suse.de dmarc=pass fromdomain=suse.de); spf=pass (google.com: domain of linux-kernel+bounces-112061-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-112061-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de 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 B76461C20965 for ; Fri, 22 Mar 2024 22:11:59 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 507FD81ADD; Fri, 22 Mar 2024 22:11:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="i+DCSaHC"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="iMJ5N/8y"; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="i+DCSaHC"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="iMJ5N/8y" 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 B187280059; Fri, 22 Mar 2024 22:11:38 +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=1711145500; cv=none; b=lPMfhFf11QGBQzO8sIYW0tpjEIiUxxDvWJKcWxJoh7rh0Elz58Uo8gD1rjIr65kEkxp5ZgaPE8S6+7T5eV+wvwiq7D5bm5cC8F3PkDDywUchJHZg94v1+HO+CJnXZJi4xBrGl7jgKt6lPfS93pYizk6F7xMukdJ0W775wgsHYoY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711145500; c=relaxed/simple; bh=mtr17MhmRQz+7hZNY3mNWDm7X7H/pBoEUAZnkiSDZWI=; h=From:To:Cc:Subject:In-Reply-To:References:Date:Message-ID: MIME-Version:Content-Type; b=lF+LDNFwuB29Wf7M9HfEiVdQl5y52HVoydykvFLf5fdnkcfMM+rweSlOfGBJVOinqHTLc1hYL0z/lAwUf10E4oWBEh0EKGbfopXZTlUseeSRmdb7/VC2nC1KW5LHqzBwl8MJboC6F8Yu/tk1EY7GPNkS/scXqHWlrBEC40gEhSo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=suse.de; spf=pass smtp.mailfrom=suse.de; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b=i+DCSaHC; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b=iMJ5N/8y; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b=i+DCSaHC; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b=iMJ5N/8y; arc=none smtp.client-ip=195.135.223.130 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=suse.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.de Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org [IPv6:2a07:de40:b281:104:10:150:64:97]) (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 DF29C38A8F; Fri, 22 Mar 2024 22:11:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1711145496; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=aTZ09ncmKCd8WkUQEbzrII1H6hejyxJNsILQlSmmkc0=; b=i+DCSaHCastt8j3z9SusKvybZUMm+JTSJQd4EcxLc2dhlAZj06dj7Js9m1BwY/qgfj73wV CKeniWdM4e0/nu6HyO5IHta94rFjYi0htoAsWPXea4Lp/RdvdpLIXtaQSy7WLavxztp46p vJUFt6NzRnckQxP2fXoOrbW+ghNMYPg= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1711145496; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=aTZ09ncmKCd8WkUQEbzrII1H6hejyxJNsILQlSmmkc0=; b=iMJ5N/8yUDUsqNpMRpxpGOdi4bp5VNayAK61HozHKt8IRaaoQwNuSxZbf9UMLzsu+h8pF0 vTgiKlp/xqEyVtDw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1711145496; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=aTZ09ncmKCd8WkUQEbzrII1H6hejyxJNsILQlSmmkc0=; b=i+DCSaHCastt8j3z9SusKvybZUMm+JTSJQd4EcxLc2dhlAZj06dj7Js9m1BwY/qgfj73wV CKeniWdM4e0/nu6HyO5IHta94rFjYi0htoAsWPXea4Lp/RdvdpLIXtaQSy7WLavxztp46p vJUFt6NzRnckQxP2fXoOrbW+ghNMYPg= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1711145496; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=aTZ09ncmKCd8WkUQEbzrII1H6hejyxJNsILQlSmmkc0=; b=iMJ5N/8yUDUsqNpMRpxpGOdi4bp5VNayAK61HozHKt8IRaaoQwNuSxZbf9UMLzsu+h8pF0 vTgiKlp/xqEyVtDw== Received: from imap1.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 imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id A7C3C132FF; Fri, 22 Mar 2024 22:11:36 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id 8ov9IhgC/mUEHgAAD6G6ig (envelope-from ); Fri, 22 Mar 2024 22:11:36 +0000 From: Gabriel Krisman Bertazi To: Eugen Hristev via Linux-f2fs-devel Cc: tytso@mit.edu, adilger.kernel@dilger.ca, linux-ext4@vger.kernel.org, jaegeuk@kernel.org, chao@kernel.org, linux-fsdevel@vger.kernel.org, Eugen Hristev , brauner@kernel.org, jack@suse.cz, Eric Biggers , linux-kernel@vger.kernel.org, viro@zeniv.linux.org.uk, kernel@collabora.com, Gabriel Krisman Bertazi Subject: Re: [f2fs-dev] [PATCH v10 7/8] ext4: Move CONFIG_UNICODE defguards into the code flow In-Reply-To: <20240215042654.359210-8-eugen.hristev@collabora.com> (Eugen Hristev via Linux-f2fs-devel's message of "Thu, 15 Feb 2024 06:26:53 +0200") References: <20240215042654.359210-1-eugen.hristev@collabora.com> <20240215042654.359210-8-eugen.hristev@collabora.com> Date: Fri, 22 Mar 2024 18:11:35 -0400 Message-ID: <87ttkx9aso.fsf@mailhost.krisman.be> User-Agent: Gnus/5.13 (Gnus v5.13) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain X-Spam-Level: Authentication-Results: smtp-out1.suse.de; dkim=pass header.d=suse.de header.s=susede2_rsa header.b=i+DCSaHC; dkim=pass header.d=suse.de header.s=susede2_ed25519 header.b="iMJ5N/8y" X-Rspamd-Server: rspamd2.dmz-prg2.suse.org X-Spamd-Result: default: False [-4.04 / 50.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_DKIM_ALLOW(-0.20)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; SPAMHAUS_XBL(0.00)[2a07:de40:b281:104:10:150:64:97:from]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; MIME_GOOD(-0.10)[text/plain]; DWL_DNSWL_MED(-2.00)[suse.de:dkim]; RCVD_COUNT_THREE(0.00)[3]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; DKIM_TRACE(0.00)[suse.de:+]; MX_GOOD(-0.01)[]; RCPT_COUNT_TWELVE(0.00)[15]; DBL_BLOCKED_OPENRESOLVER(0.00)[suse.de:dkim]; FUZZY_BLOCKED(0.00)[rspamd.com]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; NEURAL_HAM_SHORT(-0.20)[-0.999]; RCVD_TLS_ALL(0.00)[]; BAYES_HAM(-0.53)[80.55%] X-Spam-Score: -4.04 X-Rspamd-Queue-Id: DF29C38A8F X-Spam-Flag: NO Eugen Hristev via Linux-f2fs-devel writes: > From: Gabriel Krisman Bertazi > > Instead of a bunch of ifdefs, make the unicode built checks part of the > code flow where possible, as requested by Torvalds. > > Reviewed-by: Eric Biggers > Signed-off-by: Gabriel Krisman Bertazi > [eugen.hristev@collabora.com: port to 6.8-rc3] > Signed-off-by: Eugen Hristev > --- > fs/ext4/crypto.c | 19 +++---------------- > fs/ext4/ext4.h | 33 +++++++++++++++++++++------------ > fs/ext4/namei.c | 14 +++++--------- > fs/ext4/super.c | 4 +--- > 4 files changed, 30 insertions(+), 40 deletions(-) > > diff --git a/fs/ext4/crypto.c b/fs/ext4/crypto.c > index 7ae0b61258a7..1d2f8b79529c 100644 > --- a/fs/ext4/crypto.c > +++ b/fs/ext4/crypto.c > @@ -31,12 +31,7 @@ int ext4_fname_setup_filename(struct inode *dir, const struct qstr *iname, > > ext4_fname_from_fscrypt_name(fname, &name); > > -#if IS_ENABLED(CONFIG_UNICODE) > - err = ext4_fname_setup_ci_filename(dir, iname, fname); > - if (err) > - ext4_fname_free_filename(fname); > -#endif > - return err; > + return ext4_fname_setup_ci_filename(dir, iname, fname); This shouldn't remove the error path. It effectively reintroduces the memory leak fixed by commit 7ca4b085f430 ("ext4: fix memory leaks in ext4_fname_{setup_filename,prepare_lookup}"). This patch was only about inlining the codeguards, so it shouldn't be changing the logic. > } > > int ext4_fname_prepare_lookup(struct inode *dir, struct dentry *dentry, > @@ -51,12 +46,7 @@ int ext4_fname_prepare_lookup(struct inode *dir, struct dentry *dentry, > > ext4_fname_from_fscrypt_name(fname, &name); > > -#if IS_ENABLED(CONFIG_UNICODE) > - err = ext4_fname_setup_ci_filename(dir, &dentry->d_name, fname); > - if (err) > - ext4_fname_free_filename(fname); > -#endif > - return err; > + return ext4_fname_setup_ci_filename(dir, &dentry->d_name, fname); > } likewise -- Gabriel Krisman Bertazi