aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ext2
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2011-07-26 14:34:40 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2011-07-26 14:34:40 -0400
commit2ac232f37fa0e8551856a575fe299c47b65b4d66 (patch)
tree58ff15ecdbc383415a82ea678e5191db16a479f3 /fs/ext2
parentfa8f53ace4af9470d8414427cb3dc3c0ffc4f182 (diff)
parent5cf49d763eb141d236e92be6d4a0dc94e31fa886 (diff)
Merge branch 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs-2.6
* 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs-2.6: jbd: change the field "b_cow_tid" of struct journal_head from type unsigned to tid_t ext3.txt: update the links in the section "useful links" to the latest ones ext3: Fix data corruption in inodes with journalled data ext2: check xattr name_len before acquiring xattr_sem in ext2_xattr_get ext3: Fix compilation with -DDX_DEBUG quota: Remove unused declaration jbd: Use WRITE_SYNC in journal checkpoint. jbd: Fix oops in journal_remove_journal_head() ext3: Return -EINVAL when start is beyond the end of fs in ext3_trim_fs() ext3/ioctl.c: silence sparse warnings about different address spaces ext3/ext4 Documentation: remove bh/nobh since it has been deprecated ext3: Improve truncate error handling ext3: use proper little-endian bitops ext2: include fs.h into ext2_fs.h ext3: Fix oops in ext3_try_to_allocate_with_rsv() jbd: fix a bug of leaking jh->b_jcount jbd: remove dependency on __GFP_NOFAIL ext3: Convert ext3 to new truncate calling convention jbd: Add fixed tracepoints ext3: Add fixed tracepoints Resolve conflicts in fs/ext3/fsync.c due to fsync locking push-down and new fixed tracepoints.
Diffstat (limited to 'fs/ext2')
-rw-r--r--fs/ext2/xattr.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/fs/ext2/xattr.c b/fs/ext2/xattr.c
index 529970617a21..d27b71f1d183 100644
--- a/fs/ext2/xattr.c
+++ b/fs/ext2/xattr.c
@@ -161,6 +161,10 @@ ext2_xattr_get(struct inode *inode, int name_index, const char *name,
161 161
162 if (name == NULL) 162 if (name == NULL)
163 return -EINVAL; 163 return -EINVAL;
164 name_len = strlen(name);
165 if (name_len > 255)
166 return -ERANGE;
167
164 down_read(&EXT2_I(inode)->xattr_sem); 168 down_read(&EXT2_I(inode)->xattr_sem);
165 error = -ENODATA; 169 error = -ENODATA;
166 if (!EXT2_I(inode)->i_file_acl) 170 if (!EXT2_I(inode)->i_file_acl)
@@ -181,12 +185,8 @@ bad_block: ext2_error(inode->i_sb, "ext2_xattr_get",
181 error = -EIO; 185 error = -EIO;
182 goto cleanup; 186 goto cleanup;
183 } 187 }
184 /* find named attribute */
185 name_len = strlen(name);
186 188
187 error = -ERANGE; 189 /* find named attribute */
188 if (name_len > 255)
189 goto cleanup;
190 entry = FIRST_ENTRY(bh); 190 entry = FIRST_ENTRY(bh);
191 while (!IS_LAST_ENTRY(entry)) { 191 while (!IS_LAST_ENTRY(entry)) {
192 struct ext2_xattr_entry *next = 192 struct ext2_xattr_entry *next =