Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755371Ab2ENJfK (ORCPT ); Mon, 14 May 2012 05:35:10 -0400 Received: from mail-pz0-f46.google.com ([209.85.210.46]:44351 "EHLO mail-pz0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754984Ab2ENJfI (ORCPT ); Mon, 14 May 2012 05:35:08 -0400 Message-ID: <4FB0D1C6.7090801@gmail.com> Date: Mon, 14 May 2012 17:35:02 +0800 From: Cong Wang User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:12.0) Gecko/20120430 Thunderbird/12.0.1 MIME-Version: 1.0 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 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: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1220 Lines: 36 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 from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/