From: Alejandro Colomar <alx@kernel.org>
To: "Tomáš Golembiovský" <tgolembi@redhat.com>
Cc: linux-man@vger.kernel.org
Subject: Re: [PATCH] close.2: Warn more clearly about the risks of close(2) and record locks
Date: Fri, 25 Aug 2023 20:22:33 +0200 [thread overview]
Message-ID: <43e97621-7f0f-032e-ce04-3f3cb4dce159@kernel.org> (raw)
In-Reply-To: <56472a7881dd44f18ad642ab978b705ef08e1651.1692717623.git.tgolembi@redhat.com>
[-- Attachment #1.1: Type: text/plain, Size: 1271 bytes --]
Hi Tomáš,
On 2023-08-22 17:20, Tomáš Golembiovský wrote:
> The consequences of using close(2) together with advisory record locks
> are quite serious. Make the warning more explicit.
>
> Signed-off-by: Tomáš Golembiovský <tgolembi@redhat.com>
Patch applied.
Thanks,
Alex
> ---
> man2/close.2 | 10 ++++++++--
> 1 file changed, 8 insertions(+), 2 deletions(-)
>
> diff --git a/man2/close.2 b/man2/close.2
> index 68211bc58..f8a4ccc2d 100644
> --- a/man2/close.2
> +++ b/man2/close.2
> @@ -32,8 +32,14 @@ may be reused.
> Any record locks (see
> .BR fcntl (2))
> held on the file it was associated with,
> -and owned by the process, are removed (regardless of the file
> -descriptor that was used to obtain the lock).
> +and owned by the process,
> +are removed regardless of the file descriptor that was used to obtain the lock.
> +This has some unfortunate consequences
> +and one should be extra careful when using advisory record locking.
> +See
> +.BR fcntl (2)
> +for discussion of the risks and consequences
> +as well as for the (probably preferred) open file description locks.
> .PP
> If
> .I fd
--
<http://www.alejandro-colomar.es/>
GPG key fingerprint: A9348594CE31283A826FBDD8D57633D441E25BB5
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
prev parent reply other threads:[~2023-08-25 18:23 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-08-22 15:20 [PATCH] close.2: Warn more clearly about the risks of close(2) and record locks Tomáš Golembiovský
2023-08-25 18:22 ` Alejandro Colomar [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=43e97621-7f0f-032e-ce04-3f3cb4dce159@kernel.org \
--to=alx@kernel.org \
--cc=linux-man@vger.kernel.org \
--cc=tgolembi@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).