diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2014-12-19 21:19:19 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2014-12-19 21:19:19 -0500 |
commit | ecb5ec044ab99be1f35e93962fa43e4bb3120d9e (patch) | |
tree | 8832ba0b39783bd8a836b5552eb8f74d2e450afe /fs | |
parent | 298647e31af52e795867a399fa049cebd88067ff (diff) | |
parent | e3bb504efd919f7bacd24cb14038953899b909e1 (diff) |
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
Pull vfs pile #3 from Al Viro:
"Assorted fixes and patches from the last cycle"
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs:
[regression] chunk lost from bd9b51
vfs: make mounts and mountstats honor root dir like mountinfo does
vfs: cleanup show_mountinfo
init: fix read-write root mount
unfuck binfmt_misc.c (broken by commit e6084d4)
vm_area_operations: kill ->migrate()
new helper: iter_is_iovec()
move_extent_per_page(): get rid of unused w_flags
lustre: get rid of playing with ->fs
btrfs: filp_open() returns ERR_PTR() on failure, not NULL...
Diffstat (limited to 'fs')
-rw-r--r-- | fs/binfmt_misc.c | 7 | ||||
-rw-r--r-- | fs/btrfs/volumes.c | 2 | ||||
-rw-r--r-- | fs/ext4/move_extent.c | 4 | ||||
-rw-r--r-- | fs/kernfs/file.c | 22 | ||||
-rw-r--r-- | fs/proc_namespace.c | 16 |
5 files changed, 16 insertions, 35 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/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/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_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 | ||