Linux-NFS Archive on lore.kernel.org
 help / Atom feed
* [PATCH] SUNRPC: Fix TCP receive code on archs with flush_dcache_page()
@ 2019-01-03  0:42 Trond Myklebust
  2019-01-03  5:29 ` kbuild test robot
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Trond Myklebust @ 2019-01-03  0:42 UTC (permalink / raw)
  To: Geert Uytterhoeven; +Cc: linux-nfs

After receiving data into the page cache, we need to call flush_dcache_page()
for the architectures that define it.

Fixes: 277e4ab7d530b ("SUNRPC: Simplify TCP receive code by switching...")
Reported-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
Cc: stable@vger.kernel.org # v4.20
---
 net/sunrpc/xprtsock.c | 23 +++++++++++++++++++++++
 1 file changed, 23 insertions(+)

diff --git a/net/sunrpc/xprtsock.c b/net/sunrpc/xprtsock.c
index f0b3700cec95..ec239b02b86e 100644
--- a/net/sunrpc/xprtsock.c
+++ b/net/sunrpc/xprtsock.c
@@ -48,6 +48,7 @@
 #include <net/udp.h>
 #include <net/tcp.h>
 #include <linux/bvec.h>
+#include <linux/highmem.h>
 #include <linux/uio.h>
 
 #include <trace/events/sunrpc.h>
@@ -380,6 +381,27 @@ xs_read_discard(struct socket *sock, struct msghdr *msg, int flags,
 	return sock_recvmsg(sock, msg, flags);
 }
 
+#if ARCH_IMPLEMENTS_FLUSH_DCACHE_PAGE
+static void
+xs_flush_bvec(const struct bio_vec *bvec, size_t count, size_t seek)
+{
+	struct bvec_iter bi, __start = {
+		.bi_size = count,
+	};
+	struct bio_vec bv;
+
+	bvec_iter_advance(bvec, &__start, seek & PAGE_MASK);
+
+	for_each_bvec(bv, bvec, bi, __start)
+		flush_dcache_page(bv.page);
+}
+#else
+static inline void
+xs_flush_bvec(const struct bio_vec *bvec, size_t count, size_t seek)
+{
+}
+#endif
+
 static ssize_t
 xs_read_xdr_buf(struct socket *sock, struct msghdr *msg, int flags,
 		struct xdr_buf *buf, size_t count, size_t seek, size_t *read)
@@ -413,6 +435,7 @@ xs_read_xdr_buf(struct socket *sock, struct msghdr *msg, int flags,
 				seek + buf->page_base);
 		if (ret <= 0)
 			goto sock_err;
+		xs_flush_bvec(buf->bvec, ret, seek + buf->page_base);
 		offset += ret - buf->page_base;
 		if (offset == count || msg->msg_flags & (MSG_EOR|MSG_TRUNC))
 			goto out;
-- 
2.20.1


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

* Re: [PATCH] SUNRPC: Fix TCP receive code on archs with flush_dcache_page()
  2019-01-03  0:42 [PATCH] SUNRPC: Fix TCP receive code on archs with flush_dcache_page() Trond Myklebust
@ 2019-01-03  5:29 ` kbuild test robot
  2019-01-03  6:45 ` kbuild test robot
  2019-01-03 13:52 ` Sasha Levin
  2 siblings, 0 replies; 6+ messages in thread
From: kbuild test robot @ 2019-01-03  5:29 UTC (permalink / raw)
  To: Trond Myklebust; +Cc: kbuild-all, Geert Uytterhoeven, linux-nfs

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

Hi Trond,

I love your patch! Yet something to improve:

[auto build test ERROR on nfs/linux-next]
[also build test ERROR on v4.20 next-20190102]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url:    https://github.com/0day-ci/linux/commits/Trond-Myklebust/SUNRPC-Fix-TCP-receive-code-on-archs-with-flush_dcache_page/20190103-113507
base:   git://git.linux-nfs.org/projects/trondmy/linux-nfs.git linux-next
config: sh-allmodconfig (attached as .config)
compiler: sh4-linux-gnu-gcc (Debian 7.2.0-11) 7.2.0
reproduce:
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # save the attached .config to linux build tree
        GCC_VERSION=7.2.0 make.cross ARCH=sh 

All errors (new ones prefixed by >>):

   net//sunrpc/xprtsock.c: In function 'xs_flush_bvec':
>> net//sunrpc/xprtsock.c:396:24: error: 'struct bio_vec' has no member named 'page'; did you mean 'bv_page'?
      flush_dcache_page(bv.page);
                           ^~~~
                           bv_page

