diff options
| -rw-r--r-- | fs/ext4/ioctl.c | 6 | ||||
| -rw-r--r-- | fs/ext4/super.c | 19 |
2 files changed, 21 insertions, 4 deletions
diff --git a/fs/ext4/ioctl.c b/fs/ext4/ioctl.c index 9491ac0590f7..c0427e2f6648 100644 --- a/fs/ext4/ioctl.c +++ b/fs/ext4/ioctl.c | |||
| @@ -77,8 +77,10 @@ static void swap_inode_data(struct inode *inode1, struct inode *inode2) | |||
| 77 | memswap(ei1->i_data, ei2->i_data, sizeof(ei1->i_data)); | 77 | memswap(ei1->i_data, ei2->i_data, sizeof(ei1->i_data)); |
| 78 | memswap(&ei1->i_flags, &ei2->i_flags, sizeof(ei1->i_flags)); | 78 | memswap(&ei1->i_flags, &ei2->i_flags, sizeof(ei1->i_flags)); |
| 79 | memswap(&ei1->i_disksize, &ei2->i_disksize, sizeof(ei1->i_disksize)); | 79 | memswap(&ei1->i_disksize, &ei2->i_disksize, sizeof(ei1->i_disksize)); |
| 80 | memswap(&ei1->i_es_tree, &ei2->i_es_tree, sizeof(ei1->i_es_tree)); | 80 | ext4_es_remove_extent(inode1, 0, EXT_MAX_BLOCKS); |
| 81 | memswap(&ei1->i_es_lru_nr, &ei2->i_es_lru_nr, sizeof(ei1->i_es_lru_nr)); | 81 | ext4_es_remove_extent(inode2, 0, EXT_MAX_BLOCKS); |
| 82 | ext4_es_lru_del(inode1); | ||
| 83 | ext4_es_lru_del(inode2); | ||
| 82 | 84 | ||
| 83 | isize = i_size_read(inode1); | 85 | isize = i_size_read(inode1); |
| 84 | i_size_write(inode1, i_size_read(inode2)); | 86 | i_size_write(inode1, i_size_read(inode2)); |
diff --git a/fs/ext4/super.c b/fs/ext4/super.c index 36b141e420b7..b59373b625e9 100644 --- a/fs/ext4/super.c +++ b/fs/ext4/super.c | |||
| @@ -1359,7 +1359,7 @@ static const struct mount_opts { | |||
| 1359 | {Opt_delalloc, EXT4_MOUNT_DELALLOC, | 1359 | {Opt_delalloc, EXT4_MOUNT_DELALLOC, |
| 1360 | MOPT_EXT4_ONLY | MOPT_SET | MOPT_EXPLICIT}, | 1360 | MOPT_EXT4_ONLY | MOPT_SET | MOPT_EXPLICIT}, |
| 1361 | {Opt_nodelalloc, EXT4_MOUNT_DELALLOC, | 1361 | {Opt_nodelalloc, EXT4_MOUNT_DELALLOC, |
| 1362 | MOPT_EXT4_ONLY | MOPT_CLEAR | MOPT_EXPLICIT}, | 1362 | MOPT_EXT4_ONLY | MOPT_CLEAR}, |
| 1363 | {Opt_journal_checksum, EXT4_MOUNT_JOURNAL_CHECKSUM, | 1363 | {Opt_journal_checksum, EXT4_MOUNT_JOURNAL_CHECKSUM, |
| 1364 | MOPT_EXT4_ONLY | MOPT_SET}, | 1364 | MOPT_EXT4_ONLY | MOPT_SET}, |
| 1365 | {Opt_journal_async_commit, (EXT4_MOUNT_JOURNAL_ASYNC_COMMIT | | 1365 | {Opt_journal_async_commit, (EXT4_MOUNT_JOURNAL_ASYNC_COMMIT | |
| @@ -3483,7 +3483,7 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent) | |||
| 3483 | } | 3483 | } |
| 3484 | if (test_opt(sb, DIOREAD_NOLOCK)) { | 3484 | if (test_opt(sb, DIOREAD_NOLOCK)) { |
| 3485 | ext4_msg(sb, KERN_ERR, "can't mount with " | 3485 | ext4_msg(sb, KERN_ERR, "can't mount with " |
| 3486 | "both data=journal and delalloc"); | 3486 | "both data=journal and dioread_nolock"); |
| 3487 | goto failed_mount; | 3487 | goto failed_mount; |
| 3488 | } | 3488 | } |
| 3489 | if (test_opt(sb, DELALLOC)) | 3489 | if (test_opt(sb, DELALLOC)) |
| @@ -4727,6 +4727,21 @@ static int ext4_remount(struct super_block *sb, int *flags, char *data) | |||
| 4727 | goto restore_opts; | 4727 | goto restore_opts; |
| 4728 | } | 4728 | } |
| 4729 | 4729 | ||
| 4730 | if (test_opt(sb, DATA_FLAGS) == EXT4_MOUNT_JOURNAL_DATA) { | ||
| 4731 | if (test_opt2(sb, EXPLICIT_DELALLOC)) { | ||
| 4732 | ext4_msg(sb, KERN_ERR, "can't mount with " | ||
| 4733 | "both data=journal and delalloc"); | ||
| 4734 | err = -EINVAL; | ||
| 4735 | goto restore_opts; | ||
| 4736 | } | ||
| 4737 | if (test_opt(sb, DIOREAD_NOLOCK)) { | ||
| 4738 | ext4_msg(sb, KERN_ERR, "can't mount with " | ||
| 4739 | "both data=journal and dioread_nolock"); | ||
| 4740 | err = -EINVAL; | ||
| 4741 | goto restore_opts; | ||
| 4742 | } | ||
| 4743 | } | ||
| 4744 | |||
| 4730 | if (sbi->s_mount_flags & EXT4_MF_FS_ABORTED) | 4745 | if (sbi->s_mount_flags & EXT4_MF_FS_ABORTED) |
| 4731 | ext4_abort(sb, "Abort forced by user"); | 4746 | ext4_abort(sb, "Abort forced by user"); |
| 4732 | 4747 | ||
