bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] fix NFSv4 acl detection on F39


From: Ondrej Valousek
Subject: Re: [PATCH] fix NFSv4 acl detection on F39
Date: Wed, 3 May 2023 05:44:08 +0000

What's the reason for doing that? 
I wanted to save syscalls, not to create more.

Zasláno z Outlooku pro Android

From: Paul Eggert <eggert@cs.ucla.edu>
Sent: Tuesday, May 2, 2023 11:32:39 PM
To: Ondrej Valousek <ondrej.valousek.xm@renesas.com>; bug-gnulib@gnu.org <bug-gnulib@gnu.org>
Subject: Re: [PATCH] fix NFSv4 acl detection on F39
 
On 5/1/23 19:27, Paul Eggert wrote:
> * Do not use llistxattr (name, NULL, 0). Instead, invoke llistxattr on a
> small (say, 3 KiB) buffer on the stack. Use malloc only if llistxattr
> returns ERANGE, and keep expanding this buffer (via free-then-malloc,
> not realloc, since you don't need to save the old storage) while
> llistxattr returns ERANGE. Check for integer overflow when multiplying
> the buffer size by 1.5, by using ckd_add. Use 'free' at the end only if
> we used 'malloc'.

On second thought, since llistxattr (name, NULL, 0) gives us a good
hint, perhaps it'd be better to do the following:

Invoke llistxattr on a small (say, 3 KiB) buffer on the stack. If this
fails with ERANGE, use llistxattr (name, NULL, 0) to estimate the size
and then use malloc+llistxattr with that size, repeating as long as
llistxattr fails with ERANGE.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]