From mboxrd@z Thu Jan 1 00:00:00 1970 From: Charles Manning Subject: Too many security check reads to getxattr? Date: Tue, 31 Aug 2010 13:24:01 +1200 Message-ID: <201008311324.01178.manningc2@actrix.gen.nz> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: linux-fsdevel@vger.kernel.org Return-path: Received: from smtp.scorch.co.nz ([27.110.127.199]:42191 "HELO scorch.co.nz" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with SMTP id S1756426Ab0HaBap (ORCPT ); Mon, 30 Aug 2010 21:30:45 -0400 Content-Disposition: inline Sender: linux-fsdevel-owner@vger.kernel.org List-ID: I'm investigating a performance degradation in yaffs when xattribs are enabled. Yes, I know yaffs is not part of mainline Linux yet, but this is really a vfs question. What I notice is that on every write the "security.capability" xattribute gets checked. Surely once the vfs has tried reading this once it should not try again on every write. Herewith a call stack [ 2317.288740] [] yaffs_getxattr+0x27/0xa0 [yaffs2] [ 2317.288746] [] ? yaffs_getxattr+0x0/0xa0 [yaffs2] [ 2317.288750] [] cap_inode_need_killpriv+0x37/0x50 [ 2317.288753] [] security_inode_need_killpriv+0x14/0x20 [ 2317.288757] [] file_remove_suid+0x1d/0x60 [ 2317.288761] [] __generic_file_aio_write+0x25a/0x550 [ 2317.288764] [] ? link_path_walk+0x42f/0x9b0 [ 2317.288768] [] ? dput+0x6f/0xd0 [ 2317.288772] [] generic_file_aio_write+0x58/0xc0 [ 2317.288775] [] do_sync_write+0xb9/0xf0 [ 2317.288779] [] ? cp_new_stat64+0xe4/0x100 [ 2317.288783] [] ? apparmor_file_permission+0x16/0x20 [ 2317.288786] [] ? security_file_permission+0x1d/0x80 [ 2317.288790] [] ? rw_verify_area+0x71/0xe0 [ 2317.288793] [] vfs_write+0x9b/0x160 [ 2317.288796] [] ? do_sync_write+0x0/0xf0 [ 2317.288800] [] sys_write+0x42/0x70 [ 2317.288803] [] sysenter_do_call+0x12/0x28 [ 2317.288806] yaffs_getxattr "security.capability" from object 257 Any hints as to why this is happening and how to stop this from happening? Thanks -- Charles