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 | |
| 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...
| -rw-r--r-- | drivers/staging/lustre/lustre/include/linux/lustre_compat25.h | 24 | ||||
| -rw-r--r-- | drivers/staging/lustre/lustre/llite/dir.c | 2 | ||||
| -rw-r--r-- | drivers/staging/lustre/lustre/llite/llite_lib.c | 17 | ||||
| -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 | ||||
| -rw-r--r-- | include/linux/migrate.h | 10 | ||||
| -rw-r--r-- | include/linux/mm.h | 2 | ||||
| -rw-r--r-- | include/linux/uio.h | 5 | ||||
| -rw-r--r-- | init/do_mounts.c | 6 | ||||
| -rw-r--r-- | mm/filemap.c | 2 | ||||
| -rw-r--r-- | mm/mempolicy.c | 5 | ||||
| -rw-r--r-- | mm/migrate.c | 21 | ||||
| -rw-r--r-- | mm/shmem.c | 2 | ||||
| -rw-r--r-- | net/socket.c | 1 |
17 files changed, 29 insertions, 119 deletions
diff --git a/drivers/staging/lustre/lustre/include/linux/lustre_compat25.h b/drivers/staging/lustre/lustre/include/linux/lustre_compat25.h index 8156b4c0f568..3925db160650 100644 --- a/drivers/staging/lustre/lustre/include/linux/lustre_compat25.h +++ b/drivers/staging/lustre/lustre/include/linux/lustre_compat25.h | |||
| @@ -42,28 +42,6 @@ | |||
| 42 | 42 | ||
| 43 | #include "lustre_patchless_compat.h" | 43 | #include "lustre_patchless_compat.h" |
| 44 | 44 | ||
| 45 | # define LOCK_FS_STRUCT(fs) spin_lock(&(fs)->lock) | ||
| 46 | # define UNLOCK_FS_STRUCT(fs) spin_unlock(&(fs)->lock) | ||
| 47 | |||
| 48 | static inline void ll_set_fs_pwd(struct fs_struct *fs, struct vfsmount *mnt, | ||
| 49 | struct dentry *dentry) | ||
| 50 | { | ||
| 51 | struct path path; | ||
| 52 | struct path old_pwd; | ||
| 53 | |||
| 54 | path.mnt = mnt; | ||
| 55 | path.dentry = dentry; | ||
| 56 | LOCK_FS_STRUCT(fs); | ||
| 57 | old_pwd = fs->pwd; | ||
| 58 | path_get(&path); | ||
| 59 | fs->pwd = path; | ||
| 60 | UNLOCK_FS_STRUCT(fs); | ||
| 61 | |||
| 62 | if (old_pwd.dentry) | ||
| 63 | path_put(&old_pwd); | ||
| 64 | } | ||
| 65 | |||
| 66 | |||
| 67 | /* | 45 | /* |
| 68 | * set ATTR_BLOCKS to a high value to avoid any risk of collision with other | 46 | * set ATTR_BLOCKS to a high value to avoid any risk of collision with other |
| 69 | * ATTR_* attributes (see bug 13828) | 47 | * ATTR_* attributes (see bug 13828) |
| @@ -110,8 +88,6 @@ static inline void ll_set_fs_pwd(struct fs_struct *fs, struct vfsmount *mnt, | |||
| 110 | #define cfs_bio_io_error(a, b) bio_io_error((a)) | 88 | #define cfs_bio_io_error(a, b) bio_io_error((a)) |
| 111 | #define cfs_bio_endio(a, b, c) bio_endio((a), (c)) | 89 | #define cfs_bio_endio(a, b, c) bio_endio((a), (c)) |
| 112 | 90 | ||
| 113 | #define cfs_fs_pwd(fs) ((fs)->pwd.dentry) | ||
| 114 | #define cfs_fs_mnt(fs) ((fs)->pwd.mnt) | ||
| 115 | #define cfs_path_put(nd) path_put(&(nd)->path) | 91 | #define cfs_path_put(nd) path_put(&(nd)->path) |
| 116 | 92 | ||
| 117 | 93 | ||
diff --git a/drivers/staging/lustre/lustre/llite/dir.c b/drivers/staging/lustre/lustre/llite/dir.c index 407718a0026f..1ac7a702ce26 100644 --- a/drivers/staging/lustre/lustre/llite/dir.c +++ b/drivers/staging/lustre/lustre/llite/dir.c | |||
| @@ -661,7 +661,7 @@ int ll_dir_setdirstripe(struct inode *dir, struct lmv_user_md *lump, | |||
| 661 | int mode; | 661 | int mode; |
| 662 | int err; | 662 | int err; |
| 663 | 663 | ||
| 664 | mode = (0755 & (S_IRWXUGO|S_ISVTX) & ~current->fs->umask) | S_IFDIR; | 664 | mode = (0755 & ~current_umask()) | S_IFDIR; |
| 665 | op_data = ll_prep_md_op_data(NULL, dir, NULL, filename, | 665 | op_data = ll_prep_md_op_data(NULL, dir, NULL, filename, |
| 666 | strlen(filename), mode, LUSTRE_OPC_MKDIR, | 666 | strlen(filename), mode, LUSTRE_OPC_MKDIR, |
| 667 | lump); | 667 | lump); |
diff --git a/drivers/staging/lustre/lustre/llite/llite_lib.c b/drivers/staging/lustre/lustre/llite/llite_lib.c index 6e423aa6a6e4..a3367bfb1456 100644 --- a/drivers/staging/lustre/lustre/llite/llite_lib.c +++ b/drivers/staging/lustre/lustre/llite/llite_lib.c | |||
| @@ -2372,21 +2372,6 @@ char *ll_get_fsname(struct super_block *sb, char *buf, int buflen) | |||
| 2372 | return buf; | 2372 | return buf; |
| 2373 | } | 2373 | } |
| 2374 | 2374 | ||
| 2375 | static char *ll_d_path(struct dentry *dentry, char *buf, int bufsize) | ||
| 2376 | { | ||
| 2377 | char *path = NULL; | ||
| 2378 | |||
| 2379 | struct path p; | ||
| 2380 | |||
| 2381 | p.dentry = dentry; | ||
| 2382 | p.mnt = current->fs->root.mnt; | ||
| 2383 | path_get(&p); | ||
| 2384 | path = d_path(&p, buf, bufsize); | ||
| 2385 | path_put(&p); | ||
| 2386 | |||
| 2387 | return path; | ||
| 2388 | } | ||
| 2389 | |||
| 2390 | void ll_dirty_page_discard_warn(struct page *page, int ioret) | 2375 | void ll_dirty_page_discard_warn(struct page *page, int ioret) |
| 2391 | { | 2376 | { |
| 2392 | char *buf, *path = NULL; | 2377 | char *buf, *path = NULL; |
| @@ -2398,7 +2383,7 @@ void ll_dirty_page_discard_warn(struct page *page, int ioret) | |||
| 2398 | if (buf != NULL) { | 2383 | if (buf != NULL) { |
| 2399 | dentry = d_find_alias(page->mapping->host); | 2384 | dentry = d_find_alias(page->mapping->host); |
| 2400 | if (dentry != NULL) | 2385 | if (dentry != NULL) |
| 2401 | path = ll_d_path(dentry, buf, PAGE_SIZE); | 2386 | path = dentry_path_raw(dentry, buf, PAGE_SIZE); |
| 2402 | } | 2387 | } |
| 2403 | 2388 | ||
| 2404 | CDEBUG(D_WARNING, | 2389 | CDEBUG(D_WARNING, |
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 | ||
diff --git a/include/linux/migrate.h b/include/linux/migrate.h index 01aad3ed89ec..fab9b32ace8e 100644 --- a/include/linux/migrate.h +++ b/include/linux/migrate.h | |||
| @@ -36,9 +36,6 @@ extern int migrate_pages(struct list_head *l, new_page_t new, free_page_t free, | |||
| 36 | 36 | ||
| 37 | extern int migrate_prep(void); | 37 | extern int migrate_prep(void); |
| 38 | extern int migrate_prep_local(void); | 38 | extern int migrate_prep_local(void); |
| 39 | extern int migrate_vmas(struct mm_struct *mm, | ||
| 40 | const nodemask_t *from, const nodemask_t *to, | ||
| 41 | unsigned long flags); | ||
| 42 | extern void migrate_page_copy(struct page *newpage, struct page *page); | 39 | extern void migrate_page_copy(struct page *newpage, struct page *page); |
| 43 | extern int migrate_huge_page_move_mapping(struct address_space *mapping, | 40 | extern int migrate_huge_page_move_mapping(struct address_space *mapping, |
| 44 | struct page *newpage, struct page *page); | 41 | struct page *newpage, struct page *page); |
| @@ -57,13 +54,6 @@ static inline int migrate_pages(struct list_head *l, new_page_t new, | |||
| 57 | static inline int migrate_prep(void) { return -ENOSYS; } | 54 | static inline int migrate_prep(void) { return -ENOSYS; } |
| 58 | static inline int migrate_prep_local(void) { return -ENOSYS; } | 55 | static inline int migrate_prep_local(void) { return -ENOSYS; } |
| 59 | 56 | ||
| 60 | static inline int migrate_vmas(struct mm_struct *mm, | ||
| 61 | const nodemask_t *from, const nodemask_t *to, | ||
| 62 | unsigned long flags) | ||
| 63 | { | ||
| 64 | return -ENOSYS; | ||
| 65 | } | ||
| 66 | |||
| 67 | static inline void migrate_page_copy(struct page *newpage, | 57 | static inline void migrate_page_copy(struct page *newpage, |
| 68 | struct page *page) {} | 58 | struct page *page) {} |
| 69 | 59 | ||
diff --git a/include/linux/mm.h b/include/linux/mm.h index c0a67b894c4c..f80d0194c9bc 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h | |||
| @@ -286,8 +286,6 @@ struct vm_operations_struct { | |||
| 286 | */ | 286 | */ |
| 287 | struct mempolicy *(*get_policy)(struct vm_area_struct *vma, | 287 | struct mempolicy *(*get_policy)(struct vm_area_struct *vma, |
| 288 | unsigned long addr); | 288 | unsigned long addr); |
| 289 | int (*migrate)(struct vm_area_struct *vma, const nodemask_t *from, | ||
| 290 | const nodemask_t *to, unsigned long flags); | ||
| 291 | #endif | 289 | #endif |
| 292 | /* called by sys_remap_file_pages() to populate non-linear mapping */ | 290 | /* called by sys_remap_file_pages() to populate non-linear mapping */ |
| 293 | int (*remap_pages)(struct vm_area_struct *vma, unsigned long addr, | 291 | int (*remap_pages)(struct vm_area_struct *vma, unsigned long addr, |
diff --git a/include/linux/uio.h b/include/linux/uio.h index a41e252396c0..1c5e453f7ea9 100644 --- a/include/linux/uio.h +++ b/include/linux/uio.h | |||
| @@ -101,6 +101,11 @@ static inline size_t iov_iter_count(struct iov_iter *i) | |||
| 101 | return i->count; | 101 | return i->count; |
| 102 | } | 102 | } |
| 103 | 103 | ||
| 104 | static inline bool iter_is_iovec(struct iov_iter *i) | ||
| 105 | { | ||
| 106 | return !(i->type & (ITER_BVEC | ITER_KVEC)); | ||
| 107 | } | ||
| 108 | |||
| 104 | /* | 109 | /* |
| 105 | * Cap the iov_iter by given limit; note that the second argument is | 110 | * Cap the iov_iter by given limit; note that the second argument is |
| 106 | * *not* the new size - it's upper limit for such. Passing it a value | 111 | * *not* the new size - it's upper limit for such. Passing it a value |
diff --git a/init/do_mounts.c b/init/do_mounts.c index 9b3565c41502..eb410083e8e0 100644 --- a/init/do_mounts.c +++ b/init/do_mounts.c | |||
| @@ -395,8 +395,6 @@ retry: | |||
| 395 | case 0: | 395 | case 0: |
| 396 | goto out; | 396 | goto out; |
| 397 | case -EACCES: | 397 | case -EACCES: |
| 398 | flags |= MS_RDONLY; | ||
| 399 | goto retry; | ||
| 400 | case -EINVAL: | 398 | case -EINVAL: |
| 401 | continue; | 399 | continue; |
| 402 | } | 400 | } |
| @@ -419,6 +417,10 @@ retry: | |||
| 419 | #endif | 417 | #endif |
| 420 | panic("VFS: Unable to mount root fs on %s", b); | 418 | panic("VFS: Unable to mount root fs on %s", b); |
| 421 | } | 419 | } |
| 420 | if (!(flags & MS_RDONLY)) { | ||
| 421 | flags |= MS_RDONLY; | ||
| 422 | goto retry; | ||
| 423 | } | ||
| 422 | 424 | ||
| 423 | printk("List of all partitions:\n"); | 425 | printk("List of all partitions:\n"); |
| 424 | printk_all_partitions(); | 426 | printk_all_partitions(); |
diff --git a/mm/filemap.c b/mm/filemap.c index e8905bc3cbd7..bd8543c6508f 100644 --- a/mm/filemap.c +++ b/mm/filemap.c | |||
| @@ -2464,7 +2464,7 @@ ssize_t generic_perform_write(struct file *file, | |||
| 2464 | /* | 2464 | /* |
| 2465 | * Copies from kernel address space cannot fail (NFSD is a big user). | 2465 | * Copies from kernel address space cannot fail (NFSD is a big user). |
| 2466 | */ | 2466 | */ |
| 2467 | if (segment_eq(get_fs(), KERNEL_DS)) | 2467 | if (!iter_is_iovec(i)) |
| 2468 | flags |= AOP_FLAG_UNINTERRUPTIBLE; | 2468 | flags |= AOP_FLAG_UNINTERRUPTIBLE; |
| 2469 | 2469 | ||
| 2470 | do { | 2470 | do { |
diff --git a/mm/mempolicy.c b/mm/mempolicy.c index f22c55947181..0e0961b8c39c 100644 --- a/mm/mempolicy.c +++ b/mm/mempolicy.c | |||
| @@ -1041,10 +1041,6 @@ int do_migrate_pages(struct mm_struct *mm, const nodemask_t *from, | |||
| 1041 | 1041 | ||
| 1042 | down_read(&mm->mmap_sem); | 1042 | down_read(&mm->mmap_sem); |
| 1043 | 1043 | ||
| 1044 | err = migrate_vmas(mm, from, to, flags); | ||
| 1045 | if (err) | ||
| 1046 | goto out; | ||
| 1047 | |||
| 1048 | /* | 1044 | /* |
| 1049 | * Find a 'source' bit set in 'tmp' whose corresponding 'dest' | 1045 | * Find a 'source' bit set in 'tmp' whose corresponding 'dest' |
| 1050 | * bit in 'to' is not also set in 'tmp'. Clear the found 'source' | 1046 | * bit in 'to' is not also set in 'tmp'. Clear the found 'source' |
| @@ -1124,7 +1120,6 @@ int do_migrate_pages(struct mm_struct *mm, const nodemask_t *from, | |||
| 1124 | if (err < 0) | 1120 | if (err < 0) |
| 1125 | break; | 1121 | break; |
| 1126 | } | 1122 | } |
| 1127 | out: | ||
| 1128 | up_read(&mm->mmap_sem); | 1123 | up_read(&mm->mmap_sem); |
| 1129 | if (err < 0) | 1124 | if (err < 0) |
| 1130 | return err; | 1125 | return err; |
diff --git a/mm/migrate.c b/mm/migrate.c index b1d02127e1be..344cdf692fc8 100644 --- a/mm/migrate.c +++ b/mm/migrate.c | |||
| @@ -1536,27 +1536,6 @@ out: | |||
| 1536 | return err; | 1536 | return err; |
| 1537 | } | 1537 | } |
| 1538 | 1538 | ||
| 1539 | /* | ||
| 1540 | * Call migration functions in the vma_ops that may prepare | ||
| 1541 | * memory in a vm for migration. migration functions may perform | ||
| 1542 | * the migration for vmas that do not have an underlying page struct. | ||
| 1543 | */ | ||
| 1544 | int migrate_vmas(struct mm_struct *mm, const nodemask_t *to, | ||
| 1545 | const nodemask_t *from, unsigned long flags) | ||
| 1546 | { | ||
| 1547 | struct vm_area_struct *vma; | ||
| 1548 | int err = 0; | ||
| 1549 | |||
| 1550 | for (vma = mm->mmap; vma && !err; vma = vma->vm_next) { | ||
| 1551 | if (vma->vm_ops && vma->vm_ops->migrate) { | ||
| 1552 | err = vma->vm_ops->migrate(vma, to, from, flags); | ||
| 1553 | if (err) | ||
| 1554 | break; | ||
| 1555 | } | ||
| 1556 | } | ||
| 1557 | return err; | ||
| 1558 | } | ||
| 1559 | |||
| 1560 | #ifdef CONFIG_NUMA_BALANCING | 1539 | #ifdef CONFIG_NUMA_BALANCING |
| 1561 | /* | 1540 | /* |
| 1562 | * Returns true if this is a safe migration target node for misplaced NUMA | 1541 | * Returns true if this is a safe migration target node for misplaced NUMA |
diff --git a/mm/shmem.c b/mm/shmem.c index 185836ba53ef..73ba1df7c8ba 100644 --- a/mm/shmem.c +++ b/mm/shmem.c | |||
| @@ -1536,7 +1536,7 @@ static ssize_t shmem_file_read_iter(struct kiocb *iocb, struct iov_iter *to) | |||
| 1536 | * holes of a sparse file, we actually need to allocate those pages, | 1536 | * holes of a sparse file, we actually need to allocate those pages, |
| 1537 | * and even mark them dirty, so it cannot exceed the max_blocks limit. | 1537 | * and even mark them dirty, so it cannot exceed the max_blocks limit. |
| 1538 | */ | 1538 | */ |
| 1539 | if (segment_eq(get_fs(), KERNEL_DS)) | 1539 | if (!iter_is_iovec(to)) |
| 1540 | sgp = SGP_DIRTY; | 1540 | sgp = SGP_DIRTY; |
| 1541 | 1541 | ||
| 1542 | index = *ppos >> PAGE_CACHE_SHIFT; | 1542 | index = *ppos >> PAGE_CACHE_SHIFT; |
diff --git a/net/socket.c b/net/socket.c index 70bbde65e4ca..a2c33a4dc7ba 100644 --- a/net/socket.c +++ b/net/socket.c | |||
| @@ -372,7 +372,6 @@ struct file *sock_alloc_file(struct socket *sock, int flags, const char *dname) | |||
| 372 | path.mnt = mntget(sock_mnt); | 372 | path.mnt = mntget(sock_mnt); |
| 373 | 373 | ||
| 374 | d_instantiate(path.dentry, SOCK_INODE(sock)); | 374 | d_instantiate(path.dentry, SOCK_INODE(sock)); |
| 375 | SOCK_INODE(sock)->i_fop = &socket_file_ops; | ||
| 376 | 375 | ||
| 377 | file = alloc_file(&path, FMODE_READ | FMODE_WRITE, | 376 | file = alloc_file(&path, FMODE_READ | FMODE_WRITE, |
| 378 | &socket_file_ops); | 377 | &socket_file_ops); |
