From patchwork Fri Sep 23 19:17:03 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jason Gunthorpe X-Patchwork-Id: 9348663 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 3987B607F2 for ; Fri, 23 Sep 2016 19:17:34 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 28E622AD82 for ; Fri, 23 Sep 2016 19:17:34 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 132252AD83; Fri, 23 Sep 2016 19:17:34 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9355F2AD7E for ; Fri, 23 Sep 2016 19:17:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758963AbcIWTRX (ORCPT ); Fri, 23 Sep 2016 15:17:23 -0400 Received: from quartz.orcorp.ca ([184.70.90.242]:45274 "EHLO quartz.orcorp.ca" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1761144AbcIWTRS (ORCPT ); Fri, 23 Sep 2016 15:17:18 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=obsidianresearch.com; s=rsa1; h=References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From; bh=FmxegZrU1mHFWUcGRFvKTqkPfdlaBxhO+6QVLCMzn0k=; b=u/5/aWNOaA+FsuUWfIPzQKEsQmZ/kRh4GNRRERk278Of6u/QhqQrpIfkEBpiI62r6i/xbe+22oOkoantd2TUR7hm4BQPrU8hkWg1s9pX2i3mb9vIEu3dRGdpbuqJ2W6K0a5NAOxEY6kGmy+RgRCxgw5s1//yWhdOzCQsfdWPxnw=; Received: from [10.0.0.151] (helo=jggl.edm.orcorp.ca) by quartz.orcorp.ca with esmtps (TLS1.2:ECDHE_RSA_AES_128_CBC_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1bnVyF-0007dS-P2; Fri, 23 Sep 2016 13:17:15 -0600 From: Jason Gunthorpe To: linux-rdma@vger.kernel.org Cc: Bart Van Assche Subject: [PATCH 08/13] srp_daemon: Move lock file into /var/run/ Date: Fri, 23 Sep 2016 13:17:03 -0600 Message-Id: <1474658228-5390-9-git-send-email-jgunthorpe@obsidianresearch.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1474658228-5390-1-git-send-email-jgunthorpe@obsidianresearch.com> References: <1474658228-5390-1-git-send-email-jgunthorpe@obsidianresearch.com> X-Broken-Reverse-DNS: no host name found for IP address 10.0.0.151 Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP '/var/tmp' is an inappropriate places for lock files of this nature, they belong in /var/run. /var/lock does not seem suitable because this lock is not against a basic device node. Signed-off-by: Jason Gunthorpe --- buildlib/config.h.in | 1 + srp_daemon/srp_daemon/srp_daemon.c | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/buildlib/config.h.in b/buildlib/config.h.in index bbc279d3c9c3..78994a39d7ad 100644 --- a/buildlib/config.h.in +++ b/buildlib/config.h.in @@ -22,6 +22,7 @@ #define IWPM_CONFIG_FILE "@CMAKE_INSTALL_FULL_SYSCONFDIR@/iwpmd.conf" #define SRP_DEAMON_CONFIG_FILE "@CMAKE_INSTALL_FULL_SYSCONFDIR@/srp_daemon.conf" +#define SRP_DEAMON_LOCK_PREFIX "@CMAKE_INSTALL_FULL_RUNDIR@/srp_daemon" #define ACM_CONF_DIR "@CMAKE_INSTALL_FULL_SYSCONFDIR@/rdma" #define IBACM_LIB_PATH "@ACM_PROVIDER_DIR@" diff --git a/srp_daemon/srp_daemon/srp_daemon.c b/srp_daemon/srp_daemon/srp_daemon.c index 70764e00f851..f16674dbfafa 100644 --- a/srp_daemon/srp_daemon/srp_daemon.c +++ b/srp_daemon/srp_daemon/srp_daemon.c @@ -131,7 +131,7 @@ static int check_process_uniqueness(struct config_t *conf) char path[256]; int fd; - snprintf(path, sizeof(path), "/var/tmp/srp_daemon_%s_%d", + snprintf(path, sizeof(path), SRP_DEAMON_LOCK_PREFIX "_%s_%d", conf->dev_name, conf->port_num); if ((fd = open(path, O_CREAT|O_RDWR,