scsi: iscsi_tcp: set BDI_CAP_STABLE_WRITES when data digest enabled
authorJianchao Wang <jianchao.w.wang@oracle.com>
Wed, 7 Mar 2018 12:29:03 +0000 (20:29 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 25 May 2018 14:17:49 +0000 (16:17 +0200)
commit10859964e0e1591860171b49eed5189f5cd465ee
tree3d300ddf459603c6659d18b294b0bd3634f8180b
parentb1a706fdb5a89e1e432f2fc2e3e48a8eb9a9fbb6
scsi: iscsi_tcp: set BDI_CAP_STABLE_WRITES when data digest enabled

[ Upstream commit 89d0c804392bb962553f23dc4c119d11b6bd1675 ]

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 <jianchao.w.wang@oracle.com>
Acked-by: Chris Leech <cleech@redhat.com>
Acked-by: Lee Duncan <lduncan@suse.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/scsi/iscsi_tcp.c