Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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...

+29 -119
-24
drivers/staging/lustre/lustre/include/linux/lustre_compat25.h
··· 42 42 43 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 46 * set ATTR_BLOCKS to a high value to avoid any risk of collision with other 69 47 * ATTR_* attributes (see bug 13828) ··· 88 110 #define cfs_bio_io_error(a, b) bio_io_error((a)) 89 111 #define cfs_bio_endio(a, b, c) bio_endio((a), (c)) 90 112 91 - #define cfs_fs_pwd(fs) ((fs)->pwd.dentry) 92 - #define cfs_fs_mnt(fs) ((fs)->pwd.mnt) 93 113 #define cfs_path_put(nd) path_put(&(nd)->path) 94 114 95 115
+1 -1
drivers/staging/lustre/lustre/llite/dir.c
··· 661 661 int mode; 662 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 665 op_data = ll_prep_md_op_data(NULL, dir, NULL, filename, 666 666 strlen(filename), mode, LUSTRE_OPC_MKDIR, 667 667 lump);
+1 -16
drivers/staging/lustre/lustre/llite/llite_lib.c
··· 2372 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 2375 void ll_dirty_page_discard_warn(struct page *page, int ioret) 2391 2376 { 2392 2377 char *buf, *path = NULL; ··· 2383 2398 if (buf != NULL) { 2384 2399 dentry = d_find_alias(page->mapping->host); 2385 2400 if (dentry != NULL) 2386 - path = ll_d_path(dentry, buf, PAGE_SIZE); 2401 + path = dentry_path_raw(dentry, buf, PAGE_SIZE); 2387 2402 } 2388 2403 2389 2404 CDEBUG(D_WARNING,
+3 -4
fs/binfmt_misc.c
··· 254 254 return NULL; 255 255 } 256 256 } 257 + s[-1] ='\0'; 257 258 return s; 258 259 } 259 260 ··· 379 378 p = scanarg(p, del); 380 379 if (!p) 381 380 goto einval; 382 - p[-1] = '\0'; 383 - if (p == e->magic) 381 + if (!e->magic[0]) 384 382 goto einval; 385 383 if (USE_DEBUG) 386 384 print_hex_dump_bytes( ··· 391 391 p = scanarg(p, del); 392 392 if (!p) 393 393 goto einval; 394 - p[-1] = '\0'; 395 - if (p == e->mask) { 394 + if (!e->mask[0]) { 396 395 e->mask = NULL; 397 396 pr_debug("register: mask[raw]: none\n"); 398 397 } else if (USE_DEBUG)
+1 -1
fs/btrfs/volumes.c
··· 1485 1485 struct file *filp; 1486 1486 1487 1487 filp = filp_open(path_name, O_RDWR, 0); 1488 - if (!filp) 1488 + if (IS_ERR(filp)) 1489 1489 return; 1490 1490 file_update_time(filp); 1491 1491 filp_close(filp, NULL);
-4
fs/ext4/move_extent.c
··· 267 267 handle_t *handle; 268 268 ext4_lblk_t orig_blk_offset, donor_blk_offset; 269 269 unsigned long blocksize = orig_inode->i_sb->s_blocksize; 270 - unsigned int w_flags = 0; 271 270 unsigned int tmp_data_size, data_size, replaced_size; 272 271 int err2, jblocks, retries = 0; 273 272 int replaced_count = 0; ··· 286 287 *err = PTR_ERR(handle); 287 288 return 0; 288 289 } 289 - 290 - if (segment_eq(get_fs(), KERNEL_DS)) 291 - w_flags |= AOP_FLAG_UNINTERRUPTIBLE; 292 290 293 291 orig_blk_offset = orig_page_offset * blocks_per_page + 294 292 data_offset_in_page;
-22
fs/kernfs/file.c
··· 448 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 451 #endif 473 452 474 453 static const struct vm_operations_struct kernfs_vm_ops = { ··· 458 479 #ifdef CONFIG_NUMA 459 480 .set_policy = kernfs_vma_set_policy, 460 481 .get_policy = kernfs_vma_get_policy, 461 - .migrate = kernfs_vma_migrate, 462 482 #endif 463 483 }; 464 484
+12 -4
fs/proc_namespace.c
··· 91 91 92 92 static int show_vfsmnt(struct seq_file *m, struct vfsmount *mnt) 93 93 { 94 + struct proc_mounts *p = proc_mounts(m); 94 95 struct mount *r = real_mount(mnt); 95 96 int err = 0; 96 97 struct path mnt_path = { .dentry = mnt->mnt_root, .mnt = mnt }; ··· 105 104 mangle(m, r->mnt_devname ? r->mnt_devname : "none"); 106 105 } 107 106 seq_putc(m, ' '); 108 - seq_path(m, &mnt_path, " \t\n\\"); 107 + /* mountpoints outside of chroot jail will give SEQ_SKIP on this */ 108 + err = seq_path_root(m, &mnt_path, &p->root, " \t\n\\"); 109 + if (err) 110 + goto out; 109 111 seq_putc(m, ' '); 110 112 show_type(m, sb); 111 113 seq_puts(m, __mnt_is_readonly(mnt) ? " ro" : " rw"); ··· 129 125 struct mount *r = real_mount(mnt); 130 126 struct super_block *sb = mnt->mnt_sb; 131 127 struct path mnt_path = { .dentry = mnt->mnt_root, .mnt = mnt }; 132 - struct path root = p->root; 133 128 int err = 0; 134 129 135 130 seq_printf(m, "%i %i %u:%u ", r->mnt_id, r->mnt_parent->mnt_id, ··· 142 139 seq_putc(m, ' '); 143 140 144 141 /* mountpoints outside of chroot jail will give SEQ_SKIP on this */ 145 - err = seq_path_root(m, &mnt_path, &root, " \t\n\\"); 142 + err = seq_path_root(m, &mnt_path, &p->root, " \t\n\\"); 146 143 if (err) 147 144 goto out; 148 145 ··· 185 182 186 183 static int show_vfsstat(struct seq_file *m, struct vfsmount *mnt) 187 184 { 185 + struct proc_mounts *p = proc_mounts(m); 188 186 struct mount *r = real_mount(mnt); 189 187 struct path mnt_path = { .dentry = mnt->mnt_root, .mnt = mnt }; 190 188 struct super_block *sb = mnt_path.dentry->d_sb; ··· 205 201 206 202 /* mount point */ 207 203 seq_puts(m, " mounted on "); 208 - seq_path(m, &mnt_path, " \t\n\\"); 204 + /* mountpoints outside of chroot jail will give SEQ_SKIP on this */ 205 + err = seq_path_root(m, &mnt_path, &p->root, " \t\n\\"); 206 + if (err) 207 + goto out; 209 208 seq_putc(m, ' '); 210 209 211 210 /* file system type */ ··· 223 216 } 224 217 225 218 seq_putc(m, '\n'); 219 + out: 226 220 return err; 227 221 } 228 222
-10
include/linux/migrate.h
··· 36 36 37 37 extern int migrate_prep(void); 38 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 39 extern void migrate_page_copy(struct page *newpage, struct page *page); 43 40 extern int migrate_huge_page_move_mapping(struct address_space *mapping, 44 41 struct page *newpage, struct page *page); ··· 53 56 54 57 static inline int migrate_prep(void) { return -ENOSYS; } 55 58 static inline int migrate_prep_local(void) { return -ENOSYS; } 56 - 57 - static inline int migrate_vmas(struct mm_struct *mm, 58 - const nodemask_t *from, const nodemask_t *to, 59 - unsigned long flags) 60 - { 61 - return -ENOSYS; 62 - } 63 59 64 60 static inline void migrate_page_copy(struct page *newpage, 65 61 struct page *page) {}
-2
include/linux/mm.h
··· 286 286 */ 287 287 struct mempolicy *(*get_policy)(struct vm_area_struct *vma, 288 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 289 #endif 292 290 /* called by sys_remap_file_pages() to populate non-linear mapping */ 293 291 int (*remap_pages)(struct vm_area_struct *vma, unsigned long addr,
+5
include/linux/uio.h
··· 101 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 110 * Cap the iov_iter by given limit; note that the second argument is 106 111 * *not* the new size - it's upper limit for such. Passing it a value
+4 -2
init/do_mounts.c
··· 395 395 case 0: 396 396 goto out; 397 397 case -EACCES: 398 - flags |= MS_RDONLY; 399 - goto retry; 400 398 case -EINVAL: 401 399 continue; 402 400 } ··· 416 418 "explicit textual name for \"root=\" boot option.\n"); 417 419 #endif 418 420 panic("VFS: Unable to mount root fs on %s", b); 421 + } 422 + if (!(flags & MS_RDONLY)) { 423 + flags |= MS_RDONLY; 424 + goto retry; 419 425 } 420 426 421 427 printk("List of all partitions:\n");
+1 -1
mm/filemap.c
··· 2464 2464 /* 2465 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 2468 flags |= AOP_FLAG_UNINTERRUPTIBLE; 2469 2469 2470 2470 do {
-5
mm/mempolicy.c
··· 1041 1041 1042 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 1045 * Find a 'source' bit set in 'tmp' whose corresponding 'dest' 1050 1046 * bit in 'to' is not also set in 'tmp'. Clear the found 'source' ··· 1120 1124 if (err < 0) 1121 1125 break; 1122 1126 } 1123 - out: 1124 1127 up_read(&mm->mmap_sem); 1125 1128 if (err < 0) 1126 1129 return err;
-21
mm/migrate.c
··· 1536 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 1539 #ifdef CONFIG_NUMA_BALANCING 1561 1540 /* 1562 1541 * Returns true if this is a safe migration target node for misplaced NUMA
+1 -1
mm/shmem.c
··· 1536 1536 * holes of a sparse file, we actually need to allocate those pages, 1537 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 1540 sgp = SGP_DIRTY; 1541 1541 1542 1542 index = *ppos >> PAGE_CACHE_SHIFT;
-1
net/socket.c
··· 372 372 path.mnt = mntget(sock_mnt); 373 373 374 374 d_instantiate(path.dentry, SOCK_INODE(sock)); 375 - SOCK_INODE(sock)->i_fop = &socket_file_ops; 376 375 377 376 file = alloc_file(&path, FMODE_READ | FMODE_WRITE, 378 377 &socket_file_ops);