Received: by 2002:a05:7208:13ce:b0:7f:395a:35b6 with SMTP id r14csp26717rbe; Wed, 28 Feb 2024 10:57:09 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWbLPQkLC8kkDQ+0G7JbKrlYNw53gzmnHKMUZHVWeVOFEie4FbCIMJ4OKv4A2P9f6HIxCWupXzcp5g9finFAvDOms17W33pz3tpVFSXjA== X-Google-Smtp-Source: AGHT+IGpoE9FNRHeJMPuqN6pDIN321LIoyx8cIbS8i1HgMulPDBYMAEEgI0CuDrU/1oK8eyojjja X-Received: by 2002:a17:90a:4285:b0:298:a422:937d with SMTP id p5-20020a17090a428500b00298a422937dmr18446pjg.24.1709146629307; Wed, 28 Feb 2024 10:57:09 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709146629; cv=pass; d=google.com; s=arc-20160816; b=nFvTvzPOYpxO6UiCnuT+3Gr31AlWbcYNCauSI32q8WNYX0C3kYAb0kIxzYh7sJOefj viqbEWI0aurNaYFiR+QfArX+TUX4YWWEMQUgOkPtq5dZKaWdasoWN9Ymv9NGyLyxOJMz gqNP88aIh662wFvpxp3otzbpACG5YHhgu69bvyS+Io56ZTYgCvr168s0woopHYgzjUOM kGY1J8JDGkXRNUZOVtjjAE/8f09mt+J5D52l30umAk3Pm2iA/4wTzOR6zXqZsf6bFZRL WaCd1iWhMSex0sy5MeENCdwWKW2F/3Xft42pGXzvuHqGz7kEMgbMAZFltOJmOQNTuPgV 1oDA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from; bh=+lRPLOP6/f2N0FqFtUDeawuvgwAjaM+/ruWCXYHZQ6U=; fh=DuaeoVkZ4TWUc1MIexeGqlyzWEMhi1dNOJJZza8I5Nk=; b=ne0/QwJYH85U3cSzhDIcIetM/Sy4SF9iBPDQsQmG0TNhuIIeFmdWrImxfyaYu4O81y zbCiZ4Jk7OVJXx2xodkrSqMi0lt5UMggpWnXLq9mfQSGHtQSdPMNrgE5xn0rVBJpNbuo vtNlU31Bh5b/7v95VrduYV8kBZoIOj6zRvbDkU+SVucu0TSBRJRxi+Reev3mozmMY8HT 7W3JFrRbiFLWT3rVjSLEKl7w0xAKAy1zgr//rNqYh1XdEuLYWr3dAm1YYyj0hRqk7kZg ZnVxv9AiLOaodA6Uc9r1wXB2Mx3eC+H0eJI6uvYhm5aIJ0FsxKUU5Tx1g3XuBwTBIhOp XO9g==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=pengutronix.de); spf=pass (google.com: domain of linux-nfs+bounces-2110-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-nfs+bounces-2110-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id y9-20020a17090a600900b00298d20b37a3si1817866pji.7.2024.02.28.10.57.09 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 28 Feb 2024 10:57:09 -0800 (PST) Received-SPF: pass (google.com: domain of linux-nfs+bounces-2110-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=pengutronix.de); spf=pass (google.com: domain of linux-nfs+bounces-2110-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-nfs+bounces-2110-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id D25B4286D06 for ; Wed, 28 Feb 2024 18:57:08 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 978DC79B79; Wed, 28 Feb 2024 18:57:06 +0000 (UTC) X-Original-To: linux-nfs@vger.kernel.org Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [185.203.201.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 282FA79B74 for ; Wed, 28 Feb 2024 18:57:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.203.201.7 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709146626; cv=none; b=gKbAEAuJm4fSKCcj6ta2IwqCQdi+BWnGNuLFrgMQygOfh6aj5pefGAJ+EwgL03qT2B2YPK59FogFGi90l7pGs71LgZrPclTRhmZQi2EglNWgsBGfbZAEqy5klp9LJtcOJcJD0qQH/d4HD0WCZgGdu1Zvb3gye4xxG9C/5iWk99U= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709146626; c=relaxed/simple; bh=/UbWTVtLHxMER6hH80Vrcbt28xh6/F/aoZwnhzCthX8=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=M5TYZvVdP8EsQlvI2fAV3R6BVv+gnwLaUZW1TK7JLRxoAHDTJ6MvsZgLw9Om+sbhyPJaZPPibzXiD7z2KyM0+eZ05q+nFqXw4r/Kv/KwKKHBcQ3IfVCEoOH4XoqP+uA1TEggyddItHHTnuF7kJ8uO6SnnIbZ42bZXCL14WMCSFw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de; spf=pass smtp.mailfrom=pengutronix.de; arc=none smtp.client-ip=185.203.201.7 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=pengutronix.de Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1rfP6w-0006V5-CP; Wed, 28 Feb 2024 19:56:58 +0100 Received: from [2a0a:edc0:0:1101:1d::54] (helo=dude05.red.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rfP6v-003Rir-TM; Wed, 28 Feb 2024 19:56:57 +0100 Received: from localhost ([::1] helo=dude05.red.stw.pengutronix.de) by dude05.red.stw.pengutronix.de with esmtp (Exim 4.96) (envelope-from ) id 1rfP6v-00BVbA-0z; Wed, 28 Feb 2024 19:56:57 +0100 From: Ahmad Fatoum To: NeilBrown , Steve Dickson Cc: linux-nfs@vger.kernel.org, kernel@pengutronix.de, Ahmad Fatoum Subject: [PATCH nfs-utils] start-statd: use flock -x instead of -e for busybox compatibility Date: Wed, 28 Feb 2024 19:56:44 +0100 Message-Id: <20240228185644.2743036-1-a.fatoum@pengutronix.de> X-Mailer: git-send-email 2.39.2 Precedence: bulk X-Mailing-List: linux-nfs@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: a.fatoum@pengutronix.de X-SA-Exim-Scanned: No (on metis.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-nfs@vger.kernel.org busybox flock(1) only supports -x and not -e. util-linux flock(1) treats both -e and -x the same, documents them both in its man page, but lists only -x in its help output. Referring to util-linux git, it seems both options were added between util-linux-2.13-pre1 and util-linux-2.13-pre2 back in 2006, so there should be no harm in switching over to flock -x to avoid confusing error output when attempting to mount a NFS on a busybox system: $ mount -t nfs 192.168.2.13:/home/afa/nfsroot/imx8mn-evk /mnt flock: invalid option -- 'e' BusyBox v1.36.0 () multi-call binary. Usage: flock [-sxun] FD | { FILE [-c] PROG ARGS } [Un]lock file descriptor, or lock FILE, run PROG -s Shared lock -x Exclusive lock (default) -u Unlock FD -n Fail rather than wait Signed-off-by: Ahmad Fatoum --- utils/statd/start-statd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils/statd/start-statd b/utils/statd/start-statd index b11a7d91a7f6..67a2f4ad8e0e 100755 --- a/utils/statd/start-statd +++ b/utils/statd/start-statd @@ -8,7 +8,7 @@ PATH="/sbin:/usr/sbin:/bin:/usr/bin" # Use flock to serialize the running of this script exec 9> /run/rpc.statd.lock -flock -e 9 +flock -x 9 if [ -s /run/rpc.statd.pid ] && [ "1$(cat /run/rpc.statd.pid)" -gt 1 ] && -- 2.39.2