vim +396 net//sunrpc/xprtsock.c

   383	
   384	#if ARCH_IMPLEMENTS_FLUSH_DCACHE_PAGE
   385	static void
   386	xs_flush_bvec(const struct bio_vec *bvec, size_t count, size_t seek)
   387	{
   388		struct bvec_iter bi, __start = {
   389			.bi_size = count,
   390		};
   391		struct bio_vec bv;
   392	
   393		bvec_iter_advance(bvec, &__start, seek & PAGE_MASK);
   394	
   395		for_each_bvec(bv, bvec, bi, __start)
 > 396			flush_dcache_page(bv.page);
   397	}
   398	#else
   399	static inline void
   400	xs_flush_bvec(const struct bio_vec *bvec, size_t count, size_t seek)
   401	{
   402	}
   403	#endif
   404	

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 50781 bytes --]

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

* Re: [PATCH] SUNRPC: Fix TCP receive code on archs with flush_dcache_page()
  2019-01-03  0:42 [PATCH] SUNRPC: Fix TCP receive code on archs with flush_dcache_page() Trond Myklebust
  2019-01-03  5:29 ` kbuild test robot
@ 2019-01-03  6:45 ` kbuild test robot
  2019-01-03 13:52 ` Sasha Levin
  2 siblings, 0 replies; 6+ messages in thread
From: kbuild test robot @ 2019-01-03  6:45 UTC (permalink / raw)
  To: Trond Myklebust; +Cc: kbuild-all, Geert Uytterhoeven, linux-nfs

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

Hi Trond,

I love your patch! Perhaps something to improve:

[auto build test WARNING on nfs/linux-next]
[also build test WARNING on v4.20 next-20190102]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url:    https://github.com/0day-ci/linux/commits/Trond-Myklebust/SUNRPC-Fix-TCP-receive-code-on-archs-with-flush_dcache_page/20190103-113507
base:   git://git.linux-nfs.org/projects/trondmy/linux-nfs.git linux-next
config: m68k-sun3_defconfig (attached as .config)
compiler: m68k-linux-gnu-gcc (Debian 7.2.0-11) 7.2.0
reproduce:
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # save the attached .config to linux build tree
        GCC_VERSION=7.2.0 make.cross ARCH=m68k 

All warnings (new ones prefixed by >>):

   In file included from include/linux/pagemap.h:8:0,
                    from net/sunrpc/xprtsock.c:27:
   net/sunrpc/xprtsock.c: In function 'xs_flush_bvec':
   net/sunrpc/xprtsock.c:396:24: error: 'struct bio_vec' has no member named 'page'; did you mean 'bv_page'?
      flush_dcache_page(bv.page);
                           ^
   include/linux/mm.h:1258:48: note: in definition of macro 'page_address'
    #define page_address(page) lowmem_page_address(page)
                                                   ^~~~
>> net/sunrpc/xprtsock.c:396:3: note: in expansion of macro 'flush_dcache_page'
      flush_dcache_page(bv.page);
      ^~~~~~~~~~~~~~~~~

vim +/flush_dcache_page +396 net/sunrpc/xprtsock.c

   383	
   384	#if ARCH_IMPLEMENTS_FLUSH_DCACHE_PAGE
   385	static void
   386	xs_flush_bvec(const struct bio_vec *bvec, size_t count, size_t seek)
   387	{
   388		struct bvec_iter bi, __start = {
   389			.bi_size = count,
   390		};
   391		struct bio_vec bv;
   392	
   393		bvec_iter_advance(bvec, &__start, seek & PAGE_MASK);
   394	
   395		for_each_bvec(bv, bvec, bi, __start)
 > 396			flush_dcache_page(bv.page);
   397	}
   398	#else
   399	static inline void
   400	xs_flush_bvec(const struct bio_vec *bvec, size_t count, size_t seek)
   401	{
   402	}
   403	#endif
   404	

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 12123 bytes --]

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

* Re: [PATCH] SUNRPC: Fix TCP receive code on archs with flush_dcache_page()
  2019-01-03  0:42 [PATCH] SUNRPC: Fix TCP receive code on archs with flush_dcache_page() Trond Myklebust
  2019-01-03  5:29 ` kbuild test robot
  2019-01-03  6:45 ` kbuild test robot
@ 2019-01-03 13:52 ` Sasha Levin
  2019-01-03 14:00   ` Geert Uytterhoeven
  2 siblings, 1 reply; 6+ messages in thread
From: Sasha Levin @ 2019-01-03 13:52 UTC (permalink / raw)
  To: Sasha Levin; +Cc: linux-nfs

[-- Warning: decoded text below may be mangled --]
[-- Attachment #0: Type: text/plain, Size: 461 bytes --]

Hi,

[This is an automated email]

This commit has been processed because it contains a "Fixes:" tag,
fixing commit: 277e4ab7d530 SUNRPC: Simplify TCP receive code by switching to using iterators.

The bot has tested the following trees: v4.20.0, 

v4.20.0: Build failed! Errors:
    net/sunrpc/xprtsock.c:396:24: error: ‘struct bio_vec’ has no member named ‘page’; did you mean ‘bv_page’?


How should we proceed with this patch?

--
Thanks,
Sasha

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

* Re: [PATCH] SUNRPC: Fix TCP receive code on archs with flush_dcache_page()
  2019-01-03 13:52 ` Sasha Levin
