From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; dkim=none Received: from smtp-out1.suse.de (smtp-out1.suse.de [IPv6:2a07:de40:b251:101:10:150:64:1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 99BDDD48 for ; Wed, 29 Nov 2023 04:01:21 -0800 (PST) Received: from imap2.dmz-prg2.suse.org (imap2.dmz-prg2.suse.org [IPv6:2a07:de40:b281:104: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 07C5F21ACF; Wed, 29 Nov 2023 12:01:20 +0000 (UTC) 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 E3F611376F; Wed, 29 Nov 2023 12:01:19 +0000 (UTC) Received: from dovecot-director2.suse.de ([10.150.64.162]) by imap2.dmz-prg2.suse.org with ESMTPSA id OLxpNw8oZ2WXAgAAn2gu4w (envelope-from ); Wed, 29 Nov 2023 12:01:19 +0000 Date: Wed, 29 Nov 2023 12:54:06 +0100 From: David Sterba To: Anand Jain Cc: David Sterba , linux-btrfs@vger.kernel.org Subject: Re: [PATCH] btrfs: allocate btrfs_inode::file_extent_tree only without NO_HOLES Message-ID: <20231129115406.GO18929@twin.jikos.cz> Reply-To: dsterba@suse.cz References: <20231128212307.1838-1-dsterba@suse.com> <35b15f56-c687-d68e-a0f3-aba8445c8ed7@oracle.com> Precedence: bulk X-Mailing-List: linux-btrfs@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <35b15f56-c687-d68e-a0f3-aba8445c8ed7@oracle.com> User-Agent: Mutt/1.5.23.1-rc1 (2014-03-12) X-Spamd-Bar: ++++++++++++++ X-Spam-Score: 14.51 X-Rspamd-Server: rspamd1 Authentication-Results: smtp-out1.suse.de; dkim=none; spf=softfail (smtp-out1.suse.de: 2a07:de40:b281:104:10:150:64:98 is neither permitted nor denied by domain of dsterba@suse.cz) smtp.mailfrom=dsterba@suse.cz; dmarc=none X-Rspamd-Queue-Id: 07C5F21ACF X-Spamd-Result: default: False [14.51 / 50.00]; ARC_NA(0.00)[]; HAS_REPLYTO(0.30)[dsterba@suse.cz]; RCVD_VIA_SMTP_AUTH(0.00)[]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; TO_DN_SOME(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; REPLYTO_ADDR_EQ_FROM(0.00)[]; DMARC_NA(1.20)[suse.cz]; R_SPF_SOFTFAIL(4.60)[~all:c]; NEURAL_SPAM_SHORT(2.82)[0.939]; SPAMHAUS_XBL(0.00)[2a07:de40:b281:104:10:150:64:98:from]; RCVD_COUNT_THREE(0.00)[3]; MX_GOOD(-0.01)[]; NEURAL_SPAM_LONG(3.50)[1.000]; FUZZY_BLOCKED(0.00)[rspamd.com]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(2.20)[]; MIME_TRACE(0.00)[0:+]; RCVD_TLS_ALL(0.00)[]; BAYES_HAM(-0.00)[18.27%] On Wed, Nov 29, 2023 at 05:21:44PM +0800, Anand Jain wrote: > On 29/11/2023 05:23, David Sterba wrote: > > The file_extent_tree was added in 41a2ee75aab0 ("btrfs: introduce > > per-inode file extent tree") so we have an explicit mapping of the file > > extents to know where it is safe to update i_size. When the feature > > NO_HOLES is enabled, and it's been a mkfs default since 5.15, the tree > > is not necessary. > > > > To save some space in the inode, allocate the tree only when necessary. > > I don't see how the free is taken care? Does it memleak? Yes, there's kfree call missing in btrfs_free_inode(), thanks.