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

Merge branch 'work.misc' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs

Pull vfs updates from Al Viro:
"Assorted bits and pieces"

* 'work.misc' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs:
aio: drop needless assignment in aio_read()
clean overflow checks in count_mounts() a bit
seq_file: fix NULL pointer arithmetic warning
uml/x86: use x86 load_unaligned_zeropad()
asm/user.h: killed unused macros
constify struct path argument of finish_automount()/do_add_mount()
fs: Remove FIXME comment in generic_write_checks()

+18 -96
-6
arch/alpha/include/asm/user.h
··· 45 45 char u_comm[32]; /* user command name */ 46 46 }; 47 47 48 - #define NBPG PAGE_SIZE 49 - #define UPAGES 1 50 - #define HOST_TEXT_START_ADDR (u.start_code) 51 - #define HOST_DATA_START_ADDR (u.start_data) 52 - #define HOST_STACK_END_ADDR (u.start_stack + u.u_ssize * NBPG) 53 - 54 48 #endif /* _ALPHA_USER_H */
-4
arch/arm/include/asm/user.h
··· 77 77 struct user_fp_struct * u_fp0;/* Used by gdb to help find the values for */ 78 78 /* the FP registers. */ 79 79 }; 80 - #define NBPG PAGE_SIZE 81 - #define UPAGES 1 82 - #define HOST_TEXT_START_ADDR (u.start_code) 83 - #define HOST_STACK_END_ADDR (u.start_stack + u.u_ssize * NBPG) 84 80 85 81 /* 86 82 * User specific VFP registers. If only VFPv2 is present, registers 16 to 31
-4
arch/h8300/include/asm/user.h
··· 67 67 unsigned long magic; /* To uniquely identify a core file */ 68 68 char u_comm[32]; /* User command that was responsible */ 69 69 }; 70 - #define NBPG PAGE_SIZE 71 - #define UPAGES 1 72 - #define HOST_TEXT_START_ADDR (u.start_code) 73 - #define HOST_STACK_END_ADDR (u.start_stack + u.u_ssize * NBPG) 74 70 75 71 #endif
-6
arch/ia64/include/asm/user.h
··· 50 50 char u_comm[32]; /* user command name */ 51 51 }; 52 52 53 - #define NBPG PAGE_SIZE 54 - #define UPAGES 1 55 - #define HOST_TEXT_START_ADDR (u.start_code) 56 - #define HOST_DATA_START_ADDR (u.start_data) 57 - #define HOST_STACK_END_ADDR (u.start_stack + u.u_ssize * NBPG) 58 - 59 53 #endif /* _ASM_IA64_USER_H */
-4
arch/m68k/include/asm/user.h
··· 79 79 unsigned long magic; /* To uniquely identify a core file */ 80 80 char u_comm[32]; /* User command that was responsible */ 81 81 }; 82 - #define NBPG 4096 83 - #define UPAGES 1 84 - #define HOST_TEXT_START_ADDR (u.start_code) 85 - #define HOST_STACK_END_ADDR (u.start_stack + u.u_ssize * NBPG) 86 82 87 83 #endif
-5
arch/powerpc/include/asm/user.h
··· 44 44 char u_comm[32]; /* user command name */ 45 45 }; 46 46 47 - #define NBPG PAGE_SIZE 48 - #define UPAGES 1 49 - #define HOST_TEXT_START_ADDR (u.start_code) 50 - #define HOST_DATA_START_ADDR (u.start_data) 51 - #define HOST_STACK_END_ADDR (u.start_stack + u.u_ssize * NBPG) 52 47 #endif /* _ASM_POWERPC_USER_H */
-4
arch/s390/include/asm/user.h
··· 67 67 unsigned long magic; /* To uniquely identify a core file */ 68 68 char u_comm[32]; /* User command that was responsible */ 69 69 }; 70 - #define NBPG PAGE_SIZE 71 - #define UPAGES 1 72 - #define HOST_TEXT_START_ADDR (u.start_code) 73 - #define HOST_STACK_END_ADDR (u.start_stack + u.u_ssize * NBPG) 74 70 75 71 #endif /* _S390_USER_H */
-6
arch/sh/include/asm/user.h
··· 52 52 char u_comm[32]; /* user command name */ 53 53 }; 54 54 55 - #define NBPG PAGE_SIZE 56 - #define UPAGES 1 57 - #define HOST_TEXT_START_ADDR (u.start_code) 58 - #define HOST_DATA_START_ADDR (u.start_data) 59 - #define HOST_STACK_END_ADDR (u.start_stack + u.u_ssize * NBPG) 60 - 61 55 #endif /* __ASM_SH_USER_H */
-1
arch/um/include/asm/Kbuild
··· 24 24 generic-y += switch_to.h 25 25 generic-y += topology.h 26 26 generic-y += trace_clock.h 27 - generic-y += word-at-a-time.h 28 27 generic-y += kprobes.h 29 28 generic-y += mm_hooks.h 30 29 generic-y += vga.h
-4
arch/x86/include/asm/user_32.h
··· 124 124 char u_comm[32]; /* User command that was responsible */ 125 125 int u_debugreg[8]; 126 126 }; 127 - #define NBPG PAGE_SIZE 128 - #define UPAGES 1 129 - #define HOST_TEXT_START_ADDR (u.start_code) 130 - #define HOST_STACK_END_ADDR (u.start_stack + u.u_ssize * NBPG) 131 127 132 128 #endif /* _ASM_X86_USER_32_H */
-4
arch/x86/include/asm/user_64.h
··· 130 130 unsigned long error_code; /* CPU error code or 0 */ 131 131 unsigned long fault_address; /* CR3 or 0 */ 132 132 }; 133 - #define NBPG PAGE_SIZE 134 - #define UPAGES 1 135 - #define HOST_TEXT_START_ADDR (u.start_code) 136 - #define HOST_STACK_END_ADDR (u.start_stack + u.u_ssize * NBPG) 137 133 138 134 #endif /* _ASM_X86_USER_64_H */
-26
arch/x86/lib/csum-partial_64.c
··· 93 93 buff += 8; 94 94 } 95 95 if (len & 7) { 96 - #ifdef CONFIG_DCACHE_WORD_ACCESS 97 96 unsigned int shift = (8 - (len & 7)) * 8; 98 97 unsigned long trail; 99 98 ··· 102 103 "adcq $0,%[res]" 103 104 : [res] "+r" (temp64) 104 105 : [trail] "r" (trail)); 105 - #else 106 - if (len & 4) { 107 - asm("addq %[val],%[res]\n\t" 108 - "adcq $0,%[res]" 109 - : [res] "+r" (temp64) 110 - : [val] "r" ((u64)*(u32 *)buff) 111 - : "memory"); 112 - buff += 4; 113 - } 114 - if (len & 2) { 115 - asm("addq %[val],%[res]\n\t" 116 - "adcq $0,%[res]" 117 - : [res] "+r" (temp64) 118 - : [val] "r" ((u64)*(u16 *)buff) 119 - : "memory"); 120 - buff += 2; 121 - } 122 - if (len & 1) { 123 - asm("addq %[val],%[res]\n\t" 124 - "adcq $0,%[res]" 125 - : [res] "+r" (temp64) 126 - : [val] "r" ((u64)*(u8 *)buff) 127 - : "memory"); 128 - } 129 - #endif 130 106 } 131 107 result = add32_with_carry(temp64 >> 32, temp64 & 0xffffffff); 132 108 if (unlikely(odd)) {
+1
arch/x86/um/Kconfig
··· 9 9 config UML_X86 10 10 def_bool y 11 11 select ARCH_BINFMT_ELF_EXTRA_PHDRS if X86_32 12 + select DCACHE_WORD_ACCESS 12 13 13 14 config 64BIT 14 15 bool "64-bit kernel" if "$(SUBARCH)" = "x86"
-1
fs/aio.c
··· 1552 1552 file = req->ki_filp; 1553 1553 if (unlikely(!(file->f_mode & FMODE_READ))) 1554 1554 return -EBADF; 1555 - ret = -EINVAL; 1556 1555 if (unlikely(!file->f_op->read_iter)) 1557 1556 return -EINVAL; 1558 1557
+1 -1
fs/internal.h
··· 74 74 * namespace.c 75 75 */ 76 76 extern struct vfsmount *lookup_mnt(const struct path *); 77 - extern int finish_automount(struct vfsmount *, struct path *); 77 + extern int finish_automount(struct vfsmount *, const struct path *); 78 78 79 79 extern int sb_prepare_remount_readonly(struct super_block *); 80 80
+1 -6
fs/kernfs/file.c
··· 120 120 if (next == ERR_PTR(-ENODEV)) 121 121 kernfs_seq_stop_active(sf, next); 122 122 return next; 123 - } else { 124 - /* 125 - * The same behavior and code as single_open(). Returns 126 - * !NULL if pos is at the beginning; otherwise, NULL. 127 - */ 128 - return NULL + !*ppos; 129 123 } 124 + return single_start(sf, ppos); 130 125 } 131 126 132 127 static void *kernfs_seq_next(struct seq_file *sf, void *v, loff_t *ppos)
+12 -11
fs/namespace.c
··· 2112 2112 int count_mounts(struct mnt_namespace *ns, struct mount *mnt) 2113 2113 { 2114 2114 unsigned int max = READ_ONCE(sysctl_mount_max); 2115 - unsigned int mounts = 0, old, pending, sum; 2115 + unsigned int mounts = 0; 2116 2116 struct mount *p; 2117 + 2118 + if (ns->mounts >= max) 2119 + return -ENOSPC; 2120 + max -= ns->mounts; 2121 + if (ns->pending_mounts >= max) 2122 + return -ENOSPC; 2123 + max -= ns->pending_mounts; 2117 2124 2118 2125 for (p = mnt; p; p = next_mnt(p, mnt)) 2119 2126 mounts++; 2120 2127 2121 - old = ns->mounts; 2122 - pending = ns->pending_mounts; 2123 - sum = old + pending; 2124 - if ((old > sum) || 2125 - (pending > sum) || 2126 - (max < sum) || 2127 - (mounts > (max - sum))) 2128 + if (mounts > max) 2128 2129 return -ENOSPC; 2129 2130 2130 - ns->pending_mounts = pending + mounts; 2131 + ns->pending_mounts += mounts; 2131 2132 return 0; 2132 2133 } 2133 2134 ··· 2922 2921 * add a mount into a namespace's mount tree 2923 2922 */ 2924 2923 static int do_add_mount(struct mount *newmnt, struct mountpoint *mp, 2925 - struct path *path, int mnt_flags) 2924 + const struct path *path, int mnt_flags) 2926 2925 { 2927 2926 struct mount *parent = real_mount(path->mnt); 2928 2927 ··· 3045 3044 return err; 3046 3045 } 3047 3046 3048 - int finish_automount(struct vfsmount *m, struct path *path) 3047 + int finish_automount(struct vfsmount *m, const struct path *path) 3049 3048 { 3050 3049 struct dentry *dentry = path->dentry; 3051 3050 struct mountpoint *mp;
-1
fs/read_write.c
··· 1630 1630 if (!*count) 1631 1631 return 0; 1632 1632 1633 - /* FIXME: this is for backwards compatibility with 2.4 */ 1634 1633 if (iocb->ki_flags & IOCB_APPEND) 1635 1634 iocb->ki_pos = i_size_read(inode); 1636 1635
+2 -2
fs/seq_file.c
··· 554 554 } 555 555 EXPORT_SYMBOL(seq_dentry); 556 556 557 - static void *single_start(struct seq_file *p, loff_t *pos) 557 + void *single_start(struct seq_file *p, loff_t *pos) 558 558 { 559 - return NULL + (*pos == 0); 559 + return *pos ? NULL : SEQ_START_TOKEN; 560 560 } 561 561 562 562 static void *single_next(struct seq_file *p, void *v, loff_t *pos)
+1
include/linux/seq_file.h
··· 162 162 int seq_path_root(struct seq_file *m, const struct path *path, 163 163 const struct path *root, const char *esc); 164 164 165 + void *single_start(struct seq_file *, loff_t *); 165 166 int single_open(struct file *, int (*)(struct seq_file *, void *), void *); 166 167 int single_open_size(struct file *, int (*)(struct seq_file *, void *), void *, size_t); 167 168 int single_release(struct inode *, struct file *);