aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
Diffstat (limited to 'fs')
-rw-r--r--fs/ocfs2/xattr.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/fs/ocfs2/xattr.c b/fs/ocfs2/xattr.c
index 70baffeb1812..054e2efb0b7e 100644
--- a/fs/ocfs2/xattr.c
+++ b/fs/ocfs2/xattr.c
@@ -777,6 +777,11 @@ static int ocfs2_xattr_block_get(struct inode *inode,
777 goto cleanup; 777 goto cleanup;
778 } 778 }
779 779
780 if (xs->not_found) {
781 ret = -ENODATA;
782 goto cleanup;
783 }
784
780 xb = (struct ocfs2_xattr_block *)xs->xattr_bh->b_data; 785 xb = (struct ocfs2_xattr_block *)xs->xattr_bh->b_data;
781 size = le64_to_cpu(xs->here->xe_value_size); 786 size = le64_to_cpu(xs->here->xe_value_size);
782 if (buffer) { 787 if (buffer) {
@@ -860,7 +865,7 @@ static int ocfs2_xattr_get(struct inode *inode,
860 down_read(&oi->ip_xattr_sem); 865 down_read(&oi->ip_xattr_sem);
861 ret = ocfs2_xattr_ibody_get(inode, name_index, name, buffer, 866 ret = ocfs2_xattr_ibody_get(inode, name_index, name, buffer,
862 buffer_size, &xis); 867 buffer_size, &xis);
863 if (ret == -ENODATA) 868 if (ret == -ENODATA && di->i_xattr_loc)
864 ret = ocfs2_xattr_block_get(inode, name_index, name, buffer, 869 ret = ocfs2_xattr_block_get(inode, name_index, name, buffer,
865 buffer_size, &xbs); 870 buffer_size, &xbs);
866 up_read(&oi->ip_xattr_sem); 871 up_read(&oi->ip_xattr_sem);