diff options
Diffstat (limited to 'fs/ext4')
-rw-r--r-- | fs/ext4/acl.c | 2 | ||||
-rw-r--r-- | fs/ext4/ext4.h | 12 | ||||
-rw-r--r-- | fs/ext4/extents.c | 4 | ||||
-rw-r--r-- | fs/ext4/ialloc.c | 2 | ||||
-rw-r--r-- | fs/ext4/inode.c | 4 | ||||
-rw-r--r-- | fs/ext4/ioctl.c | 8 | ||||
-rw-r--r-- | fs/ext4/namei.c | 7 | ||||
-rw-r--r-- | fs/ext4/page-io.c | 3 | ||||
-rw-r--r-- | fs/ext4/super.c | 9 | ||||
-rw-r--r-- | fs/ext4/xattr.h | 4 | ||||
-rw-r--r-- | fs/ext4/xattr_security.c | 5 |
11 files changed, 28 insertions, 32 deletions
diff --git a/fs/ext4/acl.c b/fs/ext4/acl.c index e0270d1f8d82..21eacd7b7d79 100644 --- a/fs/ext4/acl.c +++ b/fs/ext4/acl.c | |||
@@ -433,7 +433,7 @@ ext4_xattr_set_acl(struct dentry *dentry, const char *name, const void *value, | |||
433 | return -EINVAL; | 433 | return -EINVAL; |
434 | if (!test_opt(inode->i_sb, POSIX_ACL)) | 434 | if (!test_opt(inode->i_sb, POSIX_ACL)) |
435 | return -EOPNOTSUPP; | 435 | return -EOPNOTSUPP; |
436 | if (!is_owner_or_cap(inode)) | 436 | if (!inode_owner_or_capable(inode)) |
437 | return -EPERM; | 437 | return -EPERM; |
438 | 438 | ||
439 | if (value) { | 439 | if (value) { |
diff --git a/fs/ext4/ext4.h b/fs/ext4/ext4.h index 3aa0b72b3b94..4daaf2b753f4 100644 --- a/fs/ext4/ext4.h +++ b/fs/ext4/ext4.h | |||
@@ -923,14 +923,14 @@ struct ext4_inode_info { | |||
923 | #define test_opt2(sb, opt) (EXT4_SB(sb)->s_mount_opt2 & \ | 923 | #define test_opt2(sb, opt) (EXT4_SB(sb)->s_mount_opt2 & \ |
924 | EXT4_MOUNT2_##opt) | 924 | EXT4_MOUNT2_##opt) |
925 | 925 | ||
926 | #define ext4_set_bit ext2_set_bit | 926 | #define ext4_set_bit __test_and_set_bit_le |
927 | #define ext4_set_bit_atomic ext2_set_bit_atomic | 927 | #define ext4_set_bit_atomic ext2_set_bit_atomic |
928 | #define ext4_clear_bit ext2_clear_bit | 928 | #define ext4_clear_bit __test_and_clear_bit_le |
929 | #define ext4_clear_bit_atomic ext2_clear_bit_atomic | 929 | #define ext4_clear_bit_atomic ext2_clear_bit_atomic |
930 | #define ext4_test_bit ext2_test_bit | 930 | #define ext4_test_bit test_bit_le |
931 | #define ext4_find_first_zero_bit ext2_find_first_zero_bit | 931 | #define ext4_find_first_zero_bit find_first_zero_bit_le |
932 | #define ext4_find_next_zero_bit ext2_find_next_zero_bit | 932 | #define ext4_find_next_zero_bit find_next_zero_bit_le |
933 | #define ext4_find_next_bit ext2_find_next_bit | 933 | #define ext4_find_next_bit find_next_bit_le |
934 | 934 | ||
935 | /* | 935 | /* |
936 | * Maximal mount counts between two filesystem checks | 936 | * Maximal mount counts between two filesystem checks |
diff --git a/fs/ext4/extents.c b/fs/ext4/extents.c index 1763d1ab9ea9..dd2cb5076ff9 100644 --- a/fs/ext4/extents.c +++ b/fs/ext4/extents.c | |||
@@ -133,7 +133,7 @@ static ext4_fsblk_t ext4_ext_find_goal(struct inode *inode, | |||
133 | * fragmenting the file system's free space. Maybe we | 133 | * fragmenting the file system's free space. Maybe we |
134 | * should have some hueristics or some way to allow | 134 | * should have some hueristics or some way to allow |
135 | * userspace to pass a hint to file system, | 135 | * userspace to pass a hint to file system, |
136 | * especiially if the latter case turns out to be | 136 | * especially if the latter case turns out to be |
137 | * common. | 137 | * common. |
138 | */ | 138 | */ |
139 | ex = path[depth].p_ext; | 139 | ex = path[depth].p_ext; |
@@ -2848,7 +2848,7 @@ fix_extent_len: | |||
2848 | * ext4_get_blocks_dio_write() when DIO to write | 2848 | * ext4_get_blocks_dio_write() when DIO to write |
2849 | * to an uninitialized extent. | 2849 | * to an uninitialized extent. |
2850 | * | 2850 | * |
2851 | * Writing to an uninitized extent may result in splitting the uninitialized | 2851 | * Writing to an uninitialized extent may result in splitting the uninitialized |
2852 | * extent into multiple /initialized uninitialized extents (up to three) | 2852 | * extent into multiple /initialized uninitialized extents (up to three) |
2853 | * There are three possibilities: | 2853 | * There are three possibilities: |
2854 | * a> There is no split required: Entire extent should be uninitialized | 2854 | * a> There is no split required: Entire extent should be uninitialized |
diff --git a/fs/ext4/ialloc.c b/fs/ext4/ialloc.c index 254e6b98b5b4..21bb2f61e502 100644 --- a/fs/ext4/ialloc.c +++ b/fs/ext4/ialloc.c | |||
@@ -1043,7 +1043,7 @@ got: | |||
1043 | if (err) | 1043 | if (err) |
1044 | goto fail_free_drop; | 1044 | goto fail_free_drop; |
1045 | 1045 | ||
1046 | err = ext4_init_security(handle, inode, dir); | 1046 | err = ext4_init_security(handle, inode, dir, qstr); |
1047 | if (err) | 1047 | if (err) |
1048 | goto fail_free_drop; | 1048 | goto fail_free_drop; |
1049 | 1049 | ||
diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c index dec10e2115e0..1a86282b9024 100644 --- a/fs/ext4/inode.c +++ b/fs/ext4/inode.c | |||
@@ -3834,7 +3834,6 @@ static const struct address_space_operations ext4_ordered_aops = { | |||
3834 | .readpage = ext4_readpage, | 3834 | .readpage = ext4_readpage, |
3835 | .readpages = ext4_readpages, | 3835 | .readpages = ext4_readpages, |
3836 | .writepage = ext4_writepage, | 3836 | .writepage = ext4_writepage, |
3837 | .sync_page = block_sync_page, | ||
3838 | .write_begin = ext4_write_begin, | 3837 | .write_begin = ext4_write_begin, |
3839 | .write_end = ext4_ordered_write_end, | 3838 | .write_end = ext4_ordered_write_end, |
3840 | .bmap = ext4_bmap, | 3839 | .bmap = ext4_bmap, |
@@ -3850,7 +3849,6 @@ static const struct address_space_operations ext4_writeback_aops = { | |||
3850 | .readpage = ext4_readpage, | 3849 | .readpage = ext4_readpage, |
3851 | .readpages = ext4_readpages, | 3850 | .readpages = ext4_readpages, |
3852 | .writepage = ext4_writepage, | 3851 | .writepage = ext4_writepage, |
3853 | .sync_page = block_sync_page, | ||
3854 | .write_begin = ext4_write_begin, | 3852 | .write_begin = ext4_write_begin, |
3855 | .write_end = ext4_writeback_write_end, | 3853 | .write_end = ext4_writeback_write_end, |
3856 | .bmap = ext4_bmap, | 3854 | .bmap = ext4_bmap, |
@@ -3866,7 +3864,6 @@ static const struct address_space_operations ext4_journalled_aops = { | |||
3866 | .readpage = ext4_readpage, | 3864 | .readpage = ext4_readpage, |
3867 | .readpages = ext4_readpages, | 3865 | .readpages = ext4_readpages, |
3868 | .writepage = ext4_writepage, | 3866 | .writepage = ext4_writepage, |
3869 | .sync_page = block_sync_page, | ||
3870 | .write_begin = ext4_write_begin, | 3867 | .write_begin = ext4_write_begin, |
3871 | .write_end = ext4_journalled_write_end, | 3868 | .write_end = ext4_journalled_write_end, |
3872 | .set_page_dirty = ext4_journalled_set_page_dirty, | 3869 | .set_page_dirty = ext4_journalled_set_page_dirty, |
@@ -3882,7 +3879,6 @@ static const struct address_space_operations ext4_da_aops = { | |||
3882 | .readpages = ext4_readpages, | 3879 | .readpages = ext4_readpages, |
3883 | .writepage = ext4_writepage, | 3880 | .writepage = ext4_writepage, |
3884 | .writepages = ext4_da_writepages, | 3881 | .writepages = ext4_da_writepages, |
3885 | .sync_page = block_sync_page, | ||
3886 | .write_begin = ext4_da_write_begin, | 3882 | .write_begin = ext4_da_write_begin, |
3887 | .write_end = ext4_da_write_end, | 3883 | .write_end = ext4_da_write_end, |
3888 | .bmap = ext4_bmap, | 3884 | .bmap = ext4_bmap, |
diff --git a/fs/ext4/ioctl.c b/fs/ext4/ioctl.c index bb424de9953b..808c554e773f 100644 --- a/fs/ext4/ioctl.c +++ b/fs/ext4/ioctl.c | |||
@@ -38,7 +38,7 @@ long ext4_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) | |||
38 | unsigned int oldflags; | 38 | unsigned int oldflags; |
39 | unsigned int jflag; | 39 | unsigned int jflag; |
40 | 40 | ||
41 | if (!is_owner_or_cap(inode)) | 41 | if (!inode_owner_or_capable(inode)) |
42 | return -EACCES; | 42 | return -EACCES; |
43 | 43 | ||
44 | if (get_user(flags, (int __user *) arg)) | 44 | if (get_user(flags, (int __user *) arg)) |
@@ -146,7 +146,7 @@ flags_out: | |||
146 | __u32 generation; | 146 | __u32 generation; |
147 | int err; | 147 | int err; |
148 | 148 | ||
149 | if (!is_owner_or_cap(inode)) | 149 | if (!inode_owner_or_capable(inode)) |
150 | return -EPERM; | 150 | return -EPERM; |
151 | 151 | ||
152 | err = mnt_want_write(filp->f_path.mnt); | 152 | err = mnt_want_write(filp->f_path.mnt); |
@@ -298,7 +298,7 @@ mext_out: | |||
298 | case EXT4_IOC_MIGRATE: | 298 | case EXT4_IOC_MIGRATE: |
299 | { | 299 | { |
300 | int err; | 300 | int err; |
301 | if (!is_owner_or_cap(inode)) | 301 | if (!inode_owner_or_capable(inode)) |
302 | return -EACCES; | 302 | return -EACCES; |
303 | 303 | ||
304 | err = mnt_want_write(filp->f_path.mnt); | 304 | err = mnt_want_write(filp->f_path.mnt); |
@@ -320,7 +320,7 @@ mext_out: | |||
320 | case EXT4_IOC_ALLOC_DA_BLKS: | 320 | case EXT4_IOC_ALLOC_DA_BLKS: |
321 | { | 321 | { |
322 | int err; | 322 | int err; |
323 | if (!is_owner_or_cap(inode)) | 323 | if (!inode_owner_or_capable(inode)) |
324 | return -EACCES; | 324 | return -EACCES; |
325 | 325 | ||
326 | err = mnt_want_write(filp->f_path.mnt); | 326 | err = mnt_want_write(filp->f_path.mnt); |
diff --git a/fs/ext4/namei.c b/fs/ext4/namei.c index f9f83878843a..67fd0b025858 100644 --- a/fs/ext4/namei.c +++ b/fs/ext4/namei.c | |||
@@ -2307,13 +2307,6 @@ static int ext4_link(struct dentry *old_dentry, | |||
2307 | 2307 | ||
2308 | dquot_initialize(dir); | 2308 | dquot_initialize(dir); |
2309 | 2309 | ||
2310 | /* | ||
2311 | * Return -ENOENT if we've raced with unlink and i_nlink is 0. Doing | ||
2312 | * otherwise has the potential to corrupt the orphan inode list. | ||
2313 | */ | ||
2314 | if (inode->i_nlink == 0) | ||
2315 | return -ENOENT; | ||
2316 | |||
2317 | retry: | 2310 | retry: |
2318 | handle = ext4_journal_start(dir, EXT4_DATA_TRANS_BLOCKS(dir->i_sb) + | 2311 | handle = ext4_journal_start(dir, EXT4_DATA_TRANS_BLOCKS(dir->i_sb) + |
2319 | EXT4_INDEX_EXTRA_TRANS_BLOCKS); | 2312 | EXT4_INDEX_EXTRA_TRANS_BLOCKS); |
diff --git a/fs/ext4/page-io.c b/fs/ext4/page-io.c index 0cfd03e19d7d..b6dbd056fcb1 100644 --- a/fs/ext4/page-io.c +++ b/fs/ext4/page-io.c | |||
@@ -315,8 +315,7 @@ static int io_submit_init(struct ext4_io_submit *io, | |||
315 | io_end->offset = (page->index << PAGE_CACHE_SHIFT) + bh_offset(bh); | 315 | io_end->offset = (page->index << PAGE_CACHE_SHIFT) + bh_offset(bh); |
316 | 316 | ||
317 | io->io_bio = bio; | 317 | io->io_bio = bio; |
318 | io->io_op = (wbc->sync_mode == WB_SYNC_ALL ? | 318 | io->io_op = (wbc->sync_mode == WB_SYNC_ALL ? WRITE_SYNC : WRITE); |
319 | WRITE_SYNC_PLUG : WRITE); | ||
320 | io->io_next_block = bh->b_blocknr; | 319 | io->io_next_block = bh->b_blocknr; |
321 | return 0; | 320 | return 0; |
322 | } | 321 | } |
diff --git a/fs/ext4/super.c b/fs/ext4/super.c index ccfa6865ea59..22546ad7f0ae 100644 --- a/fs/ext4/super.c +++ b/fs/ext4/super.c | |||
@@ -3420,6 +3420,8 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent) | |||
3420 | sb->s_qcop = &ext4_qctl_operations; | 3420 | sb->s_qcop = &ext4_qctl_operations; |
3421 | sb->dq_op = &ext4_quota_operations; | 3421 | sb->dq_op = &ext4_quota_operations; |
3422 | #endif | 3422 | #endif |
3423 | memcpy(sb->s_uuid, es->s_uuid, sizeof(es->s_uuid)); | ||
3424 | |||
3423 | INIT_LIST_HEAD(&sbi->s_orphan); /* unlinked but open files */ | 3425 | INIT_LIST_HEAD(&sbi->s_orphan); /* unlinked but open files */ |
3424 | mutex_init(&sbi->s_orphan_lock); | 3426 | mutex_init(&sbi->s_orphan_lock); |
3425 | mutex_init(&sbi->s_resize_lock); | 3427 | mutex_init(&sbi->s_resize_lock); |
@@ -3514,7 +3516,12 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent) | |||
3514 | percpu_counter_set(&sbi->s_dirtyblocks_counter, 0); | 3516 | percpu_counter_set(&sbi->s_dirtyblocks_counter, 0); |
3515 | 3517 | ||
3516 | no_journal: | 3518 | no_journal: |
3517 | EXT4_SB(sb)->dio_unwritten_wq = create_singlethread_workqueue("ext4-dio-unwritten"); | 3519 | /* |
3520 | * The maximum number of concurrent works can be high and | ||
3521 | * concurrency isn't really necessary. Limit it to 1. | ||
3522 | */ | ||
3523 | EXT4_SB(sb)->dio_unwritten_wq = | ||
3524 | alloc_workqueue("ext4-dio-unwritten", WQ_MEM_RECLAIM | WQ_UNBOUND, 1); | ||
3518 | if (!EXT4_SB(sb)->dio_unwritten_wq) { | 3525 | if (!EXT4_SB(sb)->dio_unwritten_wq) { |
3519 | printk(KERN_ERR "EXT4-fs: failed to create DIO workqueue\n"); | 3526 | printk(KERN_ERR "EXT4-fs: failed to create DIO workqueue\n"); |
3520 | goto failed_mount_wq; | 3527 | goto failed_mount_wq; |
diff --git a/fs/ext4/xattr.h b/fs/ext4/xattr.h index 1ef16520b950..25b7387ff183 100644 --- a/fs/ext4/xattr.h +++ b/fs/ext4/xattr.h | |||
@@ -145,10 +145,10 @@ ext4_expand_extra_isize_ea(struct inode *inode, int new_extra_isize, | |||
145 | 145 | ||
146 | #ifdef CONFIG_EXT4_FS_SECURITY | 146 | #ifdef CONFIG_EXT4_FS_SECURITY |
147 | extern int ext4_init_security(handle_t *handle, struct inode *inode, | 147 | extern int ext4_init_security(handle_t *handle, struct inode *inode, |
148 | struct inode *dir); | 148 | struct inode *dir, const struct qstr *qstr); |
149 | #else | 149 | #else |
150 | static inline int ext4_init_security(handle_t *handle, struct inode *inode, | 150 | static inline int ext4_init_security(handle_t *handle, struct inode *inode, |
151 | struct inode *dir) | 151 | struct inode *dir, const struct qstr *qstr) |
152 | { | 152 | { |
153 | return 0; | 153 | return 0; |
154 | } | 154 | } |
diff --git a/fs/ext4/xattr_security.c b/fs/ext4/xattr_security.c index 9b21268e121c..007c3bfbf094 100644 --- a/fs/ext4/xattr_security.c +++ b/fs/ext4/xattr_security.c | |||
@@ -49,14 +49,15 @@ ext4_xattr_security_set(struct dentry *dentry, const char *name, | |||
49 | } | 49 | } |
50 | 50 | ||
51 | int | 51 | int |
52 | ext4_init_security(handle_t *handle, struct inode *inode, struct inode *dir) | 52 | ext4_init_security(handle_t *handle, struct inode *inode, struct inode *dir, |
53 | const struct qstr *qstr) | ||
53 | { | 54 | { |
54 | int err; | 55 | int err; |
55 | size_t len; | 56 | size_t len; |
56 | void *value; | 57 | void *value; |
57 | char *name; | 58 | char *name; |
58 | 59 | ||
59 | err = security_inode_init_security(inode, dir, &name, &value, &len); | 60 | err = security_inode_init_security(inode, dir, qstr, &name, &value, &len); |
60 | if (err) { | 61 | if (err) { |
61 | if (err == -EOPNOTSUPP) | 62 | if (err == -EOPNOTSUPP) |
62 | return 0; | 63 | return 0; |