Re: Concurrent logins to different interfaces of same iscsi target and login timeout

2020-08-18 Thread Amit Bawer
Hi Lee, Thanks for adding the async login support to upstream. I've ran some tests using the iscsiadm built from there and would like to ask: 1. How is it possible to gather the async logins return status? if understood correctly, the proposed way is to lookup for the connections in the output

Re: [PATCH v7 1/6] net: introduce helper sendpage_ok() in include/linux/net.h

2020-08-18 Thread Christoph Hellwig
I think we should go for something simple like this instead: --- >From 4867e158ee86ebd801b4c267e8f8a4a762a71343 Mon Sep 17 00:00:00 2001 From: Christoph Hellwig Date: Tue, 18 Aug 2020 18:19:23 +0200 Subject: net: bypass ->sendpage for slab pages Sending Slab or tail pages into ->sendpage will ca

Re: [PATCH v7 1/6] net: introduce helper sendpage_ok() in include/linux/net.h

2020-08-18 Thread Christoph Hellwig
On Wed, Aug 19, 2020 at 12:33:37AM +0800, Coly Li wrote: > On 2020/8/19 00:24, Christoph Hellwig wrote: > > I think we should go for something simple like this instead: > > This idea is fine to me. Should a warning message be through here? IMHO > the driver still sends an improper page in, fix it

[PATCH v6 1/6] net: introduce helper sendpage_ok() in include/linux/net.h

2020-08-18 Thread Coly Li
The original problem was from nvme-over-tcp code, who mistakenly uses kernel_sendpage() to send pages allocated by __get_free_pages() without __GFP_COMP flag. Such pages don't have refcount (page_count is 0) on tail pages, sending them by kernel_sendpage() may trigger a kernel panic from a corrupte

[PATCH v7 6/6] libceph: use sendpage_ok() in ceph_tcp_sendpage()

2020-08-18 Thread Coly Li
In libceph, ceph_tcp_sendpage() does the following checks before handle the page by network layer's zero copy sendpage method, if (page_count(page) >= 1 && !PageSlab(page)) This check is exactly what sendpage_ok() does. This patch replace the open coded checks by sendpage_ok() as a code cl

[PATCH v7 2/6] nvme-tcp: check page by sendpage_ok() before calling kernel_sendpage()

2020-08-18 Thread Coly Li
Currently nvme_tcp_try_send_data() doesn't use kernel_sendpage() to send slab pages. But for pages allocated by __get_free_pages() without __GFP_COMP, which also have refcount as 0, they are still sent by kernel_sendpage() to remote end, this is problematic. The new introduced helper sendpage_ok()

[PATCH v6 0/6] Introduce sendpage_ok() to detect misused sendpage in network related drivers

2020-08-18 Thread Coly Li
This series was original by a bug fix in nvme-over-tcp driver which only checked whether a page was allocated from slab allcoator, but forgot to check its page_count: The page handled by sendpage should be neither a Slab page nor 0 page_count page. As Sagi Grimberg suggested, the original fix is r

[PATCH v6 5/6] scsi: libiscsi: use sendpage_ok() in iscsi_tcp_segment_map()

2020-08-18 Thread Coly Li
In iscsci driver, iscsi_tcp_segment_map() uses the following code to check whether the page should or not be handled by sendpage: if (!recv && page_count(sg_page(sg)) >= 1 && !PageSlab(sg_page(sg))) The "page_count(sg_page(sg)) >= 1 && !PageSlab(sg_page(sg)" part is to make sure the page can b

Re: [PATCH v7 1/6] net: introduce helper sendpage_ok() in include/linux/net.h

2020-08-18 Thread Coly Li
On 2020/8/19 00:24, Christoph Hellwig wrote: > I think we should go for something simple like this instead: This idea is fine to me. Should a warning message be through here? IMHO the driver still sends an improper page in, fix it in silence is too kind or over nice to the buggy driver(s). And ma

[PATCH v7 1/6] net: introduce helper sendpage_ok() in include/linux/net.h

2020-08-18 Thread Coly Li
The original problem was from nvme-over-tcp code, who mistakenly uses kernel_sendpage() to send pages allocated by __get_free_pages() without __GFP_COMP flag. Such pages don't have refcount (page_count is 0) on tail pages, sending them by kernel_sendpage() may trigger a kernel panic from a corrupte