@ 2019-01-03 14:00   ` Geert Uytterhoeven
  2019-01-05 20:53     ` Sasha Levin
  0 siblings, 1 reply; 6+ messages in thread
From: Geert Uytterhoeven @ 2019-01-03 14:00 UTC (permalink / raw)
  To: Sasha Levin; +Cc: Trond Myklebust, open list:NFS, SUNRPC, AND..., stable

Hi Sasha,

On Thu, Jan 3, 2019 at 2:52 PM Sasha Levin <sashal@kernel.org> wrote:
> [This is an automated email]
>
> This commit has been processed because it contains a "Fixes:" tag,
> fixing commit: 277e4ab7d530 SUNRPC: Simplify TCP receive code by switching to using iterators.
>
> The bot has tested the following trees: v4.20.0,
>
> v4.20.0: Build failed! Errors:
>     net/sunrpc/xprtsock.c:396:24: error: ‘struct bio_vec’ has no member named ‘page’; did you mean ‘bv_page’?
>
>
> How should we proceed with this patch?

Please drop it, as it was superseded by v2.

Gr{oetje,eeting}s,

                        Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

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

* Re: [PATCH] SUNRPC: Fix TCP receive code on archs with flush_dcache_page()
  2019-01-03 14:00   ` Geert Uytterhoeven
@ 2019-01-05 20:53     ` Sasha Levin
  0 siblings, 0 replies; 6+ messages in thread
From: Sasha Levin @ 2019-01-05 20:53 UTC (permalink / raw)
  To: Geert Uytterhoeven; +Cc: Trond Myklebust, open list:NFS, SUNRPC, AND..., stable

On Thu, Jan 03, 2019 at 03:00:10PM +0100, Geert Uytterhoeven wrote:
>Hi Sasha,
>
>On Thu, Jan 3, 2019 at 2:52 PM Sasha Levin <sashal@kernel.org> wrote:
>> [This is an automated email]
>>
>> This commit has been processed because it contains a "Fixes:" tag,
>> fixing commit: 277e4ab7d530 SUNRPC: Simplify TCP receive code by switching to using iterators.
>>
>> The bot has tested the following trees: v4.20.0,
>>
>> v4.20.0: Build failed! Errors:
>>     net/sunrpc/xprtsock.c:396:24: error: ‘struct bio_vec’ has no member named ‘page’; did you mean ‘bv_page’?
>>
>>
>> How should we proceed with this patch?
>
>Please drop it, as it was superseded by v2.

Hi Geert,

These mails don't really mean that the patch got queued anywhere (as
it's obviously not upstream yet). It's more of a heads-up about how this
patch (won't) be backported to various -stable branches.

It's usually easier to get response from people while the patch is still
fresh in their heads rather than a few weeks later :)

--
Thanks,
Sasha

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

end of thread, back to index

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-01-03  0:42 [PATCH] SUNRPC: Fix TCP receive code on archs with flush_dcache_page() Trond Myklebust
2019-01-03  5:29 ` kbuild test robot
2019-01-03  6:45 ` kbuild test robot
2019-01-03 13:52 ` Sasha Levin
2019-01-03 14:00   ` Geert Uytterhoeven
2019-01-05 20:53     ` Sasha Levin

Linux-NFS Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-nfs/0 linux-nfs/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-nfs linux-nfs/ https://lore.kernel.org/linux-nfs \
		linux-nfs@vger.kernel.org linux-nfs@archiver.kernel.org
	public-inbox-index linux-nfs


Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-nfs


AGPL code for this site: git clone https://public-inbox.org/ public-inbox