Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp3850843imw; Mon, 18 Jul 2022 16:00:23 -0700 (PDT) X-Google-Smtp-Source: AGRyM1tTevR17REQSo+y8LiHflIFuqi5qUnsG5PGXEAof87hNG4Mr5nmQS2GfsfZMxKOvPFvzcra X-Received: by 2002:a63:5903:0:b0:41a:767:7adc with SMTP id n3-20020a635903000000b0041a07677adcmr10468435pgb.615.1658185223614; Mon, 18 Jul 2022 16:00:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1658185223; cv=none; d=google.com; s=arc-20160816; b=rTHNs8wGIXqs2E3a0XjYP/jUJSzC1hI3IcelUV4tB6eFZY61MCGsbF0rTm9wsQPLeK 1xK4ent/71tIWs7Duf7QC5kuEL2YAMPK+VUJvuqQ2elczgmmdCUF7j8YPLXjY2XvUKSj sjie7pIDCYFH2MT+FNUA2dkx94koaThTQRB2FYwHuHhrOE8EynlBjYcsyTWsnHZePMN4 GfbPTt1pP8Vq63khSl/5VOaDhLdYla6fxloj+E91AaIRKhrjbr+DiEj3lNupu69ZduVe 7yBtVFaiy2RgRAMwVCXbG3NhLG2ZPglKp0pTj766nCthJgmVdvCbjk5gVDZjhUyx5bO+ a1zw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=KprportAAt1qmpYGGIT6zYw3dSvynBKGP6rOIQA38JA=; b=jhgzTSRhRWguJVNx1yQQ+mPRDETvIVZK4nNbrcRndYQJ1UIOhy7gmb+vN8pvkg1Yau 10s4co1Tb4Ih0j1h4H0KTfAFyiYWSG7ZpW8i4tcZHEzjkTgEwoH2YfrhofmV+sMB8DRM rdAmU2jRtVX6P6Km9GS1jtyLWX7Xty7zOdmZSv1fruCnFDoQ/n16UGynMLY6ZwDbyWeB +r2Ie4rb0swV43YZ2JZkmMr+5hjefLSgCg16jFpOUJYgu0EVoRKWplnWnAjgA8Pg8Dw/ AjEEIQTZWpgiPPKcDlN+tJ0MRkuUtAklAUH5XFb/t5HGiZ0Z8HBljtDl2Hai50+Ao+ZI UqGA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=korg header.b=kjUkzVIG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 184-20020a6302c1000000b0041a29a161cbsi6095551pgc.68.2022.07.18.16.00.08; Mon, 18 Jul 2022 16:00:23 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=korg header.b=kjUkzVIG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235865AbiGRWyR (ORCPT + 99 others); Mon, 18 Jul 2022 18:54:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51170 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231194AbiGRWyP (ORCPT ); Mon, 18 Jul 2022 18:54:15 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 057707673; Mon, 18 Jul 2022 15:54:15 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 8D5316155C; Mon, 18 Jul 2022 22:54:14 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 961D0C341C0; Mon, 18 Jul 2022 22:54:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1658184853; bh=Gys8VwNKIenWK94lJnGxUsyVbkTx49TEjms99sZJBGo=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=kjUkzVIGebDzjAUSsNXLbnbcBsfe78jP7ucZq9KYsGCAWn9DjkyLV3l7l52Ldw7yg cjQ2XkTgP0zmjVYGk+VN3Rx5pWfG8OkFY+hTCCmcJXXCyNWzUtbUyis63QTgYeSB4e KzJqFF766l5jOvlytC16nlcANeVhXeQN1v1b82T4= Date: Mon, 18 Jul 2022 15:54:12 -0700 From: Andrew Morton To: Stephen Rothwell Cc: "Theodore Ts'o" , Linux Kernel Mailing List , Linux Next Mailing List Subject: Re: linux-next: build warning after merge of the mm tree Message-Id: <20220718155412.fe6a624ec067ef603bbf0cd8@linux-foundation.org> In-Reply-To: <20220718202815.11807e92@canb.auug.org.au> References: <20220718202815.11807e92@canb.auug.org.au> X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.33; x86_64-redhat-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 18 Jul 2022 20:28:15 +1000 Stephen Rothwell wrote: > After merging the mm tree, today's linux-next build (powerpc > ppc44x_defconfig) produced this warning: > > mm/shmem.c:2848:12: warning: 'shmem_fileattr_set' defined but not used [-Wunused-function] > 2848 | static int shmem_fileattr_set(struct user_namespace *mnt_userns, > | ^~~~~~~~~~~~~~~~~~ > mm/shmem.c:2839:12: warning: 'shmem_fileattr_get' defined but not used [-Wunused-function] > 2839 | static int shmem_fileattr_get(struct dentry *dentry, struct fileattr *fa) > | ^~~~~~~~~~~~~~~~~~ > > Introduced by commit > > 8673852551f0 ("mm/shmem: support FS_IOC_[SG]ETFLAGS in tmpfs") Thanks, I moved the definitions inside the appropriate ifdef. --- a/mm/shmem.c~mm-shmem-support-fs_ioc_etflags-in-tmpfs-fix +++ a/mm/shmem.c @@ -2837,39 +2837,6 @@ out: return error; } -static int shmem_fileattr_get(struct dentry *dentry, struct fileattr *fa) -{ - struct shmem_inode_info *info = SHMEM_I(d_inode(dentry)); - - fileattr_fill_flags(fa, info->fsflags & SHMEM_FL_USER_VISIBLE); - - return 0; -} - -static int shmem_fileattr_set(struct user_namespace *mnt_userns, - struct dentry *dentry, struct fileattr *fa) -{ - struct inode *inode = d_inode(dentry); - struct shmem_inode_info *info = SHMEM_I(inode); - - if (fileattr_has_fsx(fa)) - return -EOPNOTSUPP; - - info->fsflags = (info->fsflags & ~SHMEM_FL_USER_MODIFIABLE) | - (fa->flags & SHMEM_FL_USER_MODIFIABLE); - - inode->i_flags &= ~(S_APPEND | S_IMMUTABLE | S_NOATIME); - if (info->fsflags & FS_APPEND_FL) - inode->i_flags |= S_APPEND; - if (info->fsflags & FS_IMMUTABLE_FL) - inode->i_flags |= S_IMMUTABLE; - if (info->fsflags & FS_NOATIME_FL) - inode->i_flags |= S_NOATIME; - - inode->i_ctime = current_time(inode); - return 0; -} - static int shmem_statfs(struct dentry *dentry, struct kstatfs *buf) { struct shmem_sb_info *sbinfo = SHMEM_SB(dentry->d_sb); @@ -3195,6 +3162,40 @@ static const char *shmem_get_link(struct } #ifdef CONFIG_TMPFS_XATTR + +static int shmem_fileattr_get(struct dentry *dentry, struct fileattr *fa) +{ + struct shmem_inode_info *info = SHMEM_I(d_inode(dentry)); + + fileattr_fill_flags(fa, info->fsflags & SHMEM_FL_USER_VISIBLE); + + return 0; +} + +static int shmem_fileattr_set(struct user_namespace *mnt_userns, + struct dentry *dentry, struct fileattr *fa) +{ + struct inode *inode = d_inode(dentry); + struct shmem_inode_info *info = SHMEM_I(inode); + + if (fileattr_has_fsx(fa)) + return -EOPNOTSUPP; + + info->fsflags = (info->fsflags & ~SHMEM_FL_USER_MODIFIABLE) | + (fa->flags & SHMEM_FL_USER_MODIFIABLE); + + inode->i_flags &= ~(S_APPEND | S_IMMUTABLE | S_NOATIME); + if (info->fsflags & FS_APPEND_FL) + inode->i_flags |= S_APPEND; + if (info->fsflags & FS_IMMUTABLE_FL) + inode->i_flags |= S_IMMUTABLE; + if (info->fsflags & FS_NOATIME_FL) + inode->i_flags |= S_NOATIME; + + inode->i_ctime = current_time(inode); + return 0; +} + /* * Superblocks without xattr inode operations may get some security.* xattr * support from the LSM "for free". As soon as we have any other xattrs _