From: Jeff Layton <jlayton@poochiereds.net>
To: Stephen Rothwell <sfr@canb.auug.org.au>
Cc: Al Viro <viro@ZenIV.linux.org.uk>,
Steve French <smfrench@gmail.com>, <linux-cifs@vger.kernel.org>,
linux-next@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: linux-next: manual merge of the vfs tree with the cifs tree
Date: Tue, 13 May 2014 06:49:37 -0400 [thread overview]
Message-ID: <20140513064937.641b45ed@tlielax.poochiereds.net> (raw)
In-Reply-To: <20140513131616.59f41b7a@canb.auug.org.au>
[-- Attachment #1: Type: text/plain, Size: 2594 bytes --]
On Tue, 13 May 2014 13:16:16 +1000
Stephen Rothwell <sfr@canb.auug.org.au> wrote:
> Hi Al,
>
> Today's linux-next merge of the vfs tree got a conflict in
> fs/cifs/cifsfs.c between commit 485c4e72d0f1 ("cifs: revalidate mapping
> prior to satisfying aio_read request") from the cifs tree and commits
> aad4f8bb42af ("switch simple generic_file_aio_read() users to
> ->read_iter()") and 3dae8750c368 ("cifs: switch to ->write_iter()")
> from the vfs tree.
>
> I fixed it up (I dropped the cifs commit, so this will need a better
> fix ...) and can carry the fix as necessary.
>
Thanks Stephen,
Steve, what we probably need to do is replace 485c4e72d0f1 with this
patch. Only tested for compilation so far, but it should do the right
thing. I'll resend to the list once I've had a chance to test it.
--------------------------[snip]-------------------------
[PATCH] cifs: revalidate mapping prior to satisfying read_iter request
Before satisfying a read with cache=loose, we should always check
that the pagecache is valid.
Reported-by: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
Signed-off-by: Jeff Layton <jlayton@poochiereds.net>
---
fs/cifs/cifsfs.c | 17 +++++++++++++++--
1 file changed, 15 insertions(+), 2 deletions(-)
diff --git a/fs/cifs/cifsfs.c b/fs/cifs/cifsfs.c
index 078c171c4f1b..149b09ce148d 100644
--- a/fs/cifs/cifsfs.c
+++ b/fs/cifs/cifsfs.c
@@ -729,6 +729,19 @@ out_nls:
goto out;
}
+static ssize_t
+cifs_loose_read_iter(struct kiocb *iocb, struct iov_iter *to)
+{
+ ssize_t rc;
+ struct inode *inode = file_inode(iocb->ki_filp);
+
+ rc = cifs_revalidate_mapping(inode);
+ if (rc)
+ return rc;
+
+ return generic_file_read_iter(iocb, to);
+}
+
static ssize_t cifs_file_write_iter(struct kiocb *iocb, struct iov_iter *from)
{
struct inode *inode = file_inode(iocb->ki_filp);
@@ -885,7 +898,7 @@ const struct inode_operations cifs_symlink_inode_ops = {
const struct file_operations cifs_file_ops = {
.read = new_sync_read,
.write = new_sync_write,
- .read_iter = generic_file_read_iter,
+ .read_iter = cifs_loose_read_iter,
.write_iter = cifs_file_write_iter,
.open = cifs_open,
.release = cifs_close,
@@ -943,7 +956,7 @@ const struct file_operations cifs_file_direct_ops = {
const struct file_operations cifs_file_nobrl_ops = {
.read = new_sync_read,
.write = new_sync_write,
- .read_iter = generic_file_read_iter,
+ .read_iter = cifs_loose_read_iter,
.write_iter = cifs_file_write_iter,
.open = cifs_open,
.release = cifs_close,
--
1.9.0
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
next prev parent reply other threads:[~2014-05-13 10:49 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-05-13 3:16 linux-next: manual merge of the vfs tree with the cifs tree Stephen Rothwell
2014-05-13 10:49 ` Jeff Layton [this message]
[not found] ` <20140513131616.59f41b7a-3FnU+UHB4dNDw9hX6IcOSA@public.gmane.org>
2014-05-23 10:50 ` [PATCH] cifs: revalidate mapping prior to satisfying read_iter request with cache=loose Jeff Layton
[not found] ` <1400842221-12168-1-git-send-email-jlayton-vpEMnDpepFuMZCB2o+C8xQ@public.gmane.org>
2014-05-23 14:44 ` Jeff Layton
[not found] ` <20140523104424.26c0bad0-9yPaYZwiELC+kQycOl6kW4xkIHaj4LzF@public.gmane.org>
2014-05-23 14:52 ` Steve French
[not found] ` <CAH2r5mvsv=vzhc=p-nxbv6XRVfaUS==A2ktb+ScGsFKaycMVxw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-05-23 15:33 ` Steve French
[not found] ` <CAH2r5msbPWwHZVZ=ZDbnHatt8QT2Q00ZnBgKw-yXLvEM8Ui3Jw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-05-23 15:35 ` Jeff Layton
-- strict thread matches above, loose matches on Subject: below --
2021-03-26 0:09 linux-next: manual merge of the vfs tree with the cifs tree Stephen Rothwell
2016-05-19 23:41 Stephen Rothwell
2012-06-25 2:11 Stephen Rothwell
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=20140513064937.641b45ed@tlielax.poochiereds.net \
--to=jlayton@poochiereds.net \
--cc=linux-cifs@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-next@vger.kernel.org \
--cc=sfr@canb.auug.org.au \
--cc=smfrench@gmail.com \
--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