From: Jeff Mahoney Date: Tue, 5 May 2009 19:30:16 +0000 (-0400) Subject: reiserfs: dont associate security.* with xattr files X-Git-Tag: upstream/snapshot3+hdmi~18891^2~17 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=b82bb72ba7df473461c5e2368a4e7497c8ce76e9;p=platform%2Fadaptation%2Frenesas_rcar%2Frenesas_kernel.git reiserfs: dont associate security.* with xattr files The security.* xattrs are ignored for xattr files, so don't create them. Signed-off-by: Jeff Mahoney Signed-off-by: Al Viro --- diff --git a/fs/reiserfs/xattr_security.c b/fs/reiserfs/xattr_security.c index 4d3c20e..a92c879 100644 --- a/fs/reiserfs/xattr_security.c +++ b/fs/reiserfs/xattr_security.c @@ -55,8 +55,16 @@ int reiserfs_security_init(struct inode *dir, struct inode *inode, struct reiserfs_security_handle *sec) { int blocks = 0; - int error = security_inode_init_security(inode, dir, &sec->name, - &sec->value, &sec->length); + int error; + + sec->name = NULL; + + /* Don't add selinux attributes on xattrs - they'll never get used */ + if (IS_PRIVATE(dir)) + return 0; + + error = security_inode_init_security(inode, dir, &sec->name, + &sec->value, &sec->length); if (error) { if (error == -EOPNOTSUPP) error = 0;