nbd: Add the O_DIRECT flag when opening the file.
To eliminate the cache issue. Signed-off-by: Ziye Yang <ziye.yang@intel.com> Change-Id: Id67fabb901de9666e6bad04c9df74a538bdbc659 Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/3662 Community-CI: Mellanox Build Bot Tested-by: SPDK CI Jenkins <sys_sgci@intel.com> Reviewed-by: Ben Walker <benjamin.walker@intel.com> Reviewed-by: Jim Harris <james.r.harris@intel.com> Reviewed-by: Changpeng Liu <changpeng.liu@intel.com> Reviewed-by: Sun Zhenyuan <sunzhenyuan@baidu.com>
This commit is contained in:
parent
7bac9b06f1
commit
4ba5e90176
@ -1060,7 +1060,7 @@ spdk_nbd_start(const char *bdev_name, const char *nbd_path,
|
||||
goto err;
|
||||
}
|
||||
|
||||
nbd->dev_fd = open(nbd_path, O_RDWR);
|
||||
nbd->dev_fd = open(nbd_path, O_RDWR | O_DIRECT);
|
||||
if (nbd->dev_fd == -1) {
|
||||
SPDK_ERRLOG("open(\"%s\") failed: %s\n", nbd_path, spdk_strerror(errno));
|
||||
rc = -errno;
|
||||
|
Loading…
Reference in New Issue
Block a user