[PATCH v6 4/6] drbd: code cleanup by using sendpage_ok() to check page for kernel_sendpage()

2020-08-18 Thread Coly Li
In _drbd_send_page() a page is checked by following code before sending it by kernel_sendpage(), (page_count(page) < 1) || PageSlab(page) If the check is true, this page won't be send by kernel_sendpage() and handled by sock_no_sendpage(). This kind of check is exactly what macro sendpage_

[PATCH v6 2/6] nvme-tcp: check page by sendpage_ok() before calling kernel_sendpage()

2020-08-18 Thread Coly Li
Currently nvme_tcp_try_send_data() doesn't use kernel_sendpage() to send slab pages. But for pages allocated by __get_free_pages() without __GFP_COMP, which also have refcount as 0, they are still sent by kernel_sendpage() to remote end, this is problematic. The new introduced helper sendpage_ok()

[PATCH v7 4/6] drbd: code cleanup by using sendpage_ok() to check page for kernel_sendpage()

2020-08-18 Thread Coly Li
In _drbd_send_page() a page is checked by following code before sending it by kernel_sendpage(), (page_count(page) < 1) || PageSlab(page) If the check is true, this page won't be send by kernel_sendpage() and handled by sock_no_sendpage(). This kind of check is exactly what macro sendpage_

[PATCH v7 3/6] tcp: use sendpage_ok() to detect misused .sendpage

2020-08-18 Thread Coly Li
commit a10674bf2406 ("tcp: detecting the misuse of .sendpage for Slab objects") adds the checks for Slab pages, but the pages don't have page_count are still missing from the check. Network layer's sendpage method is not designed to send page_count 0 pages neither, therefore both PageSlab() and pa

[PATCH v6 3/6] tcp: use sendpage_ok() to detect misused .sendpage

2020-08-18 Thread Coly Li
commit a10674bf2406 ("tcp: detecting the misuse of .sendpage for Slab objects") adds the checks for Slab pages, but the pages don't have page_count are still missing from the check. Network layer's sendpage method is not designed to send page_count 0 pages neither, therefore both PageSlab() and pa

[PATCH v6 6/6] libceph: use sendpage_ok() in ceph_tcp_sendpage()

2020-08-18 Thread Coly Li
In libceph, ceph_tcp_sendpage() does the following checks before handle the page by network layer's zero copy sendpage method, if (page_count(page) >= 1 && !PageSlab(page)) This check is exactly what sendpage_ok() does. This patch replace the open coded checks by sendpage_ok() as a code cl

[PATCH v7 0/6] Introduce sendpage_ok() to detect misused sendpage in network related drivers

2020-08-18 Thread Coly Li
This series was original by a bug fix in nvme-over-tcp driver which only checked whether a page was allocated from slab allcoator, but forgot to check its page_count: The page handled by sendpage should be neither a Slab page nor 0 page_count page. As Sagi Grimberg suggested, the original fix is r

[PATCH v7 5/6] scsi: libiscsi: use sendpage_ok() in iscsi_tcp_segment_map()

2020-08-18 Thread Coly Li
In iscsci driver, iscsi_tcp_segment_map() uses the following code to check whether the page should or not be handled by sendpage: if (!recv && page_count(sg_page(sg)) >= 1 && !PageSlab(sg_page(sg))) The "page_count(sg_page(sg)) >= 1 && !PageSlab(sg_page(sg)" part is to make sure the page can b

Re: [PATCH v7 1/6] net: introduce helper sendpage_ok() in include/linux/net.h

2020-08-18 Thread Coly Li
On 2020/8/19 03:49, Christoph Hellwig wrote: > On Wed, Aug 19, 2020 at 12:33:37AM +0800, Coly Li wrote: >> On 2020/8/19 00:24, Christoph Hellwig wrote: >>> I think we should go for something simple like this instead: >> >> This idea is fine to me. Should a warning message be through here? IMHO >> t

Antw: [EXT] [PATCH v6 1/6] net: introduce helper sendpage_ok() in include/linux/net.h

2020-08-18 Thread Ulrich Windl
>>> Coly Li schrieb am 18.08.2020 um 14:47 in Nachricht <20200818124736.5790-2-col...@suse.de>: > The original problem was from nvme-over-tcp code, who mistakenly uses > kernel_sendpage() to send pages allocated by __get_free_pages() without > __GFP_COMP flag. Such pages don't have refcount (page_