From: Stephen Rothwell <sfr@canb.auug.org.au>
To: Al Viro <viro@ZenIV.linux.org.uk>, Miklos Szeredi <miklos@szeredi.hu>
Cc: Linux-Next Mailing List <linux-next@vger.kernel.org>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: linux-next: manual merge of the vfs tree with the overlayfs tree
Date: Tue, 10 Jul 2018 10:17:36 +1000 [thread overview]
Message-ID: <20180710101736.32d6cc6c@canb.auug.org.au> (raw)
[-- 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 --]
next reply other threads:[~2018-07-10 0:17 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-07-10 0:17 Stephen Rothwell [this message]
2018-07-10 15:04 ` linux-next: manual merge of the vfs tree with the overlayfs tree Al Viro
2018-07-11 2:11 ` Al Viro
-- strict thread matches above, loose matches on Subject: below --
2021-04-12 2:03 Stephen Rothwell
2018-07-10 0:22 Stephen Rothwell
2018-06-19 1:21 Stephen Rothwell
2018-06-19 8:40 ` David Howells
2018-06-19 13:38 ` Miklos Szeredi
2018-06-19 1:10 Stephen Rothwell
2018-05-29 1:30 Stephen Rothwell
2018-06-05 0:19 ` Stephen Rothwell
2018-06-18 3:43 ` Stephen Rothwell
2018-01-25 3:31 Stephen Rothwell
2018-01-25 3:39 ` Stephen Rothwell
2018-01-31 23:25 ` Stephen Rothwell
2017-11-08 23:18 Stephen Rothwell
2016-12-11 23:13 Stephen Rothwell
2016-12-11 23:08 Stephen Rothwell
2016-10-10 0:20 Stephen Rothwell
2016-07-25 0:24 Stephen Rothwell
2016-07-25 0:30 ` Al Viro
2016-07-25 8:09 ` Miklos Szeredi
2016-05-10 23:20 Stephen Rothwell
2016-05-02 0:59 Stephen Rothwell
2016-05-02 1:08 ` Al Viro
2016-05-02 1:23 ` Al Viro
2016-05-02 8:30 ` Miklos Szeredi
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180710101736.32d6cc6c@canb.auug.org.au \
--to=sfr@canb.auug.org.au \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-next@vger.kernel.org \
--cc=miklos@szeredi.hu \
--cc=viro@ZenIV.linux.org.uk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).