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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 11BC2C001B0 for ; Wed, 9 Aug 2023 11:37:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234107AbjHILhi (ORCPT ); Wed, 9 Aug 2023 07:37:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36508 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234101AbjHILhh (ORCPT ); Wed, 9 Aug 2023 07:37:37 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 92C2EE3 for ; Wed, 9 Aug 2023 04:37:37 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 3032263578 for ; Wed, 9 Aug 2023 11:37:37 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A193DC433CC; Wed, 9 Aug 2023 11:37:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1691581056; bh=FJoooeg67aJXJ8sAVmKmUGj9XYVpvc9JajYCjM5Bi7g=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=nrzJgK9G81CHt7hGXMFo5ihY80acXwrKdKHgIKVPWAQbJjH468Az5Wnc6YkmJvfiW PnbOBOfth+0IqNCdMzVP2PSa62X1vQWb3loqsYgkkNFMI/k/ucmeAC5BFMIAa5xZeP V68HUgZR5F6Xxa59UXj/Bt2Z7/Z8bi3+svuDOToxUyy+WFRE8PYL/+BCd9z7AsuY30 vSZDM7R2rjgm1ohWWQtCRNfH4K/MysnbMUTbTuoVnxCTGFQrb2DbfCY0epFfM6gIuW jS4Gox3BHI61SrCp8PHjUaSuDiSox1gc71h3tppcVJ+Rnhr5PsxxiPkFTQlu9ESj29 97nn65CCuUs8w== Date: Wed, 9 Aug 2023 13:37:29 +0200 From: Christian Brauner To: Hugh Dickins Cc: Andrew Morton , Oleksandr Tymoshenko , Carlos Maiolino , Jeff Layton , Chuck Lever , Jan Kara , Miklos Szeredi , Daniel Xu , Chris Down , Tejun Heo , Greg Kroah-Hartman , Matthew Wilcox , Christoph Hellwig , Pete Zaitcev , Helge Deller , Topi Miettinen , Yu Kuai , linux-fsdevel@vger.kernel.org, linux-mm@kvack.org Subject: Re: [PATCH vfs.tmpfs 1/5] xattr: simple_xattr_set() return old_xattr to be freed Message-ID: <20230809-freuden-genom-9a00d6e5158d@brauner> References: <158c6585-2aa7-d4aa-90ff-f7c3f8fe407c@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <158c6585-2aa7-d4aa-90ff-f7c3f8fe407c@google.com> Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org On Tue, Aug 08, 2023 at 09:30:59PM -0700, Hugh Dickins wrote: > tmpfs wants to support limited user extended attributes, but kernfs > (or cgroupfs, the only kernfs with KERNFS_ROOT_SUPPORT_USER_XATTR) > already supports user extended attributes through simple xattrs: but > limited by a policy (128KiB per inode) too liberal to be used on tmpfs. > > To allow a different limiting policy for tmpfs, without affecting the > policy for kernfs, change simple_xattr_set() to return the replaced or > removed xattr (if any), leaving the caller to update their accounting > then free the xattr (by simple_xattr_free(), renamed from the static > free_simple_xattr()). > > Signed-off-by: Hugh Dickins > --- Seems good enough, Reviewed-by: Christian Brauner