]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
ocfs2: Add xattr support checking in init_security
authorTiger Yang <tiger.yang@oracle.com>
Wed, 17 Dec 2008 02:22:56 +0000 (10:22 +0800)
committerMark Fasheh <mfasheh@suse.com>
Mon, 5 Jan 2009 16:40:36 +0000 (08:40 -0800)
We must check whether ocfs2 volume support xattr in init_security,
if not support xattr and security is enable, would cause failure of mknod.

Signed-off-by: Tiger Yang <tiger.yang@oracle.com>
Signed-off-by: Mark Fasheh <mfasheh@suse.com>
fs/ocfs2/xattr.c

index 095b0bb6e590ab10178887c4cdea8b8610583e5a..e1d638af6ac3d00d8cb72a5b9b442c3bdfb8e3f0 100644 (file)
@@ -5324,6 +5324,9 @@ int ocfs2_init_security_get(struct inode *inode,
                            struct inode *dir,
                            struct ocfs2_security_xattr_info *si)
 {
+       /* check whether ocfs2 support feature xattr */
+       if (!ocfs2_supports_xattr(OCFS2_SB(dir->i_sb)))
+               return -EOPNOTSUPP;
        return security_inode_init_security(inode, dir, &si->name, &si->value,
                                            &si->value_len);
 }