From mboxrd@z Thu Jan 1 00:00:00 1970 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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 003FCC7619A for ; Tue, 11 Apr 2023 08:14:50 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 78B4028005C; Tue, 11 Apr 2023 04:14:50 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 73B4E28005B; Tue, 11 Apr 2023 04:14:50 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 5DB7328005C; Tue, 11 Apr 2023 04:14:50 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id 4B83B28005B for ; Tue, 11 Apr 2023 04:14:50 -0400 (EDT) Received: from smtpin30.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id 001EB140A03 for ; Tue, 11 Apr 2023 08:14:49 +0000 (UTC) X-FDA: 80668399098.30.5A7F3C3 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by imf13.hostedemail.com (Postfix) with ESMTP id 090C320007 for ; Tue, 11 Apr 2023 08:14:47 +0000 (UTC) Authentication-Results: imf13.hostedemail.com; dkim=pass header.d=suse.cz header.s=susede2_rsa header.b=y09pkOX3; dkim=pass header.d=suse.cz header.s=susede2_ed25519 header.b=UQFPyRXP; dmarc=none; spf=pass (imf13.hostedemail.com: domain of jack@suse.cz designates 195.135.220.28 as permitted sender) smtp.mailfrom=jack@suse.cz ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1681200888; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=CyaFXKHJ+rjatLN2TgQGVrKjalOTkI8NwMdke0huGfc=; b=bHPBMQ4FtltcJFnSaQDvMMJodfUi4ogUBbQO+9hApdrRZ9zFMa5DfndntwIgM3B8I63y/e S5ppGYfnMDtT+ZlmRPKwGVl4tQu+HXx+e8Dol1s+TjRLVrC/mMv1GLI329/NjOBA7XnCo1 1at8EWu/BOYPsVDRd8jVMBTVqbR3bss= ARC-Authentication-Results: i=1; imf13.hostedemail.com; dkim=pass header.d=suse.cz header.s=susede2_rsa header.b=y09pkOX3; dkim=pass header.d=suse.cz header.s=susede2_ed25519 header.b=UQFPyRXP; dmarc=none; spf=pass (imf13.hostedemail.com: domain of jack@suse.cz designates 195.135.220.28 as permitted sender) smtp.mailfrom=jack@suse.cz ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1681200888; a=rsa-sha256; cv=none; b=WHJvHJaRYGHtp2FviRH+3foJySist1ZJiKIe4V9ZbUtWEwogbpfajbCOXrxslJVy6r6Zpj chBOqm2EmHB1LkJkuv+PTUuMaRyIWhg1UKL2w74D5vFauUuvYUOE6mxvHntjVZavzXpfAi BQd7sJ2vnA7+AVL9lZheUJn7FwpOsfE= 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 5CB6C21A5B; Tue, 11 Apr 2023 08:14:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1681200886; 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=CyaFXKHJ+rjatLN2TgQGVrKjalOTkI8NwMdke0huGfc=; b=y09pkOX35O8sc5hYX7U233hue/kuQJ/Sfh7Xabpc4ZMfJDdrCBabDpdERoTGBdaB04gsG/ nzVxNnFW+qFJrAaMZrlhUmjDO9x75o+ry7gouqG36zA+U/laF8vksGBXBdOpULfniQc3Et AFd0+BUmC1A62Qc09SeYczY+/rZuhps= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1681200886; 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=CyaFXKHJ+rjatLN2TgQGVrKjalOTkI8NwMdke0huGfc=; b=UQFPyRXPCCKGIUXpU8kTrvXx86VMDsYypO/epK9bxuGpcxM11WaZBIL3QQDdWHm8UTnOAg js+nif1ASSTS5vBw== 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 4E1B913638; Tue, 11 Apr 2023 08:14:46 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id wlEKE/YWNWQxfgAAMHmgww (envelope-from ); Tue, 11 Apr 2023 08:14:46 +0000 Received: by quack3.suse.cz (Postfix, from userid 1000) id CBD17A0732; Tue, 11 Apr 2023 10:14:45 +0200 (CEST) Date: Tue, 11 Apr 2023 10:14:45 +0200 From: Jan Kara To: Carlos Maiolino Cc: Jan Kara , hughd@google.com, linux-mm@kvack.org, linux-fsdevel@vger.kernel.org, djwong@kernel.org Subject: Re: [PATCH 2/6] shmem: make shmem_get_inode() return ERR_PTR instead of NULL Message-ID: <20230411081445.i57nloespetckatg@quack3> References: <20230403084759.884681-1-cem@kernel.org> <20230403084759.884681-3-cem@kernel.org> <20230403102354.jnwrqdbhpysttkxm@quack3> <20230411074708.gb7hkp6knxag3qjs@andromeda> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230411074708.gb7hkp6knxag3qjs@andromeda> X-Rspam-User: X-Rspamd-Server: rspam02 X-Rspamd-Queue-Id: 090C320007 X-Stat-Signature: xiduy9dyc3semsz5gzqdbau1w9go7k56 X-HE-Tag: 1681200887-533257 X-HE-Meta: U2FsdGVkX1/ec1mohiUd1eTLDN7F4fQE+MHjSSkTt9if+RtQQQks10n7DHaj0MHb9LeC7KuHSrPoTsxgm+86c3kJV8Gj4WoPULTK9Hzb3pK4bCZFDEwjjX49JFT8MjpC/adA4L8wppZ5R8yQNQFTDxbY9pdNj106rs3Im2MAu6ID8CBEnEIpGuS9LhdjfGdVZF8V1hz/Vmo+PKIhtn1t83rfg0eiMAhRCre+jlQhW+TsrAjiYVJOe3XI+gtkda2RhMmUt1gcxCpSJmPrwsPQ93PmziLwsbIof6/+23YClLgIsbwRPDaG4LhcKwqwlRoenMXZahEhBK366uYKT6JXm9mbl0ij19kv9dURF5i3I82909Ns/XL3HVJMf8OBX1otJDkPRzOl3LAT97jNKgcBpQdQLvN0jPeNU6ljiMREvO4Pp3rao2bgyM2iunkYzxAqlh5vbu7XYPilv4lvww1e4ftpf2L+CARtwFnYrKNtzAbrRAc34BJ0wXpbKKDAtP7I7377j9Rk31l7WGjb/QsUTE9LAbvYd/LYJz8UVgsWuzZ+pB/pjRwexR16Sx2LJuG+wgjAYIJWmYNXcqDdS5/J5/ns6vP3wvtqhfVuTelDgVcFjXt6h6EiZF1BCJAkjS6zX7fcBikI2urZ+qi0bYHhp8hltYOsBdRP4EB/yzN9EEfcE5nXFkfMNBwjxGymC5BTimuoRP+YA4VaSwXyX10p6TeKASg5jiHLnx7Anz+nqB5HUuc1LgMavCXY+SzKZUeyIcEPgTAXF7sGiDxVKMSmont+l6+6RPWrW51ZvP9k3F5GguhNcI9kYyVyIfgcYzPxYEtSgKUs8UOd9RM154yOtjVGM27j9BTmgd/KTYZ4bx9jgZAwTQL4Y5OtDSNuIG7+LS4evzcKDUdXE3mrvA7cHsxhaurOqgLzWGZrN13uC5GOJp3HUUAHMlgRP9kcivL9WSAfppNz5GFBA48zcxM 8W7sZOxg 0+495snQWrLBIHEW70Ozmgrz8khq/EOY6IIB00E4hsOQe6Oe16/3HC7Er3RBvcLYRGu+pjUo+d2Tgs11131sHCwdx2WCNK/IguHHIP0TWV7CoDdZFMl/lsXiK5YLix+0KIlVmjaZNbBVsuAq6r7+xGQSO1XXfwJ3W7j+CF4Rbs2Nz4+5gC/UPcqiCDTxuS+2JTCEV3vOFqrYKrNc63hC73fCgMDaH7SkhTSM/WLvwtCEsShdBZrT2tue1vBK4qCEs6u6LKLn0miuVKLA2GtolpS1oCkGjIbVBZTxkD+y3me86vyrki59uqnXwqw== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: Hi! On Tue 11-04-23 09:47:08, Carlos Maiolino wrote: > My apologies it took a while to get back to you on this one, I was > accumulating reviews before running through all of them. Sure, that is fine. > > > inode = shmem_get_inode(idmap, dir->i_sb, dir, mode, 0, VM_NORESERVE); > > > - if (inode) { > > > - error = security_inode_init_security(inode, dir, > > > - NULL, > > > - shmem_initxattrs, NULL); > > > - if (error && error != -EOPNOTSUPP) > > > - goto out_iput; > > > - error = simple_acl_create(dir, inode); > > > - if (error) > > > - goto out_iput; > > > - d_tmpfile(file, inode); > > > - } > > > + > > > + if (IS_ERR(inode)) > > > + return PTR_ERR(inode); > > > > This doesn't look correct. Previously, we've called > > finish_open_simple(file, error), now you just return error... Otherwise the > > patch looks good to me. > > I see what you mean. But, finish_open_simple() simply does: > > if (error) > return error; > > So, calling it with a non-zero value for error at most will just add another > function call into the stack. I see, I didn't look inside finish_open_simple() :). Well, it is at least inline function so actually no function call. > I'm not opposed to still call finish_open_simple() but I don't think it adds > anything. Yeah, the value of the call is questionable but given it takes 'error' argument only so that it could do that if (error) return error; dance, it seems to be very much expected it is called in error cases as well. > If you prefer it being called. I thought about adding a new label, something > like: > > if (IS_ERR(inode)) > goto err_out; > . > . > . > d_tmpfile(file, inode) > err_out: > return finish_open_simple(file, error) > . > . > . > > Would it work for you? Yeah, I'd prefer we keep calling finish_open_simple(). Adding a label for it is fine by me. Honza -- Jan Kara SUSE Labs, CR