summaryrefslogtreecommitdiffstats
path: root/fs/ocfs2/xattr.c
diff options
context:
space:
mode:
authorTiger Yang <tiger.yang@oracle.com>2008-08-18 17:11:46 +0800
committerMark Fasheh <mfasheh@suse.com>2008-10-13 16:57:03 -0700
commit8154da3d2114241cf3edb108b43e2172be86d483 (patch)
treea6d1c1652469d9a34b50dbdab4a435376bf3f32c /fs/ocfs2/xattr.c
parenta394425643e1e9c3a624d629fc8ba5633d8474c6 (diff)
downloadlinux-8154da3d2114241cf3edb108b43e2172be86d483.tar.bz2
ocfs2: Add incompatible flag for extended attribute
This patch adds the s_incompat flag for extended attribute support. This helps us ensure that older versions of Ocfs2 or ocfs2-tools will not be able to mount a volume with xattr support. Signed-off-by: Tiger Yang <tiger.yang@oracle.com> Signed-off-by: Mark Fasheh <mfasheh@suse.com>
Diffstat (limited to 'fs/ocfs2/xattr.c')
-rw-r--r--fs/ocfs2/xattr.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/fs/ocfs2/xattr.c b/fs/ocfs2/xattr.c
index 9ec7136b3ad7..090449f9263e 100644
--- a/fs/ocfs2/xattr.c
+++ b/fs/ocfs2/xattr.c
@@ -564,6 +564,9 @@ ssize_t ocfs2_listxattr(struct dentry *dentry,
struct ocfs2_dinode *di = NULL;
struct ocfs2_inode_info *oi = OCFS2_I(dentry->d_inode);
+ if (!ocfs2_supports_xattr(OCFS2_SB(dentry->d_sb)))
+ return -EOPNOTSUPP;
+
if (!(oi->ip_dyn_features & OCFS2_HAS_XATTR_FL))
return ret;
@@ -843,6 +846,9 @@ int ocfs2_xattr_get(struct inode *inode,
.not_found = -ENODATA,
};
+ if (!ocfs2_supports_xattr(OCFS2_SB(inode->i_sb)))
+ return -EOPNOTSUPP;
+
if (!(oi->ip_dyn_features & OCFS2_HAS_XATTR_FL))
ret = -ENODATA;
@@ -1541,6 +1547,9 @@ int ocfs2_xattr_remove(struct inode *inode, struct buffer_head *di_bh)
handle_t *handle;
int ret;
+ if (!ocfs2_supports_xattr(OCFS2_SB(inode->i_sb)))
+ return 0;
+
if (!(oi->ip_dyn_features & OCFS2_HAS_XATTR_FL))
return 0;
@@ -1977,6 +1986,9 @@ int ocfs2_xattr_set(struct inode *inode,
.not_found = -ENODATA,
};
+ if (!ocfs2_supports_xattr(OCFS2_SB(inode->i_sb)))
+ return -EOPNOTSUPP;
+
ret = ocfs2_inode_lock(inode, &di_bh, 1);
if (ret < 0) {
mlog_errno(ret);