Re: [PATCH] scsi: iscsi_tcp: set BDI_CAP_STABLE_WRITES when data digest enabled

2018-03-19 Thread Martin K. Petersen

Jianchao,

> iscsi tcp will first send out data, then calculate and send data
> digest. If we don't have BDI_CAP_STABLE_WRITES, the page cache will
> be written in spite of the on going writeback. Consequently, wrong
> digest will be got and sent to target.
>
> To fix this, set BDI_CAP_STABLE_WRITES when data digest is enabled
> in iscsi_tcp .slave_configure callback.

Applied to 4.16/scsi-fixes. Thanks!

-- 
Martin K. Petersen  Oracle Linux Engineering

-- 
You received this message because you are subscribed to the Google Groups 
"open-iscsi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to open-iscsi+unsubscr...@googlegroups.com.
To post to this group, send email to open-iscsi@googlegroups.com.
Visit this group at https://groups.google.com/group/open-iscsi.
For more options, visit https://groups.google.com/d/optout.


Re: [PATCH] scsi: iscsi_tcp: set BDI_CAP_STABLE_WRITES when data digest enabled

2018-03-15 Thread Chris Leech
On Wed, Mar 07, 2018 at 08:29:03PM +0800, Jianchao Wang wrote:
> iscsi tcp will first send out data, then calculate and send data
> digest. If we don't have BDI_CAP_STABLE_WRITES, the page cache will
> be written in spite of the on going writeback. Consequently, wrong
> digest will be got and sent to target.
> 
> To fix this, set BDI_CAP_STABLE_WRITES when data digest is enabled
> in iscsi_tcp .slave_configure callback.
> 
> Signed-off-by: Jianchao Wang 
> ---
>  drivers/scsi/iscsi_tcp.c | 7 +++
>  1 file changed, 7 insertions(+)
> 
> diff --git a/drivers/scsi/iscsi_tcp.c b/drivers/scsi/iscsi_tcp.c
> index 6198559..261c686 100644
> --- a/drivers/scsi/iscsi_tcp.c
> +++ b/drivers/scsi/iscsi_tcp.c
> @@ -37,6 +37,7 @@
>  #include 
>  #include 
>  #include 
> +#include 
>  #include 
>  #include 
>  #include 
> @@ -954,6 +955,12 @@ static int iscsi_sw_tcp_slave_alloc(struct scsi_device 
> *sdev)
>  
>  static int iscsi_sw_tcp_slave_configure(struct scsi_device *sdev)
>  {
> + struct iscsi_sw_tcp_host *tcp_sw_host = iscsi_host_priv(sdev->host);
> + struct iscsi_session *session = tcp_sw_host->session;
> + struct iscsi_conn *conn = session->leadconn;
> +
> + if (conn->datadgst_en)
> + sdev->request_queue->backing_dev_info->capabilities |= 
> BDI_CAP_STABLE_WRITES;
>   blk_queue_bounce_limit(sdev->request_queue, BLK_BOUNCE_ANY);
>   blk_queue_dma_alignment(sdev->request_queue, 0);
>   return 0;
> -- 

Thanks for fixing this issue with data digests!

Signed-off-by: Chris Leech 

-- 
You received this message because you are subscribed to the Google Groups 
"open-iscsi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to open-iscsi+unsubscr...@googlegroups.com.
To post to this group, send email to open-iscsi@googlegroups.com.
Visit this group at https://groups.google.com/group/open-iscsi.
For more options, visit https://groups.google.com/d/optout.


Re: [PATCH] scsi: iscsi_tcp: set BDI_CAP_STABLE_WRITES when data digest enabled

2018-03-15 Thread Lee Duncan
I reviewed this several days before but mistakenly replied only to the 
open-iscsi list. 

Signed-off-by: Lee Duncan 

--
Lee-Man Duncan
Sent from my iPhone, dude


> On Mar 14, 2018, at 10:11 PM, Martin K. Petersen  
> wrote:
> 
> 
>> iscsi tcp will first send out data, then calculate and send data
>> digest. If we don't have BDI_CAP_STABLE_WRITES, the page cache will
>> be written in spite of the on going writeback. Consequently, wrong
>> digest will be got and sent to target.
>> 
>> To fix this, set BDI_CAP_STABLE_WRITES when data digest is enabled
>> in iscsi_tcp .slave_configure callback.
> 
> Lee, Chris: Please review!
> 
> -- 
> Martin K. PetersenOracle Linux Engineering
> 
> -- 
> You received this message because you are subscribed to a topic in the Google 
> Groups "open-iscsi" group.
> To unsubscribe from this topic, visit 
> https://groups.google.com/d/topic/open-iscsi/owLIZAXfgoA/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to 
> open-iscsi+unsubscr...@googlegroups.com.
> To post to this group, send email to open-iscsi@googlegroups.com.
> Visit this group at https://groups.google.com/group/open-iscsi.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"open-iscsi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to open-iscsi+unsubscr...@googlegroups.com.
To post to this group, send email to open-iscsi@googlegroups.com.
Visit this group at https://groups.google.com/group/open-iscsi.
For more options, visit https://groups.google.com/d/optout.


Re: [PATCH] scsi: iscsi_tcp: set BDI_CAP_STABLE_WRITES when data digest enabled

2018-03-14 Thread Martin K. Petersen

> iscsi tcp will first send out data, then calculate and send data
> digest. If we don't have BDI_CAP_STABLE_WRITES, the page cache will
> be written in spite of the on going writeback. Consequently, wrong
> digest will be got and sent to target.
>
> To fix this, set BDI_CAP_STABLE_WRITES when data digest is enabled
> in iscsi_tcp .slave_configure callback.

Lee, Chris: Please review!

-- 
Martin K. Petersen  Oracle Linux Engineering

-- 
You received this message because you are subscribed to the Google Groups 
"open-iscsi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to open-iscsi+unsubscr...@googlegroups.com.
To post to this group, send email to open-iscsi@googlegroups.com.
Visit this group at https://groups.google.com/group/open-iscsi.
For more options, visit https://groups.google.com/d/optout.


Re: [PATCH] scsi: iscsi_tcp: set BDI_CAP_STABLE_WRITES when data digest enabled

2018-03-14 Thread jianchao.wang
Would anyone please take a review at this patch ?

Thanks in advace
Jianchao

On 03/07/2018 08:29 PM, Jianchao Wang wrote:
> iscsi tcp will first send out data, then calculate and send data
> digest. If we don't have BDI_CAP_STABLE_WRITES, the page cache will
> be written in spite of the on going writeback. Consequently, wrong
> digest will be got and sent to target.
> 
> To fix this, set BDI_CAP_STABLE_WRITES when data digest is enabled
> in iscsi_tcp .slave_configure callback.
> 
> Signed-off-by: Jianchao Wang 
> ---
>  drivers/scsi/iscsi_tcp.c | 7 +++
>  1 file changed, 7 insertions(+)
> 
> diff --git a/drivers/scsi/iscsi_tcp.c b/drivers/scsi/iscsi_tcp.c
> index 6198559..261c686 100644
> --- a/drivers/scsi/iscsi_tcp.c
> +++ b/drivers/scsi/iscsi_tcp.c
> @@ -37,6 +37,7 @@
>  #include 
>  #include 
>  #include 
> +#include 
>  #include 
>  #include 
>  #include 
> @@ -954,6 +955,12 @@ static int iscsi_sw_tcp_slave_alloc(struct scsi_device 
> *sdev)
>  
>  static int iscsi_sw_tcp_slave_configure(struct scsi_device *sdev)
>  {
> + struct iscsi_sw_tcp_host *tcp_sw_host = iscsi_host_priv(sdev->host);
> + struct iscsi_session *session = tcp_sw_host->session;
> + struct iscsi_conn *conn = session->leadconn;
> +
> + if (conn->datadgst_en)
> + sdev->request_queue->backing_dev_info->capabilities |= 
> BDI_CAP_STABLE_WRITES;
>   blk_queue_bounce_limit(sdev->request_queue, BLK_BOUNCE_ANY);
>   blk_queue_dma_alignment(sdev->request_queue, 0);
>   return 0;
> 

-- 
You received this message because you are subscribed to the Google Groups 
"open-iscsi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to open-iscsi+unsubscr...@googlegroups.com.
To post to this group, send email to open-iscsi@googlegroups.com.
Visit this group at https://groups.google.com/group/open-iscsi.
For more options, visit https://groups.google.com/d/optout.


Re: [PATCH] scsi: iscsi_tcp: set BDI_CAP_STABLE_WRITES when data digest enabled

2018-03-10 Thread The Lee-Man
On Friday, March 9, 2018 at 11:23:56 AM UTC-8, Jianchao Wang wrote:
>
> iscsi tcp will first send out data, then calculate and send data 
> digest. If we don't have BDI_CAP_STABLE_WRITES, the page cache will 
> be written in spite of the on going writeback. Consequently, wrong 
> digest will be got and sent to target. 
>
> To fix this, set BDI_CAP_STABLE_WRITES when data digest is enabled 
> in iscsi_tcp .slave_configure callback. 
>
> Signed-off-by: Jianchao Wang  
> --- 
>  drivers/scsi/iscsi_tcp.c | 7 +++ 
>  1 file changed, 7 insertions(+) 
>
> diff --git a/drivers/scsi/iscsi_tcp.c b/drivers/scsi/iscsi_tcp.c 
> index 6198559..261c686 100644 
> --- a/drivers/scsi/iscsi_tcp.c 
> +++ b/drivers/scsi/iscsi_tcp.c 
> @@ -37,6 +37,7 @@ 
>  #include  
>  #include  
>  #include  
> +#include  
>  #include  
>  #include  
>  #include  
> @@ -954,6 +955,12 @@ static int iscsi_sw_tcp_slave_alloc(struct 
> scsi_device *sdev) 
>   
>  static int iscsi_sw_tcp_slave_configure(struct scsi_device *sdev) 
>  { 
> +struct iscsi_sw_tcp_host *tcp_sw_host = 
> iscsi_host_priv(sdev->host); 
> +struct iscsi_session *session = tcp_sw_host->session; 
> +struct iscsi_conn *conn = session->leadconn; 
> + 
> +if (conn->datadgst_en) 
> +sdev->request_queue->backing_dev_info->capabilities |= 
> BDI_CAP_STABLE_WRITES; 
>  blk_queue_bounce_limit(sdev->request_queue, BLK_BOUNCE_ANY); 
>  blk_queue_dma_alignment(sdev->request_queue, 0); 
>  return 0; 
> -- 
> 2.7.4 
>
>
Signed-off-by: Lee Duncan  

-- 
You received this message because you are subscribed to the Google Groups 
"open-iscsi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to open-iscsi+unsubscr...@googlegroups.com.
To post to this group, send email to open-iscsi@googlegroups.com.
Visit this group at https://groups.google.com/group/open-iscsi.
For more options, visit https://groups.google.com/d/optout.