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

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

Pull vfs fixes from Al Viro:
"Fix several places that screw up cleanups after failures halfway
through opening a file (one open-coding filp_clone_open() and getting
it wrong, two misusing alloc_file()). That part is -stable fodder from
the 'work.open' branch.

And Christoph's regression fix for uapi breakage in aio series;
include/uapi/linux/aio_abi.h shouldn't be pulling in the kernel
definition of sigset_t, the reason for doing so in the first place had
been bogus - there's no need to expose struct __aio_sigset in
aio_abi.h at all"

* 'fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs:
aio: don't expose __aio_sigset in uapi
ocxlflash_getfile(): fix double-iput() on alloc_file() failures
cxl_getfile(): fix double-iput() on alloc_file() failures
drm_mode_create_lease_ioctl(): fix open-coded filp_clone_open()

+14 -29
+1 -15
drivers/gpu/drm/drm_lease.c
··· 553 553 554 554 /* Clone the lessor file to create a new file for us */ 555 555 DRM_DEBUG_LEASE("Allocating lease file\n"); 556 - path_get(&lessor_file->f_path); 557 - lessee_file = alloc_file(&lessor_file->f_path, 558 - lessor_file->f_mode, 559 - fops_get(lessor_file->f_inode->i_fop)); 560 - 556 + lessee_file = filp_clone_open(lessor_file); 561 557 if (IS_ERR(lessee_file)) { 562 558 ret = PTR_ERR(lessee_file); 563 559 goto out_lessee; 564 560 } 565 561 566 - /* Initialize the new file for DRM */ 567 - DRM_DEBUG_LEASE("Initializing the file with %p\n", lessee_file->f_op->open); 568 - ret = lessee_file->f_op->open(lessee_file->f_inode, lessee_file); 569 - if (ret) 570 - goto out_lessee_file; 571 - 572 562 lessee_priv = lessee_file->private_data; 573 - 574 563 /* Change the file to a master one */ 575 564 drm_master_put(&lessee_priv->master); 576 565 lessee_priv->master = lessee; ··· 576 587 577 588 DRM_DEBUG_LEASE("drm_mode_create_lease_ioctl succeeded\n"); 578 589 return 0; 579 - 580 - out_lessee_file: 581 - fput(lessee_file); 582 590 583 591 out_lessee: 584 592 drm_master_put(&lessee);
+4 -4
drivers/misc/cxl/api.c
··· 103 103 d_instantiate(path.dentry, inode); 104 104 105 105 file = alloc_file(&path, OPEN_FMODE(flags), fops); 106 - if (IS_ERR(file)) 107 - goto err_dput; 106 + if (IS_ERR(file)) { 107 + path_put(&path); 108 + goto err_fs; 109 + } 108 110 file->f_flags = flags & (O_ACCMODE | O_NONBLOCK); 109 111 file->private_data = priv; 110 112 111 113 return file; 112 114 113 - err_dput: 114 - path_put(&path); 115 115 err_inode: 116 116 iput(inode); 117 117 err_fs:
+2 -3
drivers/scsi/cxlflash/ocxl_hw.c
··· 134 134 rc = PTR_ERR(file); 135 135 dev_err(dev, "%s: alloc_file failed rc=%d\n", 136 136 __func__, rc); 137 - goto err5; 137 + path_put(&path); 138 + goto err3; 138 139 } 139 140 140 141 file->f_flags = flags & (O_ACCMODE | O_NONBLOCK); 141 142 file->private_data = priv; 142 143 out: 143 144 return file; 144 - err5: 145 - path_put(&path); 146 145 err4: 147 146 iput(inode); 148 147 err3:
+5
fs/aio.c
··· 1896 1896 return ret; 1897 1897 } 1898 1898 1899 + struct __aio_sigset { 1900 + const sigset_t __user *sigmask; 1901 + size_t sigsetsize; 1902 + }; 1903 + 1899 1904 SYSCALL_DEFINE6(io_pgetevents, 1900 1905 aio_context_t, ctx_id, 1901 1906 long, min_nr,
-1
fs/internal.h
··· 127 127 128 128 extern int open_check_o_direct(struct file *f); 129 129 extern int vfs_open(const struct path *, struct file *, const struct cred *); 130 - extern struct file *filp_clone_open(struct file *); 131 130 132 131 /* 133 132 * inode.c
+1
include/linux/fs.h
··· 2420 2420 extern struct file *file_open_root(struct dentry *, struct vfsmount *, 2421 2421 const char *, int, umode_t); 2422 2422 extern struct file * dentry_open(const struct path *, int, const struct cred *); 2423 + extern struct file *filp_clone_open(struct file *); 2423 2424 extern int filp_close(struct file *, fl_owner_t id); 2424 2425 2425 2426 extern struct filename *getname_flags(const char __user *, int, int *);
+1
include/linux/syscalls.h
··· 11 11 #ifndef _LINUX_SYSCALLS_H 12 12 #define _LINUX_SYSCALLS_H 13 13 14 + struct __aio_sigset; 14 15 struct epoll_event; 15 16 struct iattr; 16 17 struct inode;
-6
include/uapi/linux/aio_abi.h
··· 29 29 30 30 #include <linux/types.h> 31 31 #include <linux/fs.h> 32 - #include <linux/signal.h> 33 32 #include <asm/byteorder.h> 34 33 35 34 typedef __kernel_ulong_t aio_context_t; ··· 108 109 109 110 #undef IFBIG 110 111 #undef IFLITTLE 111 - 112 - struct __aio_sigset { 113 - const sigset_t __user *sigmask; 114 - size_t sigsetsize; 115 - }; 116 112 117 113 #endif /* __LINUX__AIO_ABI_H */ 118 114