diff options
Diffstat (limited to 'fs/ext4/xattr.c')
-rw-r--r-- | fs/ext4/xattr.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/fs/ext4/xattr.c b/fs/ext4/xattr.c index 4eec399ec807..e7387337060c 100644 --- a/fs/ext4/xattr.c +++ b/fs/ext4/xattr.c | |||
@@ -369,6 +369,9 @@ ext4_xattr_get(struct inode *inode, int name_index, const char *name, | |||
369 | { | 369 | { |
370 | int error; | 370 | int error; |
371 | 371 | ||
372 | if (strlen(name) > 255) | ||
373 | return -ERANGE; | ||
374 | |||
372 | down_read(&EXT4_I(inode)->xattr_sem); | 375 | down_read(&EXT4_I(inode)->xattr_sem); |
373 | error = ext4_xattr_ibody_get(inode, name_index, name, buffer, | 376 | error = ext4_xattr_ibody_get(inode, name_index, name, buffer, |
374 | buffer_size); | 377 | buffer_size); |
@@ -513,6 +516,7 @@ static void ext4_xattr_update_super_block(handle_t *handle, | |||
513 | if (EXT4_HAS_COMPAT_FEATURE(sb, EXT4_FEATURE_COMPAT_EXT_ATTR)) | 516 | if (EXT4_HAS_COMPAT_FEATURE(sb, EXT4_FEATURE_COMPAT_EXT_ATTR)) |
514 | return; | 517 | return; |
515 | 518 | ||
519 | BUFFER_TRACE(EXT4_SB(sb)->s_sbh, "get_write_access"); | ||
516 | if (ext4_journal_get_write_access(handle, EXT4_SB(sb)->s_sbh) == 0) { | 520 | if (ext4_journal_get_write_access(handle, EXT4_SB(sb)->s_sbh) == 0) { |
517 | EXT4_SET_COMPAT_FEATURE(sb, EXT4_FEATURE_COMPAT_EXT_ATTR); | 521 | EXT4_SET_COMPAT_FEATURE(sb, EXT4_FEATURE_COMPAT_EXT_ATTR); |
518 | ext4_handle_dirty_super(handle, sb); | 522 | ext4_handle_dirty_super(handle, sb); |
@@ -532,6 +536,7 @@ ext4_xattr_release_block(handle_t *handle, struct inode *inode, | |||
532 | struct mb_cache *ext4_mb_cache = EXT4_GET_MB_CACHE(inode); | 536 | struct mb_cache *ext4_mb_cache = EXT4_GET_MB_CACHE(inode); |
533 | 537 | ||
534 | ce = mb_cache_entry_get(ext4_mb_cache, bh->b_bdev, bh->b_blocknr); | 538 | ce = mb_cache_entry_get(ext4_mb_cache, bh->b_bdev, bh->b_blocknr); |
539 | BUFFER_TRACE(bh, "get_write_access"); | ||
535 | error = ext4_journal_get_write_access(handle, bh); | 540 | error = ext4_journal_get_write_access(handle, bh); |
536 | if (error) | 541 | if (error) |
537 | goto out; | 542 | goto out; |
@@ -774,6 +779,7 @@ ext4_xattr_block_set(handle_t *handle, struct inode *inode, | |||
774 | if (s->base) { | 779 | if (s->base) { |
775 | ce = mb_cache_entry_get(ext4_mb_cache, bs->bh->b_bdev, | 780 | ce = mb_cache_entry_get(ext4_mb_cache, bs->bh->b_bdev, |
776 | bs->bh->b_blocknr); | 781 | bs->bh->b_blocknr); |
782 | BUFFER_TRACE(bs->bh, "get_write_access"); | ||
777 | error = ext4_journal_get_write_access(handle, bs->bh); | 783 | error = ext4_journal_get_write_access(handle, bs->bh); |
778 | if (error) | 784 | if (error) |
779 | goto cleanup; | 785 | goto cleanup; |
@@ -859,6 +865,7 @@ inserted: | |||
859 | EXT4_C2B(EXT4_SB(sb), 1)); | 865 | EXT4_C2B(EXT4_SB(sb), 1)); |
860 | if (error) | 866 | if (error) |
861 | goto cleanup; | 867 | goto cleanup; |
868 | BUFFER_TRACE(new_bh, "get_write_access"); | ||
862 | error = ext4_journal_get_write_access(handle, | 869 | error = ext4_journal_get_write_access(handle, |
863 | new_bh); | 870 | new_bh); |
864 | if (error) | 871 | if (error) |
@@ -896,7 +903,7 @@ inserted: | |||
896 | * take i_data_sem because we will test | 903 | * take i_data_sem because we will test |
897 | * i_delalloc_reserved_flag in ext4_mb_new_blocks | 904 | * i_delalloc_reserved_flag in ext4_mb_new_blocks |
898 | */ | 905 | */ |
899 | down_read((&EXT4_I(inode)->i_data_sem)); | 906 | down_read(&EXT4_I(inode)->i_data_sem); |
900 | block = ext4_new_meta_blocks(handle, inode, goal, 0, | 907 | block = ext4_new_meta_blocks(handle, inode, goal, 0, |
901 | NULL, &error); | 908 | NULL, &error); |
902 | up_read((&EXT4_I(inode)->i_data_sem)); | 909 | up_read((&EXT4_I(inode)->i_data_sem)); |