lib/env_dpdk: Change the location of lock files from /tmp to /var/tmp
Move the lock files from '/tmp' to '/var/tmp' cause user maybe delete files in /tmp or remount /tmp by mistake, And the JSON-RPC domain socket located in '/var/tmp' also. Signed-off-by: Weifeng Su <suweifeng1@huawei.com> Signed-off-by: Shihao Sun <sunshihao@huawei.com> Change-Id: I18d52f42462e8477fb35aeea9e38efc51610d17c Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/5096 Community-CI: Broadcom CI Reviewed-by: Changpeng Liu <changpeng.liu@intel.com> Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com> Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com> Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
This commit is contained in:
parent
5e01bdb41d
commit
00a126bea8
@ -920,7 +920,7 @@ spdk_pci_device_claim(struct spdk_pci_device *dev)
|
|||||||
.l_len = 0,
|
.l_len = 0,
|
||||||
};
|
};
|
||||||
|
|
||||||
snprintf(dev_name, sizeof(dev_name), "/tmp/spdk_pci_lock_%04x:%02x:%02x.%x",
|
snprintf(dev_name, sizeof(dev_name), "/var/tmp/spdk_pci_lock_%04x:%02x:%02x.%x",
|
||||||
dev->addr.domain, dev->addr.bus, dev->addr.dev, dev->addr.func);
|
dev->addr.domain, dev->addr.bus, dev->addr.dev, dev->addr.func);
|
||||||
|
|
||||||
dev_fd = open(dev_name, O_RDWR | O_CREAT, S_IRUSR | S_IWUSR);
|
dev_fd = open(dev_name, O_RDWR | O_CREAT, S_IRUSR | S_IWUSR);
|
||||||
@ -965,7 +965,7 @@ spdk_pci_device_unclaim(struct spdk_pci_device *dev)
|
|||||||
{
|
{
|
||||||
char dev_name[64];
|
char dev_name[64];
|
||||||
|
|
||||||
snprintf(dev_name, sizeof(dev_name), "/tmp/spdk_pci_lock_%04x:%02x:%02x.%x",
|
snprintf(dev_name, sizeof(dev_name), "/var/tmp/spdk_pci_lock_%04x:%02x:%02x.%x",
|
||||||
dev->addr.domain, dev->addr.bus, dev->addr.dev, dev->addr.func);
|
dev->addr.domain, dev->addr.bus, dev->addr.dev, dev->addr.func);
|
||||||
|
|
||||||
close(dev->internal.claim_fd);
|
close(dev->internal.claim_fd);
|
||||||
|
@ -756,7 +756,7 @@ nvme_cuse_claim(struct cuse_device *ctrlr_device, uint32_t index)
|
|||||||
};
|
};
|
||||||
|
|
||||||
snprintf(ctrlr_device->lock_name, sizeof(ctrlr_device->lock_name),
|
snprintf(ctrlr_device->lock_name, sizeof(ctrlr_device->lock_name),
|
||||||
"/tmp/spdk_nvme_cuse_lock_%" PRIu32, index);
|
"/var/tmp/spdk_nvme_cuse_lock_%" PRIu32, index);
|
||||||
|
|
||||||
dev_fd = open(ctrlr_device->lock_name, O_RDWR | O_CREAT, S_IRUSR | S_IWUSR);
|
dev_fd = open(ctrlr_device->lock_name, O_RDWR | O_CREAT, S_IRUSR | S_IWUSR);
|
||||||
if (dev_fd == -1) {
|
if (dev_fd == -1) {
|
||||||
|
Loading…
Reference in New Issue
Block a user