From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from psmtp.com (na3sys010amx117.postini.com [74.125.245.117]) by kanga.kvack.org (Postfix) with SMTP id D2DA96B004D for ; Mon, 14 May 2012 05:35:08 -0400 (EDT) Received: by dakp5 with SMTP id p5so8211952dak.14 for ; Mon, 14 May 2012 02:35:08 -0700 (PDT) Message-ID: <4FB0D1C6.7090801@gmail.com> Date: Mon, 14 May 2012 17:35:02 +0800 From: Cong Wang MIME-Version: 1.0 Subject: Re: [PATCH 2/10] tmpfs: enable NOSEC optimization References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Sender: owner-linux-mm@kvack.org List-ID: To: Hugh Dickins Cc: Andrew Morton , Christoph Hellwig , Andi Kleen , Al Viro , linux-mm@kvack.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org On 05/12/2012 08:02 PM, Hugh Dickins wrote: > Let tmpfs into the NOSEC optimization (avoiding file_remove_suid() > overhead on most common writes): set MS_NOSEC on its superblocks. > > Signed-off-by: Hugh Dickins > --- > mm/shmem.c | 1 + > 1 file changed, 1 insertion(+) > > --- 3045N.orig/mm/shmem.c 2012-05-05 10:45:17.888060878 -0700 > +++ 3045N/mm/shmem.c 2012-05-05 10:46:05.732062006 -0700 > @@ -2361,6 +2361,7 @@ int shmem_fill_super(struct super_block > } > } > sb->s_export_op =&shmem_export_ops; > + sb->s_flags |= MS_NOSEC; Isn't setting the flag on inode better? Something like: diff --git a/mm/shmem.c b/mm/shmem.c index f99ff3e..7d98fb5 100644 --- a/mm/shmem.c +++ b/mm/shmem.c @@ -2325,6 +2325,7 @@ static void shmem_init_inode(void *foo) { struct shmem_inode_info *info = foo; inode_init_once(&info->vfs_inode); + info->vfs_inode.i_flags |= S_NOSEC; } static int shmem_init_inodecache(void) -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/ Don't email: email@kvack.org