Received: by 2002:ab2:2997:0:b0:1ec:cbc4:63fb with SMTP id n23csp342801lqb; Thu, 29 Feb 2024 02:38:33 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCW97Ri1iG3Lxnd9f1RKUR61TbG7MXw+YwSP6eUIgGXFH3bKY/K3Tgboz/oWFl7M19HT+ggdKxi+YzhI+Rek+AKJErxp8u0O1mghMq1BlQ== X-Google-Smtp-Source: AGHT+IG12IU2IHdQ9JV3TrDKWFj8CxPF15pS+uAZ4hYycL3GnfWDd5qsPiH3KhJsbPxxBBWwrfce X-Received: by 2002:a05:6a00:2fd3:b0:6e5:6417:4657 with SMTP id fn19-20020a056a002fd300b006e564174657mr2306142pfb.15.1709203113643; Thu, 29 Feb 2024 02:38:33 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709203113; cv=pass; d=google.com; s=arc-20160816; b=tsPwwzUZz5LcA3/jIAla1H/mP36swCgWbgpdhwWAfDW0TsIyGGIJo5AneEAARJtV6X Yrfo2goei4J21uujj6t19BkSBoLXwah5e0rE8Nt8q1kj65pDV+SfMuKKEAg1KnMw4kdz cRDuU7Wh2J89CFmlFAXeSkJs2c2OUyck16sVdDsHIUdNVG/cu0QsupRAwV2AKey9i+D5 BpcRgaYcB8W5bZ0ZfHyG1wNITrTZSRAjB1debsLZ938lz8S9K6X6YrOGCYAK5H6/MQZR 9TMTaFaj5w4BqqXp08vxRySxWYhOcGqQtEXE8IdLekj+ClPZSqP5D7wohvw/kKd4Y8+1 VCNg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id; bh=jyO8vXQOfKVr4mwVqOn2g39/zE9OM/aYuyWsG5SddHo=; fh=3wrtA3fHBxl5flFVASSklIc998X2i5cZwksIIUZ/Tlo=; b=xW1VKy2ZjboAYciM3ZDDbE2c5/NSHhB/OVSB+BCGp+tzKjAIWUR1VkXiUQsZzP0sn2 VSDWZtAjb0XvsntzltF5cNyR/knKXpc8UaMwteN/2HDIjuSldhhRP9TzysBvHboxh0aL z7ey4wE4WQ5247L3f4vbGfcBNDgcB759PrsIW5hiyglZAheieybe77tLYcJTfrFECRXn PzSBVPmEanFteLFV2h4w+nK5z8vrXbt52zLtDzt4YeGKuXNWtF/Bxrgva57+t9Ixw1Cn icRiK4UkFTu79xagX7BeI1rfzuztRnQDaoyHCIjWlNc9A7rKnUCjBoClGJJSoPGshNxf 8K2Q==; 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-2121-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-nfs+bounces-2121-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 y19-20020a056a00191300b006e47dc9d922si1060349pfi.138.2024.02.29.02.38.33 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Feb 2024 02:38:33 -0800 (PST) Received-SPF: pass (google.com: domain of linux-nfs+bounces-2121-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-2121-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-nfs+bounces-2121-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 5590A286AE0 for ; Thu, 29 Feb 2024 10:38:33 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 2720B79DA3; Thu, 29 Feb 2024 10:38:32 +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 0A29464A93 for ; Thu, 29 Feb 2024 10:38:27 +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=1709203112; cv=none; b=JndXzV1CXV+jlq1P4XOU35hwny2ewcJPD0WtC+QAixQ4JLyGTVauHrxLXTfaYdL5dOExc0XQlEToqLUyj8Jh6xQSrj3wa2Tcoc8rbDNrEU0cnc6O0zewoDU3a2wQ2gyUeA5fUYYyoXCz366obIsruBj1IZQvKFUL7LmieUZxp2M= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709203112; c=relaxed/simple; bh=XcpYM6VefgLLRq54RpsBge41gCtxHaIDzjqWLqD0xBw=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=cO3UiMLef3TiAeG96tfu/wU+VkGFCTICluGFUAb+xN/5wkVjwUrF0hBPRcZ5deoT8NIySRdPpNAEczDbnGpcNItbcjwzCWYHmYC8mVRjtiy4Pd4i46cuP2+Wo/VGJxuIvLcj8se7ZJRD6mQh82iYVOqKiIA+oi02QDICtVRbbgQ= 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 ptz.office.stw.pengutronix.de ([2a0a:edc0:0:900:1d::77] helo=[127.0.0.1]) by metis.whiteo.stw.pengutronix.de with esmtp (Exim 4.92) (envelope-from ) id 1rfdnt-0004YL-Oj; Thu, 29 Feb 2024 11:38:17 +0100 Message-ID: <860e64ce-8f2e-4c07-a95c-18f72fb87216@pengutronix.de> Date: Thu, 29 Feb 2024 11:38:16 +0100 Precedence: bulk X-Mailing-List: linux-nfs@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH nfs-utils] start-statd: use flock -x instead of -e for busybox compatibility Content-Language: en-US To: Calum Mackay , NeilBrown , Steve Dickson Cc: linux-nfs@vger.kernel.org, kernel@pengutronix.de References: <20240228185644.2743036-1-a.fatoum@pengutronix.de> From: Ahmad Fatoum In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-SA-Exim-Connect-IP: 2a0a:edc0:0:900:1d::77 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 Hello Calum, On 28.02.24 22:09, Calum Mackay wrote: > On 28/02/2024 6:56 pm, Ahmad Fatoum wrote: >> 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 > > hi Ahmad, > > Since the default is an exclusive lock, in both BusyBox and util-linux, might it be simpler just to run flock without that option? That would be another possibility, yes. I don't mind the explicitness in specifying an argument, but I don't feel strongly either way. Cheers, Ahmad > > best wishes, > calum. > >> --- >>   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 ] && > > -- Pengutronix e.K. | | Steuerwalder Str. 21 | http://www.pengutronix.de/ | 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |