diff options
Diffstat (limited to 'fs')
| -rw-r--r-- | fs/binfmt_misc.c | 7 | ||||
| -rw-r--r-- | fs/btrfs/ctree.h | 4 | ||||
| -rw-r--r-- | fs/btrfs/disk-io.c | 6 | ||||
| -rw-r--r-- | fs/btrfs/extent-tree.c | 23 | ||||
| -rw-r--r-- | fs/btrfs/free-space-cache.c | 12 | ||||
| -rw-r--r-- | fs/btrfs/volumes.c | 2 | ||||
| -rw-r--r-- | fs/ecryptfs/crypto.c | 1 | ||||
| -rw-r--r-- | fs/ecryptfs/file.c | 12 | ||||
| -rw-r--r-- | fs/ecryptfs/keystore.c | 6 | ||||
| -rw-r--r-- | fs/ecryptfs/main.c | 16 | ||||
| -rw-r--r-- | fs/ext4/move_extent.c | 4 | ||||
| -rw-r--r-- | fs/kernfs/file.c | 22 | ||||
| -rw-r--r-- | fs/proc/stat.c | 2 | ||||
| -rw-r--r-- | fs/proc_namespace.c | 16 |
14 files changed, 53 insertions, 80 deletions
diff --git a/fs/binfmt_misc.c b/fs/binfmt_misc.c index c04ef1d4f18a..97aff2879cda 100644 --- a/fs/binfmt_misc.c +++ b/fs/binfmt_misc.c | |||
| @@ -254,6 +254,7 @@ static char *scanarg(char *s, char del) | |||
| 254 | return NULL; | 254 | return NULL; |
| 255 | } | 255 | } |
| 256 | } | 256 | } |
| 257 | s[-1] ='\0'; | ||
| 257 | return s; | 258 | return s; |
| 258 | } | 259 | } |
| 259 | 260 | ||
| @@ -378,8 +379,7 @@ static Node *create_entry(const char __user *buffer, size_t count) | |||
| 378 | p = scanarg(p, del); | 379 | p = scanarg(p, del); |
| 379 | if (!p) | 380 | if (!p) |
| 380 | goto einval; | 381 | goto einval; |
| 381 | p[-1] = '\0'; | 382 | if (!e->magic[0]) |
| 382 | if (p == e->magic) | ||
| 383 | goto einval; | 383 | goto einval; |
| 384 | if (USE_DEBUG) | 384 | if (USE_DEBUG) |
| 385 | print_hex_dump_bytes( | 385 | print_hex_dump_bytes( |
| @@ -391,8 +391,7 @@ static Node *create_entry(const char __user *buffer, size_t count) | |||
| 391 | p = scanarg(p, del); | 391 | p = scanarg(p, del); |
| 392 | if (!p) | 392 | if (!p) |
| 393 | goto einval; | 393 | goto einval; |
| 394 | p[-1] = '\0'; | 394 | if (!e->mask[0]) { |
| 395 | if (p == e->mask) { | ||
| 396 | e->mask = NULL; | 395 | e->mask = NULL; |
| 397 | pr_debug("register: mask[raw]: none\n"); | 396 | pr_debug("register: mask[raw]: none\n"); |
| 398 | } else if (USE_DEBUG) | 397 | } else if (USE_DEBUG) |
diff --git a/fs/btrfs/ctree.h b/fs/btrfs/ctree.h index e6fbbd74b716..7e607416755a 100644 --- a/fs/btrfs/ctree.h +++ b/fs/btrfs/ctree.h | |||
| @@ -3481,8 +3481,8 @@ void btrfs_put_block_group_cache(struct btrfs_fs_info *info); | |||
| 3481 | u64 btrfs_account_ro_block_groups_free_space(struct btrfs_space_info *sinfo); | 3481 | u64 btrfs_account_ro_block_groups_free_space(struct btrfs_space_info *sinfo); |
| 3482 | int btrfs_error_unpin_extent_range(struct btrfs_root *root, | 3482 | int btrfs_error_unpin_extent_range(struct btrfs_root *root, |
| 3483 | u64 start, u64 end); | 3483 | u64 start, u64 end); |
| 3484 | int btrfs_error_discard_extent(struct btrfs_root *root, u64 bytenr, | 3484 | int btrfs_discard_extent(struct btrfs_root *root, u64 bytenr, |
| 3485 | u64 num_bytes, u64 *actual_bytes); | 3485 | u64 num_bytes, u64 *actual_bytes); |
| 3486 | int btrfs_force_chunk_alloc(struct btrfs_trans_handle *trans, | 3486 | int btrfs_force_chunk_alloc(struct btrfs_trans_handle *trans, |
| 3487 | struct btrfs_root *root, u64 type); | 3487 | struct btrfs_root *root, u64 type); |
| 3488 | int btrfs_trim_fs(struct btrfs_root *root, struct fstrim_range *range); | 3488 | int btrfs_trim_fs(struct btrfs_root *root, struct fstrim_range *range); |
diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c index 30965120772b..8c63419a7f70 100644 --- a/fs/btrfs/disk-io.c +++ b/fs/btrfs/disk-io.c | |||
| @@ -4121,12 +4121,6 @@ again: | |||
| 4121 | if (ret) | 4121 | if (ret) |
| 4122 | break; | 4122 | break; |
| 4123 | 4123 | ||
| 4124 | /* opt_discard */ | ||
| 4125 | if (btrfs_test_opt(root, DISCARD)) | ||
| 4126 | ret = btrfs_error_discard_extent(root, start, | ||
| 4127 | end + 1 - start, | ||
| 4128 | NULL); | ||
| 4129 | |||
| 4130 | clear_extent_dirty(unpin, start, end, GFP_NOFS); | 4124 | clear_extent_dirty(unpin, start, end, GFP_NOFS); |
| 4131 | btrfs_error_unpin_extent_range(root, start, end); | 4125 | btrfs_error_unpin_extent_range(root, start, end); |
| 4132 | cond_resched(); | 4126 | cond_resched(); |
diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c index 222d6aea4a8a..a80b97100d90 100644 --- a/fs/btrfs/extent-tree.c +++ b/fs/btrfs/extent-tree.c | |||
| @@ -1889,8 +1889,8 @@ static int btrfs_issue_discard(struct block_device *bdev, | |||
| 1889 | return blkdev_issue_discard(bdev, start >> 9, len >> 9, GFP_NOFS, 0); | 1889 | return blkdev_issue_discard(bdev, start >> 9, len >> 9, GFP_NOFS, 0); |
| 1890 | } | 1890 | } |
| 1891 | 1891 | ||
| 1892 | static int btrfs_discard_extent(struct btrfs_root *root, u64 bytenr, | 1892 | int btrfs_discard_extent(struct btrfs_root *root, u64 bytenr, |
| 1893 | u64 num_bytes, u64 *actual_bytes) | 1893 | u64 num_bytes, u64 *actual_bytes) |
| 1894 | { | 1894 | { |
| 1895 | int ret; | 1895 | int ret; |
| 1896 | u64 discarded_bytes = 0; | 1896 | u64 discarded_bytes = 0; |
| @@ -5727,7 +5727,8 @@ void btrfs_prepare_extent_commit(struct btrfs_trans_handle *trans, | |||
| 5727 | update_global_block_rsv(fs_info); | 5727 | update_global_block_rsv(fs_info); |
| 5728 | } | 5728 | } |
| 5729 | 5729 | ||
| 5730 | static int unpin_extent_range(struct btrfs_root *root, u64 start, u64 end) | 5730 | static int unpin_extent_range(struct btrfs_root *root, u64 start, u64 end, |
| 5731 | const bool return_free_space) | ||
| 5731 | { | 5732 | { |
| 5732 | struct btrfs_fs_info *fs_info = root->fs_info; | 5733 | struct btrfs_fs_info *fs_info = root->fs_info; |
| 5733 | struct btrfs_block_group_cache *cache = NULL; | 5734 | struct btrfs_block_group_cache *cache = NULL; |
| @@ -5751,7 +5752,8 @@ static int unpin_extent_range(struct btrfs_root *root, u64 start, u64 end) | |||
| 5751 | 5752 | ||
| 5752 | if (start < cache->last_byte_to_unpin) { | 5753 | if (start < cache->last_byte_to_unpin) { |
| 5753 | len = min(len, cache->last_byte_to_unpin - start); | 5754 | len = min(len, cache->last_byte_to_unpin - start); |
| 5754 | btrfs_add_free_space(cache, start, len); | 5755 | if (return_free_space) |
| 5756 | btrfs_add_free_space(cache, start, len); | ||
| 5755 | } | 5757 | } |
| 5756 | 5758 | ||
| 5757 | start += len; | 5759 | start += len; |
| @@ -5815,7 +5817,7 @@ int btrfs_finish_extent_commit(struct btrfs_trans_handle *trans, | |||
| 5815 | end + 1 - start, NULL); | 5817 | end + 1 - start, NULL); |
| 5816 | 5818 | ||
| 5817 | clear_extent_dirty(unpin, start, end, GFP_NOFS); | 5819 | clear_extent_dirty(unpin, start, end, GFP_NOFS); |
| 5818 | unpin_extent_range(root, start, end); | 5820 | unpin_extent_range(root, start, end, true); |
| 5819 | cond_resched(); | 5821 | cond_resched(); |
| 5820 | } | 5822 | } |
| 5821 | 5823 | ||
| @@ -8872,6 +8874,7 @@ int btrfs_free_block_groups(struct btrfs_fs_info *info) | |||
| 8872 | cache_node); | 8874 | cache_node); |
| 8873 | rb_erase(&block_group->cache_node, | 8875 | rb_erase(&block_group->cache_node, |
| 8874 | &info->block_group_cache_tree); | 8876 | &info->block_group_cache_tree); |
| 8877 | RB_CLEAR_NODE(&block_group->cache_node); | ||
| 8875 | spin_unlock(&info->block_group_cache_lock); | 8878 | spin_unlock(&info->block_group_cache_lock); |
| 8876 | 8879 | ||
| 8877 | down_write(&block_group->space_info->groups_sem); | 8880 | down_write(&block_group->space_info->groups_sem); |
| @@ -9130,6 +9133,7 @@ int btrfs_read_block_groups(struct btrfs_root *root) | |||
| 9130 | spin_lock(&info->block_group_cache_lock); | 9133 | spin_lock(&info->block_group_cache_lock); |
| 9131 | rb_erase(&cache->cache_node, | 9134 | rb_erase(&cache->cache_node, |
| 9132 | &info->block_group_cache_tree); | 9135 | &info->block_group_cache_tree); |
| 9136 | RB_CLEAR_NODE(&cache->cache_node); | ||
| 9133 | spin_unlock(&info->block_group_cache_lock); | 9137 | spin_unlock(&info->block_group_cache_lock); |
| 9134 | btrfs_put_block_group(cache); | 9138 | btrfs_put_block_group(cache); |
| 9135 | goto error; | 9139 | goto error; |
| @@ -9271,6 +9275,7 @@ int btrfs_make_block_group(struct btrfs_trans_handle *trans, | |||
| 9271 | spin_lock(&root->fs_info->block_group_cache_lock); | 9275 | spin_lock(&root->fs_info->block_group_cache_lock); |
| 9272 | rb_erase(&cache->cache_node, | 9276 | rb_erase(&cache->cache_node, |
| 9273 | &root->fs_info->block_group_cache_tree); | 9277 | &root->fs_info->block_group_cache_tree); |
| 9278 | RB_CLEAR_NODE(&cache->cache_node); | ||
| 9274 | spin_unlock(&root->fs_info->block_group_cache_lock); | 9279 | spin_unlock(&root->fs_info->block_group_cache_lock); |
| 9275 | btrfs_put_block_group(cache); | 9280 | btrfs_put_block_group(cache); |
| 9276 | return ret; | 9281 | return ret; |
| @@ -9690,13 +9695,7 @@ out: | |||
| 9690 | 9695 | ||
| 9691 | int btrfs_error_unpin_extent_range(struct btrfs_root *root, u64 start, u64 end) | 9696 | int btrfs_error_unpin_extent_range(struct btrfs_root *root, u64 start, u64 end) |
| 9692 | { | 9697 | { |
| 9693 | return unpin_extent_range(root, start, end); | 9698 | return unpin_extent_range(root, start, end, false); |
| 9694 | } | ||
| 9695 | |||
| 9696 | int btrfs_error_discard_extent(struct btrfs_root *root, u64 bytenr, | ||
| 9697 | u64 num_bytes, u64 *actual_bytes) | ||
| 9698 | { | ||
| 9699 | return btrfs_discard_extent(root, bytenr, num_bytes, actual_bytes); | ||
| 9700 | } | 9699 | } |
| 9701 | 9700 | ||
| 9702 | int btrfs_trim_fs(struct btrfs_root *root, struct fstrim_range *range) | 9701 | int btrfs_trim_fs(struct btrfs_root *root, struct fstrim_range *range) |
diff --git a/fs/btrfs/free-space-cache.c b/fs/btrfs/free-space-cache.c index 030847bf7cec..d6c03f7f136b 100644 --- a/fs/btrfs/free-space-cache.c +++ b/fs/btrfs/free-space-cache.c | |||
| @@ -2966,8 +2966,8 @@ static int do_trimming(struct btrfs_block_group_cache *block_group, | |||
| 2966 | spin_unlock(&block_group->lock); | 2966 | spin_unlock(&block_group->lock); |
| 2967 | spin_unlock(&space_info->lock); | 2967 | spin_unlock(&space_info->lock); |
| 2968 | 2968 | ||
| 2969 | ret = btrfs_error_discard_extent(fs_info->extent_root, | 2969 | ret = btrfs_discard_extent(fs_info->extent_root, |
| 2970 | start, bytes, &trimmed); | 2970 | start, bytes, &trimmed); |
| 2971 | if (!ret) | 2971 | if (!ret) |
| 2972 | *total_trimmed += trimmed; | 2972 | *total_trimmed += trimmed; |
| 2973 | 2973 | ||
| @@ -3185,16 +3185,18 @@ out: | |||
| 3185 | 3185 | ||
| 3186 | spin_unlock(&block_group->lock); | 3186 | spin_unlock(&block_group->lock); |
| 3187 | 3187 | ||
| 3188 | lock_chunks(block_group->fs_info->chunk_root); | ||
| 3188 | em_tree = &block_group->fs_info->mapping_tree.map_tree; | 3189 | em_tree = &block_group->fs_info->mapping_tree.map_tree; |
| 3189 | write_lock(&em_tree->lock); | 3190 | write_lock(&em_tree->lock); |
| 3190 | em = lookup_extent_mapping(em_tree, block_group->key.objectid, | 3191 | em = lookup_extent_mapping(em_tree, block_group->key.objectid, |
| 3191 | 1); | 3192 | 1); |
| 3192 | BUG_ON(!em); /* logic error, can't happen */ | 3193 | BUG_ON(!em); /* logic error, can't happen */ |
| 3194 | /* | ||
| 3195 | * remove_extent_mapping() will delete us from the pinned_chunks | ||
| 3196 | * list, which is protected by the chunk mutex. | ||
| 3197 | */ | ||
| 3193 | remove_extent_mapping(em_tree, em); | 3198 | remove_extent_mapping(em_tree, em); |
| 3194 | write_unlock(&em_tree->lock); | 3199 | write_unlock(&em_tree->lock); |
| 3195 | |||
| 3196 | lock_chunks(block_group->fs_info->chunk_root); | ||
| 3197 | list_del_init(&em->list); | ||
| 3198 | unlock_chunks(block_group->fs_info->chunk_root); | 3200 | unlock_chunks(block_group->fs_info->chunk_root); |
| 3199 | 3201 | ||
| 3200 | /* once for us and once for the tree */ | 3202 | /* once for us and once for the tree */ |
diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c index 0144790e296e..50c5a8762aed 100644 --- a/fs/btrfs/volumes.c +++ b/fs/btrfs/volumes.c | |||
| @@ -1485,7 +1485,7 @@ static void update_dev_time(char *path_name) | |||
| 1485 | struct file *filp; | 1485 | struct file *filp; |
| 1486 | 1486 | ||
| 1487 | filp = filp_open(path_name, O_RDWR, 0); | 1487 | filp = filp_open(path_name, O_RDWR, 0); |
| 1488 | if (!filp) | 1488 | if (IS_ERR(filp)) |
| 1489 | return; | 1489 | return; |
| 1490 | file_update_time(filp); | 1490 | file_update_time(filp); |
| 1491 | filp_close(filp, NULL); | 1491 | filp_close(filp, NULL); |
diff --git a/fs/ecryptfs/crypto.c b/fs/ecryptfs/crypto.c index c2d6604667b0..719e1ce1c609 100644 --- a/fs/ecryptfs/crypto.c +++ b/fs/ecryptfs/crypto.c | |||
| @@ -1917,7 +1917,6 @@ ecryptfs_decode_from_filename(unsigned char *dst, size_t *dst_size, | |||
| 1917 | break; | 1917 | break; |
| 1918 | case 2: | 1918 | case 2: |
| 1919 | dst[dst_byte_offset++] |= (src_byte); | 1919 | dst[dst_byte_offset++] |= (src_byte); |
| 1920 | dst[dst_byte_offset] = 0; | ||
| 1921 | current_bit_offset = 0; | 1920 | current_bit_offset = 0; |
| 1922 | break; | 1921 | break; |
| 1923 | } | 1922 | } |
diff --git a/fs/ecryptfs/file.c b/fs/ecryptfs/file.c index 80154ec4f8c2..6f4e659f508f 100644 --- a/fs/ecryptfs/file.c +++ b/fs/ecryptfs/file.c | |||
| @@ -190,23 +190,11 @@ static int ecryptfs_open(struct inode *inode, struct file *file) | |||
| 190 | { | 190 | { |
| 191 | int rc = 0; | 191 | int rc = 0; |
| 192 | struct ecryptfs_crypt_stat *crypt_stat = NULL; | 192 | struct ecryptfs_crypt_stat *crypt_stat = NULL; |
| 193 | struct ecryptfs_mount_crypt_stat *mount_crypt_stat; | ||
| 194 | struct dentry *ecryptfs_dentry = file->f_path.dentry; | 193 | struct dentry *ecryptfs_dentry = file->f_path.dentry; |
| 195 | /* Private value of ecryptfs_dentry allocated in | 194 | /* Private value of ecryptfs_dentry allocated in |
| 196 | * ecryptfs_lookup() */ | 195 | * ecryptfs_lookup() */ |
| 197 | struct ecryptfs_file_info *file_info; | 196 | struct ecryptfs_file_info *file_info; |
| 198 | 197 | ||
| 199 | mount_crypt_stat = &ecryptfs_superblock_to_private( | ||
| 200 | ecryptfs_dentry->d_sb)->mount_crypt_stat; | ||
| 201 | if ((mount_crypt_stat->flags & ECRYPTFS_ENCRYPTED_VIEW_ENABLED) | ||
| 202 | && ((file->f_flags & O_WRONLY) || (file->f_flags & O_RDWR) | ||
| 203 | || (file->f_flags & O_CREAT) || (file->f_flags & O_TRUNC) | ||
| 204 | || (file->f_flags & O_APPEND))) { | ||
| 205 | printk(KERN_WARNING "Mount has encrypted view enabled; " | ||
| 206 | "files may only be read\n"); | ||
| 207 | rc = -EPERM; | ||
| 208 | goto out; | ||
| 209 | } | ||
| 210 | /* Released in ecryptfs_release or end of function if failure */ | 198 | /* Released in ecryptfs_release or end of function if failure */ |
| 211 | file_info = kmem_cache_zalloc(ecryptfs_file_info_cache, GFP_KERNEL); | 199 | file_info = kmem_cache_zalloc(ecryptfs_file_info_cache, GFP_KERNEL); |
| 212 | ecryptfs_set_file_private(file, file_info); | 200 | ecryptfs_set_file_private(file, file_info); |
diff --git a/fs/ecryptfs/keystore.c b/fs/ecryptfs/keystore.c index 635e8e16a5b7..917bd5c9776a 100644 --- a/fs/ecryptfs/keystore.c +++ b/fs/ecryptfs/keystore.c | |||
| @@ -100,12 +100,12 @@ int ecryptfs_parse_packet_length(unsigned char *data, size_t *size, | |||
| 100 | (*size) = 0; | 100 | (*size) = 0; |
| 101 | if (data[0] < 192) { | 101 | if (data[0] < 192) { |
| 102 | /* One-byte length */ | 102 | /* One-byte length */ |
| 103 | (*size) = (unsigned char)data[0]; | 103 | (*size) = data[0]; |
| 104 | (*length_size) = 1; | 104 | (*length_size) = 1; |
| 105 | } else if (data[0] < 224) { | 105 | } else if (data[0] < 224) { |
| 106 | /* Two-byte length */ | 106 | /* Two-byte length */ |
| 107 | (*size) = (((unsigned char)(data[0]) - 192) * 256); | 107 | (*size) = (data[0] - 192) * 256; |
| 108 | (*size) += ((unsigned char)(data[1]) + 192); | 108 | (*size) += data[1] + 192; |
| 109 | (*length_size) = 2; | 109 | (*length_size) = 2; |
| 110 | } else if (data[0] == 255) { | 110 | } else if (data[0] == 255) { |
| 111 | /* If support is added, adjust ECRYPTFS_MAX_PKT_LEN_SIZE */ | 111 | /* If support is added, adjust ECRYPTFS_MAX_PKT_LEN_SIZE */ |
diff --git a/fs/ecryptfs/main.c b/fs/ecryptfs/main.c index c4cd1fd86cc2..d9eb84bda559 100644 --- a/fs/ecryptfs/main.c +++ b/fs/ecryptfs/main.c | |||
| @@ -493,6 +493,7 @@ static struct dentry *ecryptfs_mount(struct file_system_type *fs_type, int flags | |||
| 493 | { | 493 | { |
| 494 | struct super_block *s; | 494 | struct super_block *s; |
| 495 | struct ecryptfs_sb_info *sbi; | 495 | struct ecryptfs_sb_info *sbi; |
| 496 | struct ecryptfs_mount_crypt_stat *mount_crypt_stat; | ||
| 496 | struct ecryptfs_dentry_info *root_info; | 497 | struct ecryptfs_dentry_info *root_info; |
| 497 | const char *err = "Getting sb failed"; | 498 | const char *err = "Getting sb failed"; |
| 498 | struct inode *inode; | 499 | struct inode *inode; |
| @@ -511,6 +512,7 @@ static struct dentry *ecryptfs_mount(struct file_system_type *fs_type, int flags | |||
| 511 | err = "Error parsing options"; | 512 | err = "Error parsing options"; |
| 512 | goto out; | 513 | goto out; |
| 513 | } | 514 | } |
| 515 | mount_crypt_stat = &sbi->mount_crypt_stat; | ||
| 514 | 516 | ||
| 515 | s = sget(fs_type, NULL, set_anon_super, flags, NULL); | 517 | s = sget(fs_type, NULL, set_anon_super, flags, NULL); |
| 516 | if (IS_ERR(s)) { | 518 | if (IS_ERR(s)) { |
| @@ -557,11 +559,19 @@ static struct dentry *ecryptfs_mount(struct file_system_type *fs_type, int flags | |||
| 557 | 559 | ||
| 558 | /** | 560 | /** |
| 559 | * Set the POSIX ACL flag based on whether they're enabled in the lower | 561 | * Set the POSIX ACL flag based on whether they're enabled in the lower |
| 560 | * mount. Force a read-only eCryptfs mount if the lower mount is ro. | 562 | * mount. |
| 561 | * Allow a ro eCryptfs mount even when the lower mount is rw. | ||
| 562 | */ | 563 | */ |
| 563 | s->s_flags = flags & ~MS_POSIXACL; | 564 | s->s_flags = flags & ~MS_POSIXACL; |
| 564 | s->s_flags |= path.dentry->d_sb->s_flags & (MS_RDONLY | MS_POSIXACL); | 565 | s->s_flags |= path.dentry->d_sb->s_flags & MS_POSIXACL; |
| 566 | |||
| 567 | /** | ||
| 568 | * Force a read-only eCryptfs mount when: | ||
| 569 | * 1) The lower mount is ro | ||
| 570 | * 2) The ecryptfs_encrypted_view mount option is specified | ||
| 571 | */ | ||
| 572 | if (path.dentry->d_sb->s_flags & MS_RDONLY || | ||
| 573 | mount_crypt_stat->flags & ECRYPTFS_ENCRYPTED_VIEW_ENABLED) | ||
| 574 | s->s_flags |= MS_RDONLY; | ||
| 565 | 575 | ||
| 566 | s->s_maxbytes = path.dentry->d_sb->s_maxbytes; | 576 | s->s_maxbytes = path.dentry->d_sb->s_maxbytes; |
| 567 | s->s_blocksize = path.dentry->d_sb->s_blocksize; | 577 | s->s_blocksize = path.dentry->d_sb->s_blocksize; |
diff --git a/fs/ext4/move_extent.c b/fs/ext4/move_extent.c index 503ea15dc5db..370420bfae8d 100644 --- a/fs/ext4/move_extent.c +++ b/fs/ext4/move_extent.c | |||
| @@ -267,7 +267,6 @@ move_extent_per_page(struct file *o_filp, struct inode *donor_inode, | |||
| 267 | handle_t *handle; | 267 | handle_t *handle; |
| 268 | ext4_lblk_t orig_blk_offset, donor_blk_offset; | 268 | ext4_lblk_t orig_blk_offset, donor_blk_offset; |
| 269 | unsigned long blocksize = orig_inode->i_sb->s_blocksize; | 269 | unsigned long blocksize = orig_inode->i_sb->s_blocksize; |
| 270 | unsigned int w_flags = 0; | ||
| 271 | unsigned int tmp_data_size, data_size, replaced_size; | 270 | unsigned int tmp_data_size, data_size, replaced_size; |
| 272 | int err2, jblocks, retries = 0; | 271 | int err2, jblocks, retries = 0; |
| 273 | int replaced_count = 0; | 272 | int replaced_count = 0; |
| @@ -288,9 +287,6 @@ again: | |||
| 288 | return 0; | 287 | return 0; |
| 289 | } | 288 | } |
| 290 | 289 | ||
| 291 | if (segment_eq(get_fs(), KERNEL_DS)) | ||
| 292 | w_flags |= AOP_FLAG_UNINTERRUPTIBLE; | ||
| 293 | |||
| 294 | orig_blk_offset = orig_page_offset * blocks_per_page + | 290 | orig_blk_offset = orig_page_offset * blocks_per_page + |
| 295 | data_offset_in_page; | 291 | data_offset_in_page; |
| 296 | 292 | ||
diff --git a/fs/kernfs/file.c b/fs/kernfs/file.c index 697390ea47b8..ddc9f9612f16 100644 --- a/fs/kernfs/file.c +++ b/fs/kernfs/file.c | |||
| @@ -448,27 +448,6 @@ static struct mempolicy *kernfs_vma_get_policy(struct vm_area_struct *vma, | |||
| 448 | return pol; | 448 | return pol; |
| 449 | } | 449 | } |
| 450 | 450 | ||
| 451 | static int kernfs_vma_migrate(struct vm_area_struct *vma, | ||
| 452 | const nodemask_t *from, const nodemask_t *to, | ||
| 453 | unsigned long flags) | ||
| 454 | { | ||
| 455 | struct file *file = vma->vm_file; | ||
| 456 | struct kernfs_open_file *of = kernfs_of(file); | ||
| 457 | int ret; | ||
| 458 | |||
| 459 | if (!of->vm_ops) | ||
| 460 | return 0; | ||
| 461 | |||
| 462 | if (!kernfs_get_active(of->kn)) | ||
| 463 | return 0; | ||
| 464 | |||
| 465 | ret = 0; | ||
| 466 | if (of->vm_ops->migrate) | ||
| 467 | ret = of->vm_ops->migrate(vma, from, to, flags); | ||
| 468 | |||
| 469 | kernfs_put_active(of->kn); | ||
| 470 | return ret; | ||
| 471 | } | ||
| 472 | #endif | 451 | #endif |
| 473 | 452 | ||
| 474 | static const struct vm_operations_struct kernfs_vm_ops = { | 453 | static const struct vm_operations_struct kernfs_vm_ops = { |
| @@ -479,7 +458,6 @@ static const struct vm_operations_struct kernfs_vm_ops = { | |||
| 479 | #ifdef CONFIG_NUMA | 458 | #ifdef CONFIG_NUMA |
| 480 | .set_policy = kernfs_vma_set_policy, | 459 | .set_policy = kernfs_vma_set_policy, |
| 481 | .get_policy = kernfs_vma_get_policy, | 460 | .get_policy = kernfs_vma_get_policy, |
| 482 | .migrate = kernfs_vma_migrate, | ||
| 483 | #endif | 461 | #endif |
| 484 | }; | 462 | }; |
| 485 | 463 | ||
diff --git a/fs/proc/stat.c b/fs/proc/stat.c index bf2d03f8fd3e..510413eb25b8 100644 --- a/fs/proc/stat.c +++ b/fs/proc/stat.c | |||
| @@ -159,7 +159,7 @@ static int show_stat(struct seq_file *p, void *v) | |||
| 159 | 159 | ||
| 160 | /* sum again ? it could be updated? */ | 160 | /* sum again ? it could be updated? */ |
| 161 | for_each_irq_nr(j) | 161 | for_each_irq_nr(j) |
| 162 | seq_put_decimal_ull(p, ' ', kstat_irqs(j)); | 162 | seq_put_decimal_ull(p, ' ', kstat_irqs_usr(j)); |
| 163 | 163 | ||
| 164 | seq_printf(p, | 164 | seq_printf(p, |
| 165 | "\nctxt %llu\n" | 165 | "\nctxt %llu\n" |
diff --git a/fs/proc_namespace.c b/fs/proc_namespace.c index 73ca1740d839..0f96f71ab32b 100644 --- a/fs/proc_namespace.c +++ b/fs/proc_namespace.c | |||
| @@ -91,6 +91,7 @@ static void show_type(struct seq_file *m, struct super_block *sb) | |||
| 91 | 91 | ||
| 92 | static int show_vfsmnt(struct seq_file *m, struct vfsmount *mnt) | 92 | static int show_vfsmnt(struct seq_file *m, struct vfsmount *mnt) |
| 93 | { | 93 | { |
| 94 | struct proc_mounts *p = proc_mounts(m); | ||
| 94 | struct mount *r = real_mount(mnt); | 95 | struct mount *r = real_mount(mnt); |
| 95 | int err = 0; | 96 | int err = 0; |
| 96 | struct path mnt_path = { .dentry = mnt->mnt_root, .mnt = mnt }; | 97 | struct path mnt_path = { .dentry = mnt->mnt_root, .mnt = mnt }; |
| @@ -104,7 +105,10 @@ static int show_vfsmnt(struct seq_file *m, struct vfsmount *mnt) | |||
| 104 | mangle(m, r->mnt_devname ? r->mnt_devname : "none"); | 105 | mangle(m, r->mnt_devname ? r->mnt_devname : "none"); |
| 105 | } | 106 | } |
| 106 | seq_putc(m, ' '); | 107 | seq_putc(m, ' '); |
| 107 | seq_path(m, &mnt_path, " \t\n\\"); | 108 | /* mountpoints outside of chroot jail will give SEQ_SKIP on this */ |
| 109 | err = seq_path_root(m, &mnt_path, &p->root, " \t\n\\"); | ||
| 110 | if (err) | ||
| 111 | goto out; | ||
| 108 | seq_putc(m, ' '); | 112 | seq_putc(m, ' '); |
| 109 | show_type(m, sb); | 113 | show_type(m, sb); |
| 110 | seq_puts(m, __mnt_is_readonly(mnt) ? " ro" : " rw"); | 114 | seq_puts(m, __mnt_is_readonly(mnt) ? " ro" : " rw"); |
| @@ -125,7 +129,6 @@ static int show_mountinfo(struct seq_file *m, struct vfsmount *mnt) | |||
| 125 | struct mount *r = real_mount(mnt); | 129 | struct mount *r = real_mount(mnt); |
| 126 | struct super_block *sb = mnt->mnt_sb; | 130 | struct super_block *sb = mnt->mnt_sb; |
| 127 | struct path mnt_path = { .dentry = mnt->mnt_root, .mnt = mnt }; | 131 | struct path mnt_path = { .dentry = mnt->mnt_root, .mnt = mnt }; |
| 128 | struct path root = p->root; | ||
| 129 | int err = 0; | 132 | int err = 0; |
| 130 | 133 | ||
| 131 | seq_printf(m, "%i %i %u:%u ", r->mnt_id, r->mnt_parent->mnt_id, | 134 | seq_printf(m, "%i %i %u:%u ", r->mnt_id, r->mnt_parent->mnt_id, |
| @@ -139,7 +142,7 @@ static int show_mountinfo(struct seq_file *m, struct vfsmount *mnt) | |||
| 139 | seq_putc(m, ' '); | 142 | seq_putc(m, ' '); |
| 140 | 143 | ||
| 141 | /* mountpoints outside of chroot jail will give SEQ_SKIP on this */ | 144 | /* mountpoints outside of chroot jail will give SEQ_SKIP on this */ |
| 142 | err = seq_path_root(m, &mnt_path, &root, " \t\n\\"); | 145 | err = seq_path_root(m, &mnt_path, &p->root, " \t\n\\"); |
| 143 | if (err) | 146 | if (err) |
| 144 | goto out; | 147 | goto out; |
| 145 | 148 | ||
| @@ -182,6 +185,7 @@ out: | |||
| 182 | 185 | ||
| 183 | static int show_vfsstat(struct seq_file *m, struct vfsmount *mnt) | 186 | static int show_vfsstat(struct seq_file *m, struct vfsmount *mnt) |
| 184 | { | 187 | { |
| 188 | struct proc_mounts *p = proc_mounts(m); | ||
| 185 | struct mount *r = real_mount(mnt); | 189 | struct mount *r = real_mount(mnt); |
| 186 | struct path mnt_path = { .dentry = mnt->mnt_root, .mnt = mnt }; | 190 | struct path mnt_path = { .dentry = mnt->mnt_root, .mnt = mnt }; |
| 187 | struct super_block *sb = mnt_path.dentry->d_sb; | 191 | struct super_block *sb = mnt_path.dentry->d_sb; |
| @@ -201,7 +205,10 @@ static int show_vfsstat(struct seq_file *m, struct vfsmount *mnt) | |||
| 201 | 205 | ||
| 202 | /* mount point */ | 206 | /* mount point */ |
| 203 | seq_puts(m, " mounted on "); | 207 | seq_puts(m, " mounted on "); |
| 204 | seq_path(m, &mnt_path, " \t\n\\"); | 208 | /* mountpoints outside of chroot jail will give SEQ_SKIP on this */ |
| 209 | err = seq_path_root(m, &mnt_path, &p->root, " \t\n\\"); | ||
| 210 | if (err) | ||
| 211 | goto out; | ||
| 205 | seq_putc(m, ' '); | 212 | seq_putc(m, ' '); |
| 206 | 213 | ||
| 207 | /* file system type */ | 214 | /* file system type */ |
| @@ -216,6 +223,7 @@ static int show_vfsstat(struct seq_file *m, struct vfsmount *mnt) | |||
| 216 | } | 223 | } |
| 217 | 224 | ||
| 218 | seq_putc(m, '\n'); | 225 | seq_putc(m, '\n'); |
| 226 | out: | ||
| 219 | return err; | 227 | return err; |
| 220 | } | 228 | } |
| 221 | 229 | ||
