Re: [PATCH] nvmet: disable direct I/O when unavailable
From: Bart Van Assche
Date: Mon Feb 25 2019 - 11:10:21 EST
On Mon, 2019-02-25 at 16:38 +-0100, Johannes Thumshirn wrote:
+AD4 On Mon, Feb 25, 2019 at 06:49:04AM -0800, Bart Van Assche wrote:
+AD4 +AD4 On 2/25/19 1:37 AM, Johannes Thumshirn wrote:
+AD4 +AD4 +AD4 On 24/02/2019 11:54, Max Gurtovoy wrote:
+AD4 +AD4 +AD4 +AD4 What is the status of iSCSI/SRP targets in this case ?
+AD4 +AD4 +AD4
+AD4 +AD4 +AD4 iSCSI/SRP passes in the following:
+AD4 +AD4 +AD4
+AD4 +AD4 +AD4 /+ACo
+AD4 +AD4 +AD4 +ACo Use O+AF8-DSYNC by default instead of O+AF8-SYNC to forgo syncing
+AD4 +AD4 +AD4 +ACo of pure timestamp updates.
+AD4 +AD4 +AD4 +ACo-/
+AD4 +AD4 +AD4 flags +AD0 O+AF8-RDWR +AHw O+AF8-CREAT +AHw O+AF8-LARGEFILE +AHw O+AF8-DSYNC+ADs
+AD4 +AD4
+AD4 +AD4 That code fragment comes from the LIO file backend. There is no requirement
+AD4 +AD4 for a SCSI target core file backend to use O+AF8-DSYNC. SCST allows users to
+AD4 +AD4 choose whether or not O+AF8-DSYNC should be used:
+AD4
+AD4 Yes, LIO file backend is the in-tree equivalent to NVMe's file backend. That's
+AD4 why I copied it here.
+AD4
+AD4
+AD4 +AD4
+AD4 +AD4 if (virt+AF8-dev-+AD4-wt+AF8-flag +ACYAJg +ACE-virt+AF8-dev-+AD4-nv+AF8-cache)
+AD4 +AD4 open+AF8-flags +AHwAPQ O+AF8-DSYNC+ADs
+AD4 +AD4
+AD4
+AD4 OK. Do your open+AF8-flags include O+AF8-DIRECT per default as well?
I don't think it has ever been supported to pass O+AF8-DIRECT to filp+AF8-open().
As one can see in build+AF8-open+AF8-flags() O+AF8-DIRECT is ignored. The only way I
know of to submit direct I/O from kernel context is by setting the
IOCB+AF8-DIRECT flag.
Bart.