linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* linux-next: manual merge of the vfs tree with the overlayfs tree
@ 2018-07-10  0:17 Stephen Rothwell
  2018-07-10 15:04 ` Al Viro
  0 siblings, 1 reply; 79+ messages in thread
From: Stephen Rothwell @ 2018-07-10  0:17 UTC (permalink / raw)
  To: Al Viro, Miklos Szeredi
  Cc: Linux-Next Mailing List, Linux Kernel Mailing List

[-- Attachment #1: Type: text/plain, Size: 3513 bytes --]

Hi all,

Today's linux-next merge of the vfs tree got conflicts in:

  fs/open.c

between commit:

  d4d6f39c507e ("vfs: optionally don't account file in nr_files")
  88498a6bd8d1 ("vfs: simplify dentry_open()")

from the overlayfs tree and commit:

  5f0cc0005d2e ("introduce FMODE_OPENED")
  13fcca01ef86 ("now we can fold open_check_o_direct() into do_dentry_open()")
  7dfb1eeaea37 ("introduce FMODE_CREATED and switch to it")

from the vfs tree.

I *think* I got this right, but please check.  Is there some way that
these overlayfs commits can be integrated into the vfs tree development
(or vice versa).  Also, I would expect to see *some* Reviewed-by or
Acked-by lines in all this work ...

I fixed it up (see below) and can carry the fix as necessary. This
is now fixed as far as linux-next is concerned, but any non trivial
conflicts should be mentioned to your upstream maintainer when your tree
is submitted for merging.  You may also want to consider cooperating
with the maintainer of the conflicting tree to minimise any particularly
complex conflicts.

-- 
Cheers,
Stephen Rothwell

diff --cc fs/open.c
index 52a1ea584669,39dcbf13031c..000000000000
--- a/fs/open.c
+++ b/fs/open.c
@@@ -731,7 -732,6 +721,7 @@@ static int do_dentry_open(struct file *
  	static const struct file_operations empty_fops = {};
  	int error;
  
- 	WARN_ON(f->f_mode & ~FMODE_NOACCOUNT);
++	WARN_ON(f->f_mode & ~ (FMODE_NOACCOUNT | FMODE_CREATED));
  	f->f_mode |= OPEN_FMODE(f->f_flags) | FMODE_LSEEK |
  				FMODE_PREAD | FMODE_PWRITE;
  
@@@ -743,8 -743,7 +733,8 @@@
  	f->f_wb_err = filemap_sample_wb_err(f->f_mapping);
  
  	if (unlikely(f->f_flags & O_PATH)) {
 +		WARN_ON(f->f_mode & FMODE_NOACCOUNT);
- 		f->f_mode = FMODE_PATH;
+ 		f->f_mode = FMODE_PATH | FMODE_OPENED;
  		f->f_op = &empty_fops;
  		return 0;
  	}
@@@ -890,47 -893,14 +884,44 @@@ EXPORT_SYMBOL(file_path)
  int vfs_open(const struct path *path, struct file *file,
  	     const struct cred *cred)
  {
 -	struct dentry *dentry = d_real(path->dentry, NULL, file->f_flags, 0);
 +	file->f_path = *path;
 +	return do_dentry_open(file, d_backing_inode(path->dentry), NULL, cred);
 +}
  
 -	if (IS_ERR(dentry))
 -		return PTR_ERR(dentry);
 +/**
 + * path_open() - Open an inode by a particular name.
 + * @path: The name of the file.
 + * @flags: The O_ flags used to open this file.
 + * @inode: The inode to open.
 + * @cred: The task's credentials used when opening this file.
 + *
 + * Context: Process context.
 + * Return: A pointer to a struct file or an IS_ERR pointer.  Cannot return NULL.
 + */
 +struct file *path_open(const struct path *path, int flags, struct inode *inode,
 +		       const struct cred *cred, bool account)
 +{
 +	struct file *file;
 +	int error;
 +
 +	file = __get_empty_filp(account);
 +	if (IS_ERR(file))
 +		return file;
  
 +	file->f_flags = flags;
  	file->f_path = *path;
 -	return do_dentry_open(file, d_backing_inode(dentry), NULL, cred);
 +	error = do_dentry_open(file, inode, NULL, cred);
 +	if (error) {
- 		put_filp(file);
++		if (file->f_mode & FMODE_OPENED)
++			fput(file);
++		else
++			put_filp(file);
 +		return ERR_PTR(error);
 +	}
 +
- 	error = open_check_o_direct(file);
- 	if (error) {
- 		fput(file);
- 		file = ERR_PTR(error);
- 	}
- 
 +	return file;
  }
 +EXPORT_SYMBOL(path_open);
  
  struct file *dentry_open(const struct path *path, int flags,
  			 const struct cred *cred)

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 79+ messages in thread

end of thread, other threads:[~2018-07-18 23:17 UTC | newest]

Thread overview: 79+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-07-10  0:17 linux-next: manual merge of the vfs tree with the overlayfs tree Stephen Rothwell
2018-07-10 15:04 ` Al Viro
2018-07-11  2:11   ` Al Viro
2018-07-11  2:21     ` [RFC][PATCH 01/42] drm_mode_create_lease_ioctl(): fix open-coded filp_clone_open() Al Viro
2018-07-11  2:21       ` [RFC][PATCH 02/42] cxl_getfile(): fix double-iput() on alloc_file() failures Al Viro
2018-07-11  2:21       ` [RFC][PATCH 03/42] ocxlflash_getfile(): " Al Viro
2018-07-11  2:21       ` [RFC][PATCH 04/42] make get_empty_filp() to call file_free_rcu() directly Al Viro
2018-07-11  2:35         ` Linus Torvalds
2018-07-11  2:43           ` Al Viro
2018-07-11  2:21       ` [RFC][PATCH 05/42] fold security_file_free() into file_free() Al Viro
2018-07-11  2:21       ` [RFC][PATCH 06/42] turn filp_clone_open() into inline wrapper for dentry_open() Al Viro
2018-07-11  2:21       ` [RFC][PATCH 07/42] create_pipe_files(): use fput() if allocation of the second file fails Al Viro
2018-07-11  2:21       ` [RFC][PATCH 08/42] make sure do_dentry_open() won't return positive as an error Al Viro
2018-07-11  2:39         ` Linus Torvalds
2018-07-11  2:41           ` Al Viro
2018-07-11  2:21       ` [RFC][PATCH 09/42] pass creds to get_empty_filp(), make sure dentry_open() passes the right creds Al Viro
2018-07-11  2:21       ` [RFC][PATCH 10/42] get rid of cred argument of vfs_open() and do_dentry_open() Al Viro
2018-07-11  2:21       ` [RFC][PATCH 11/42] security_file_open(): lose cred argument Al Viro
2018-07-11  2:21       ` [RFC][PATCH 12/42] ->file_open(): " Al Viro
2018-07-11  2:21       ` [RFC][PATCH 13/42] introduce FMODE_OPENED Al Viro
2018-07-11  2:21       ` [RFC][PATCH 14/42] fold put_filp() into fput() Al Viro
2018-07-11  2:21       ` [RFC][PATCH 15/42] lift fput() on late failures into path_openat() Al Viro
2018-07-11  5:43         ` Amir Goldstein
2018-07-11  2:21       ` [RFC][PATCH 16/42] now we can fold open_check_o_direct() into do_dentry_open() Al Viro
2018-07-11  2:44         ` Linus Torvalds
2018-07-11  2:59           ` Al Viro
2018-07-11  3:13             ` Linus Torvalds
2018-07-11  2:21       ` [RFC][PATCH 17/42] switch all remaining checks for FILE_OPENED to FMODE_OPENED Al Viro
2018-07-11  2:21       ` [RFC][PATCH 18/42] introduce FMODE_CREATED and switch to it Al Viro
2018-07-11  2:21       ` [RFC][PATCH 19/42] IMA: don't propagate opened through the entire thing Al Viro
2018-07-11  2:21       ` [RFC][PATCH 20/42] getting rid of 'opened' argument of ->atomic_open() - step 1 Al Viro
2018-07-11  2:21       ` [RFC][PATCH 21/42] getting rid of 'opened' argument of ->atomic_open() - part 2 Al Viro
2018-07-11  2:21       ` [RFC][PATCH 22/42] get rid of 'opened' argument of ->atomic_open() - part 3 Al Viro
2018-07-11  2:21       ` [RFC][PATCH 23/42] get rid of 'opened' in path_openat() and the helpers downstream Al Viro
2018-07-11  2:21       ` [RFC][PATCH 24/42] ->atomic_open(): return 0 in all success cases Al Viro
2018-07-11  2:21       ` [RFC][PATCH 25/42] document ->atomic_open() changes Al Viro
2018-07-11  2:21       ` [RFC][PATCH 26/42] switch atomic_open() and lookup_open() to returning 0 in all success cases Al Viro
2018-07-11  2:21       ` [RFC][PATCH 27/42] kill FILE_{CREATED,OPENED} Al Viro
2018-07-11  2:21       ` [RFC][PATCH 28/42] new wrapper: alloc_file_pseudo() Al Viro
2018-07-11  2:21       ` [RFC][PATCH 29/42] __shmem_file_setup(): reorder allocations Al Viro
2018-07-11  2:21       ` [RFC][PATCH 30/42] ... and switch shmem_file_setup() to alloc_file_pseudo() Al Viro
2018-07-11  2:21       ` [RFC][PATCH 31/42] cxl_getfile(): switch " Al Viro
2018-07-11  2:21       ` [RFC][PATCH 32/42] ocxlflash_getfile(): " Al Viro
2018-07-11  2:21       ` [RFC][PATCH 33/42] hugetlb_file_setup(): " Al Viro
2018-07-11  2:21       ` [RFC][PATCH 34/42] anon_inode_getfile(): " Al Viro
2018-07-11  2:21       ` [RFC][PATCH 35/42] create_pipe_files(): switch the first allocation " Al Viro
2018-07-11  2:22       ` [RFC][PATCH 36/42] new helper: alloc_file_clone() Al Viro
2018-07-11  2:22       ` [RFC][PATCH 37/42] do_shmat(): grab shp->shm_file earlier, switch to alloc_file_clone() Al Viro
2018-07-11  2:22       ` [RFC][PATCH 38/42] make alloc_file() static Al Viro
2018-07-11  2:22       ` [RFC][PATCH 39/42] document alloc_file() changes Al Viro
2018-07-11  2:22       ` [RFC][PATCH 40/42] make path_init() unconditionally paired with terminate_walk() Al Viro
2018-07-11  2:22       ` [RFC][PATCH 41/42] allow link_path_walk() to take ERR_PTR() Al Viro
2018-07-11  2:22       ` [RFC][PATCH 42/42] few more cleanups of link_path_walk() callers Al Viro
2018-07-11  2:56       ` [RFC][PATCH 01/42] drm_mode_create_lease_ioctl(): fix open-coded filp_clone_open() Linus Torvalds
2018-07-11 15:25         ` Al Viro
2018-07-11 16:15           ` Al Viro
2018-07-12 12:43             ` Al Viro
2018-07-12 15:05               ` Linus Torvalds
2018-07-12 15:53                 ` vfs / overlayfs conflict resolution for linux-next Al Viro
2018-07-18  2:56                   ` Al Viro
2018-07-18  3:29                     ` Stephen Rothwell
2018-07-18  7:25                       ` Miklos Szeredi
2018-07-18 12:10                         ` Miklos Szeredi
2018-07-18 12:43                           ` Al Viro
2018-07-18 13:46                             ` Al Viro
2018-07-18 15:46                             ` Miklos Szeredi
2018-07-18 18:12                               ` [RFC] call_with_creds() Al Viro
2018-07-18 18:19                                 ` Linus Torvalds
2018-07-18 19:46                                   ` Al Viro
2018-07-18 19:53                                     ` Linus Torvalds
2018-07-18 20:04                                       ` Al Viro
2018-07-18 20:15                                         ` Al Viro
2018-07-18 20:43                                         ` Linus Torvalds
2018-07-18 21:22                                           ` Al Viro
2018-07-18 23:06                                             ` Linus Torvalds
2018-07-18 21:27                                         ` David Howells
2018-07-18 23:16                                           ` Linus Torvalds
2018-07-18 21:28                                 ` David Howells
2018-07-18 23:13                                   ` Linus Torvalds

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).