diff options
| -rw-r--r-- | fs/squashfs/xattr.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/fs/squashfs/xattr.c b/fs/squashfs/xattr.c index 14a2feef09b9..c7655e8b31cd 100644 --- a/fs/squashfs/xattr.c +++ b/fs/squashfs/xattr.c | |||
| @@ -145,8 +145,12 @@ static int squashfs_xattr_get(struct inode *inode, int name_index, | |||
| 145 | type = le16_to_cpu(entry.type); | 145 | type = le16_to_cpu(entry.type); |
| 146 | prefix = type & SQUASHFS_XATTR_PREFIX_MASK; | 146 | prefix = type & SQUASHFS_XATTR_PREFIX_MASK; |
| 147 | 147 | ||
| 148 | err = squashfs_read_metadata(sb, target, &start, &offset, | 148 | if (prefix == name_index && name_size == name_len) |
| 149 | name_size); | 149 | err = squashfs_read_metadata(sb, target, &start, |
| 150 | &offset, name_size); | ||
| 151 | else | ||
| 152 | err = squashfs_read_metadata(sb, NULL, &start, | ||
| 153 | &offset, name_size); | ||
| 150 | if (err < 0) | 154 | if (err < 0) |
| 151 | goto failed; | 155 | goto failed; |
| 152 | 156 | ||
