linux-man.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] close.2: Warn more clearly about the risks of close(2) and record locks
@ 2023-08-22 15:20 Tomáš Golembiovský
  2023-08-25 18:22 ` Alejandro Colomar
  0 siblings, 1 reply; 2+ messages in thread
From: Tomáš Golembiovský @ 2023-08-22 15:20 UTC (permalink / raw)
  To: Alejandro Colomar; +Cc: linux-man, Tomáš Golembiovský

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>
---
 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
-- 
2.41.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] close.2: Warn more clearly about the risks of close(2) and record locks
  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
  0 siblings, 0 replies; 2+ messages in thread
From: Alejandro Colomar @ 2023-08-25 18:22 UTC (permalink / raw)
  To: Tomáš Golembiovský; +Cc: linux-man


[-- 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 --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-08-25 18:23 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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 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).