linux-man.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [f]statfs(2) shaded as deprecated?
@ 2023-06-23 19:58 наб
  2023-06-23 20:08 ` Alejandro Colomar
  0 siblings, 1 reply; 11+ messages in thread
From: наб @ 2023-06-23 19:58 UTC (permalink / raw)
  To: Alejandro Colomar (man-pages); +Cc: linux-man

[-- Attachment #1: Type: text/plain, Size: 3137 bytes --]

Hi!

After the bookworm update I've found that statfs.2 is shaded
[[deprecated]], citing
  LSB has deprecated the library calls statfs() and fstatfs() and tells
  us to use statvfs(3) and fstatvfs(3) instead.

"LSB" doesn't appear to be, well, anything, inasmuch as
  man-pages$ git grep LSB
  Changes.old:        Remove statement that LSB deprecates the functions
  Changes.old:        being deprecated in any of the LSB specs).  Rather, LSB simply
  Changes.old:        doesn't specify these functions.  (LSB 1.3 had a spec of
  man2/statfs.2:LSB has deprecated the library calls
  man3/gets.3:LSB deprecates
  man5/elf.5:.B ELFDATA2LSB
  man-pages$ git grep -i 'standard base'

I, logically, know that LSB refers to the linux standard base, but I
don't see how it's relevant here. What's the stated reason? Is this part
of any publication?

This function is not marked as deprecated in either glibc or musl,
and, indeed, on both implementations statvfs is just
  return statfs_to_statvfs(statfs(...));

Normally, like who cares, and statvfs is the standard interface!,
but they carry disjoint data; they agree on
  f_bavail f_bfree f_blocks f_bsize f_ffree f_files f_flag/f_flags f_frsize f_fsid f_namemax/f_namelen
but struct statvfs has
  fsfilcnt_t f_favail;  /* Number of free inodes for unprivileged users */
to which glibc says
  /* XXX I have no idea how to compute f_favail.  Any idea???  */
  buf->f_favail = buf->f_ffree;
(this bug appears unnoted in the manual) and, much more importantly,
struct statfs has
  __fsword_t f_type;    /* Type of filesystem (see below) */
which is removed in struct statvfs.

(struct statvfs also has one field for f_fsid whereas it's two fields in
 struct statfs, and this is truncated during the conversion;
 this appears to just amount to a loss of entropy, so.)

The standard fully allows having having the field there as an extension,
and thankfully both musl and glibc carry six ints of padding in
struct statvfs, so this could be done, but isn't.

(Indeed, on glibc/Hurd struct statvfs already has an __f_type in there;
 this should be an uncontroversial change.)

Nevertheless, statfs() is shaded deprecated in favour of statvfs(),
contrary to all implementations, on shaky ground, and statvfs() cannot
actually replace statfs().

To this end, then:
  * note that under Linux libcs, f_ffree = f_favail
  * unshade statfs(2) as deprecated
    (instead put a note at the end of the SYNOPSIS saying
     "Use the standard interface (statvfs(3)) unless you need f_type."
     or something to that effect?)
  * post to glibc a patch renaming __f_type to f_type on Hurd
  * post to glibc a patch replacing one of the __f_spares with f_type
  * ibid. but musl
  * once that lands, /then/ maybe mark statfs() as deprecated
    (for weird types and nonportability)
  * add f_type to statvfs(3) as "Filesystem type (Linux only, see
	statfs(2) for possible values)"

I've cooked up the libc patches but wanted to see if we're in agreement
here (and also wanted to have a list link to include in the messages).

Best,
наб

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

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

* Re: [f]statfs(2) shaded as deprecated?
  2023-06-23 19:58 [f]statfs(2) shaded as deprecated? наб
@ 2023-06-23 20:08 ` Alejandro Colomar
  2023-06-23 21:00   ` [PATCH 1/2] statfs.2: unshade as deprecated, but direct to statvfs(3) наб
  2023-06-23 21:00   ` [PATCH 2/2] statvfs.3: note f_favail = f_ffree on Linux наб
  0 siblings, 2 replies; 11+ messages in thread
From: Alejandro Colomar @ 2023-06-23 20:08 UTC (permalink / raw)
  To: наб; +Cc: linux-man


[-- Attachment #1.1: Type: text/plain, Size: 3753 bytes --]

Hi наб!

On 2023-06-23 21:58, наб wrote:
> Hi!
> 
> After the bookworm update I've found that statfs.2 is shaded
> [[deprecated]], citing
>   LSB has deprecated the library calls statfs() and fstatfs() and tells
>   us to use statvfs(3) and fstatvfs(3) instead.
> 
> "LSB" doesn't appear to be, well, anything, inasmuch as
>   man-pages$ git grep LSB
>   Changes.old:        Remove statement that LSB deprecates the functions
>   Changes.old:        being deprecated in any of the LSB specs).  Rather, LSB simply
>   Changes.old:        doesn't specify these functions.  (LSB 1.3 had a spec of
>   man2/statfs.2:LSB has deprecated the library calls
>   man3/gets.3:LSB deprecates
>   man5/elf.5:.B ELFDATA2LSB
>   man-pages$ git grep -i 'standard base'
> 
> I, logically, know that LSB refers to the linux standard base, but I
> don't see how it's relevant here. What's the stated reason? Is this part
> of any publication?
> 
> This function is not marked as deprecated in either glibc or musl,
> and, indeed, on both implementations statvfs is just
>   return statfs_to_statvfs(statfs(...));
> 
> Normally, like who cares, and statvfs is the standard interface!,
> but they carry disjoint data; they agree on
>   f_bavail f_bfree f_blocks f_bsize f_ffree f_files f_flag/f_flags f_frsize f_fsid f_namemax/f_namelen
> but struct statvfs has
>   fsfilcnt_t f_favail;  /* Number of free inodes for unprivileged users */
> to which glibc says
>   /* XXX I have no idea how to compute f_favail.  Any idea???  */
>   buf->f_favail = buf->f_ffree;
> (this bug appears unnoted in the manual) and, much more importantly,
> struct statfs has
>   __fsword_t f_type;    /* Type of filesystem (see below) */
> which is removed in struct statvfs.
> 
> (struct statvfs also has one field for f_fsid whereas it's two fields in
>  struct statfs, and this is truncated during the conversion;
>  this appears to just amount to a loss of entropy, so.)
> 
> The standard fully allows having having the field there as an extension,
> and thankfully both musl and glibc carry six ints of padding in
> struct statvfs, so this could be done, but isn't.
> 
> (Indeed, on glibc/Hurd struct statvfs already has an __f_type in there;
>  this should be an uncontroversial change.)
> 
> Nevertheless, statfs() is shaded deprecated in favour of statvfs(),
> contrary to all implementations, on shaky ground, and statvfs() cannot
> actually replace statfs().
> 
> To this end, then:
>   * note that under Linux libcs, f_ffree = f_favail
>   * unshade statfs(2) as deprecated
>     (instead put a note at the end of the SYNOPSIS saying
>      "Use the standard interface (statvfs(3)) unless you need f_type."
>      or something to that effect?)
>   * post to glibc a patch renaming __f_type to f_type on Hurd
>   * post to glibc a patch replacing one of the __f_spares with f_type
>   * ibid. but musl
>   * once that lands, /then/ maybe mark statfs() as deprecated
>     (for weird types and nonportability)
>   * add f_type to statvfs(3) as "Filesystem type (Linux only, see
> 	statfs(2) for possible values)"
> 
> I've cooked up the libc patches but wanted to see if we're in agreement
> here (and also wanted to have a list link to include in the messages).

Seems important enough to answer promptly.  I agree with you.  Go ahead
and propose a patch.  I'll go back to my temporary retirement, and may
take some time to apply the patch when you send it, though.

<https://lore.kernel.org/linux-man/dc425a39-c16f-51b2-6940-2d4815b5cb73@gmail.com/T/#u>

Best,
Alex

> 
> Best,
> наб

-- 
<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] 11+ messages in thread

* [PATCH 1/2] statfs.2: unshade as deprecated, but direct to statvfs(3)
  2023-06-23 20:08 ` Alejandro Colomar
@ 2023-06-23 21:00   ` наб
  2023-06-23 21:00   ` [PATCH 2/2] statvfs.3: note f_favail = f_ffree on Linux наб
  1 sibling, 0 replies; 11+ messages in thread
From: наб @ 2023-06-23 21:00 UTC (permalink / raw)
  To: Alejandro Colomar (man-pages); +Cc: linux-man

[-- Attachment #1: Type: text/plain, Size: 1093 bytes --]

Link: https://lore.kernel.org/linux-man/f54kudgblgk643u32tb6at4cd3kkzha6hslahv24szs4raroaz@ogivjbfdaqtb/t/#u
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
---
Eeh, no rush.

Posted as
  https://sourceware.org/pipermail/libc-alpha/2023-June/149350.html
  https://www.openwall.com/lists/musl/2023/06/23/1

 man2/statfs.2 | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/man2/statfs.2 b/man2/statfs.2
index 0496ab6c9..307a29b3a 100644
--- a/man2/statfs.2
+++ b/man2/statfs.2
@@ -15,9 +15,15 @@ .SH SYNOPSIS
 .nf
 .BR "#include <sys/vfs.h>    " "/* or <sys/statfs.h> */"
 .PP
-.BI "[[deprecated]] int statfs(const char *" path ", struct statfs *" buf );
-.BI "[[deprecated]] int fstatfs(int " fd ", struct statfs *" buf );
+.BI "int statfs(const char *" path ", struct statfs *" buf );
+.BI "int fstatfs(int " fd ", struct statfs *" buf );
 .fi
+.PP
+Unless you need the
+.I f_type
+field, you should use the standard
+.BR statvfs (3)
+interface instead.
 .SH DESCRIPTION
 The
 .BR statfs ()
-- 
2.39.2


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

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

* [PATCH 2/2] statvfs.3: note f_favail = f_ffree on Linux
  2023-06-23 20:08 ` Alejandro Colomar
  2023-06-23 21:00   ` [PATCH 1/2] statfs.2: unshade as deprecated, but direct to statvfs(3) наб
@ 2023-06-23 21:00   ` наб
  2023-06-24  0:39     ` [PATCH v2 " наб
  1 sibling, 1 reply; 11+ messages in thread
From: наб @ 2023-06-23 21:00 UTC (permalink / raw)
  To: Alejandro Colomar (man-pages); +Cc: linux-man

[-- Attachment #1: Type: text/plain, Size: 766 bytes --]

It's unclear to me if inodes /may/ be reserved for root at all,
but the glibc comment in the Link would imply as much.

Link: https://lore.kernel.org/linux-man/f54kudgblgk643u32tb6at4cd3kkzha6hslahv24szs4raroaz@ogivjbfdaqtb/t/#u
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
---
 man3/statvfs.3 | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/man3/statvfs.3 b/man3/statvfs.3
index b1f0e7545..23e4388fb 100644
--- a/man3/statvfs.3
+++ b/man3/statvfs.3
@@ -227,6 +227,12 @@ .SH NOTES
 .BR statvfs ()
 with the argument
 .IR path .
+.SH BUGS
+Under Linux,
+.I f_favail
+is always the same as
+.IR f_ffree ,
+even if some inodes are reserved for root.
 .SH STANDARDS
 POSIX.1-2008.
 .SH HISTORY
-- 
2.39.2

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

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

* [PATCH v2 2/2] statvfs.3: note f_favail = f_ffree on Linux
  2023-06-23 21:00   ` [PATCH 2/2] statvfs.3: note f_favail = f_ffree on Linux наб
@ 2023-06-24  0:39     ` наб
  2023-07-05 13:57       ` Tom Schwindl
  0 siblings, 1 reply; 11+ messages in thread
From: наб @ 2023-06-24  0:39 UTC (permalink / raw)
  To: Alejandro Colomar (man-pages); +Cc: linux-man

[-- Attachment #1: Type: text/plain, Size: 1361 bytes --]

Quoting myself from #musl:
01:59:40 hm, I think this was just invented for symmetry with bfree/bavail
02:00:46 FFS has minfree for space but nothing equivalent for inodes
02:32:31 (this is mirrored in ext4;
	  a global grep over DragonFlyBSD and the illumos gate
	  showed just NFSv3 forwarding from the server;
	  OpenBSD always sets it to the same thing as f_ffree;
	  oddly, NetBSD /does/ calculate it differently
	  for LFS and FFS but due to queued writes or
	  w/e not because of root reservation;
	  and as expected a lot of "/* what to put in here? */"
	                       and "// XXX same??")

Link: https://lore.kernel.org/linux-man/f54kudgblgk643u32tb6at4cd3kkzha6hslahv24szs4raroaz@ogivjbfdaqtb/t/#u
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
---
 man3/statvfs.3 | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/man3/statvfs.3 b/man3/statvfs.3
index b1f0e7545..272ee5391 100644
--- a/man3/statvfs.3
+++ b/man3/statvfs.3
@@ -227,6 +227,14 @@ .SH NOTES
 .BR statvfs ()
 with the argument
 .IR path .
+.PP
+Under Linux,
+.I f_favail
+is always the same as
+.IR f_ffree ,
+and there's no way for a file-system to report otherwise.
+This is not an issue, since no filesystems with an i-node
+root reservation exist.
 .SH STANDARDS
 POSIX.1-2008.
 .SH HISTORY
-- 
2.39.2

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

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

* Re: [PATCH v2 2/2] statvfs.3: note f_favail = f_ffree on Linux
  2023-06-24  0:39     ` [PATCH v2 " наб
@ 2023-07-05 13:57       ` Tom Schwindl
  2023-07-08 17:11         ` Alejandro Colomar
  2023-07-18 11:43         ` [PATCH v2 " Alejandro Colomar
  0 siblings, 2 replies; 11+ messages in thread
From: Tom Schwindl @ 2023-07-05 13:57 UTC (permalink / raw)
  To: наб, Alejandro Colomar (man-pages); +Cc: linux-man

On Sat Jun 24, 2023 at 2:39 AM CEST, наб wrote:
> Quoting myself from #musl:
> 01:59:40 hm, I think this was just invented for symmetry with bfree/bavail
> 02:00:46 FFS has minfree for space but nothing equivalent for inodes
> 02:32:31 (this is mirrored in ext4;
> 	  a global grep over DragonFlyBSD and the illumos gate
> 	  showed just NFSv3 forwarding from the server;
> 	  OpenBSD always sets it to the same thing as f_ffree;
> 	  oddly, NetBSD /does/ calculate it differently
> 	  for LFS and FFS but due to queued writes or
> 	  w/e not because of root reservation;
> 	  and as expected a lot of "/* what to put in here? */"
> 	                       and "// XXX same??")
>
> Link: https://lore.kernel.org/linux-man/f54kudgblgk643u32tb6at4cd3kkzha6hslahv24szs4raroaz@ogivjbfdaqtb/t/#u
> Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
> ---
>  man3/statvfs.3 | 8 ++++++++
>  1 file changed, 8 insertions(+)
>
> diff --git a/man3/statvfs.3 b/man3/statvfs.3
> index b1f0e7545..272ee5391 100644
> --- a/man3/statvfs.3
> +++ b/man3/statvfs.3
> @@ -227,6 +227,14 @@ .SH NOTES
>  .BR statvfs ()
>  with the argument
>  .IR path .
> +.PP
> +Under Linux,
> +.I f_favail
> +is always the same as
> +.IR f_ffree ,
> +and there's no way for a file-system to report otherwise.

s/file-system/filesystem/ as that's what's used elsewhere.

> +This is not an issue, since no filesystems with an i-node
> +root reservation exist.

s/i-node/inode/ for the same reason.

>  .SH STANDARDS
>  POSIX.1-2008.
>  .SH HISTORY

-- 
Best Regards,
Tom Schwindl

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

* Re: [PATCH v2 2/2] statvfs.3: note f_favail = f_ffree on Linux
  2023-07-05 13:57       ` Tom Schwindl
@ 2023-07-08 17:11         ` Alejandro Colomar
  2023-07-08 20:01           ` [PATCH v3 " наб
  2023-07-18 11:43         ` [PATCH v2 " Alejandro Colomar
  1 sibling, 1 reply; 11+ messages in thread
From: Alejandro Colomar @ 2023-07-08 17:11 UTC (permalink / raw)
  To: Tom Schwindl, наб; +Cc: linux-man


[-- Attachment #1.1: Type: text/plain, Size: 2773 bytes --]

Hi!

On 7/5/23 15:57, Tom Schwindl wrote:
> On Sat Jun 24, 2023 at 2:39 AM CEST, наб wrote:
>> Quoting myself from #musl:
>> 01:59:40 hm, I think this was just invented for symmetry with bfree/bavail
>> 02:00:46 FFS has minfree for space but nothing equivalent for inodes
>> 02:32:31 (this is mirrored in ext4;
>> 	  a global grep over DragonFlyBSD and the illumos gate
>> 	  showed just NFSv3 forwarding from the server;
>> 	  OpenBSD always sets it to the same thing as f_ffree;
>> 	  oddly, NetBSD /does/ calculate it differently
>> 	  for LFS and FFS but due to queued writes or
>> 	  w/e not because of root reservation;
>> 	  and as expected a lot of "/* what to put in here? */"
>> 	                       and "// XXX same??")
>>
>> Link: https://lore.kernel.org/linux-man/f54kudgblgk643u32tb6at4cd3kkzha6hslahv24szs4raroaz@ogivjbfdaqtb/t/#u
>> Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
>> ---
>>   man3/statvfs.3 | 8 ++++++++
>>   1 file changed, 8 insertions(+)
>>
>> diff --git a/man3/statvfs.3 b/man3/statvfs.3
>> index b1f0e7545..272ee5391 100644
>> --- a/man3/statvfs.3
>> +++ b/man3/statvfs.3
>> @@ -227,6 +227,14 @@ .SH NOTES
>>   .BR statvfs ()
>>   with the argument
>>   .IR path .
>> +.PP
>> +Under Linux,
>> +.I f_favail
>> +is always the same as
>> +.IR f_ffree ,
>> +and there's no way for a file-system to report otherwise.
> 
> s/file-system/filesystem/ as that's what's used elsewhere.

Tom seems to be right.  See man-pages(7):

    Preferred terms
        The  following table lists some preferred terms to use in
        man pages, mainly to ensure consistency across pages.
        Term                 Avoid using              Notes
        ─────────────────────────────────────────────────────────────
        bit mask             bitmask
        built‐in             builtin
        Epoch                epoch                    For the UNIX
                                                      Epoch
                                                      (00:00:00, 1
                                                      Jan 1970 UTC)
        filename             file name
        filesystem           file system
        hostname             host name
        inode                i‐node

Cheers,
Alex

> 
>> +This is not an issue, since no filesystems with an i-node
>> +root reservation exist.
> 
> s/i-node/inode/ for the same reason.
> 
>>   .SH STANDARDS
>>   POSIX.1-2008.
>>   .SH HISTORY
> 

-- 
<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] 11+ messages in thread

* [PATCH v3 2/2] statvfs.3: note f_favail = f_ffree on Linux
  2023-07-08 17:11         ` Alejandro Colomar
@ 2023-07-08 20:01           ` наб
  2023-07-15 13:41             ` Alejandro Colomar
  0 siblings, 1 reply; 11+ messages in thread
From: наб @ 2023-07-08 20:01 UTC (permalink / raw)
  To: Alejandro Colomar; +Cc: linux-man, Tom Schwindl

[-- Attachment #1: Type: text/plain, Size: 1398 bytes --]

Quoting myself from #musl:
01:59:40 hm, I think this was just invented for symmetry with bfree/bavail
02:00:46 FFS has minfree for space but nothing equivalent for inodes
02:32:31 (this is mirrored in ext4;
	  a global grep over DragonFlyBSD and the illumos gate
	  showed just NFSv3 forwarding from the server;
	  OpenBSD always sets it to the same thing as f_ffree;
	  oddly, NetBSD /does/ calculate it differently
	  for LFS and FFS but due to queued writes or
	  w/e not because of root reservation;
	  and as expected a lot of "/* what to put in here? */"
	                       and "// XXX same??")

Link: https://lore.kernel.org/linux-man/f54kudgblgk643u32tb6at4cd3kkzha6hslahv24szs4raroaz@ogivjbfdaqtb/t/#u
Cc: Tom Schwindl <schwindl@posteo.de>
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
---
 man3/statvfs.3 | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/man3/statvfs.3 b/man3/statvfs.3
index b1f0e7545..50b568ab1 100644
--- a/man3/statvfs.3
+++ b/man3/statvfs.3
@@ -227,6 +227,14 @@ .SH NOTES
 .BR statvfs ()
 with the argument
 .IR path .
+.PP
+Under Linux,
+.I f_favail
+is always the same as
+.IR f_ffree ,
+and there's no way for a filesystem to report otherwise.
+This is not an issue, since no filesystems with an inode
+root reservation exist.
 .SH STANDARDS
 POSIX.1-2008.
 .SH HISTORY
-- 
2.39.2

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

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

* Re: [PATCH v3 2/2] statvfs.3: note f_favail = f_ffree on Linux
  2023-07-08 20:01           ` [PATCH v3 " наб
@ 2023-07-15 13:41             ` Alejandro Colomar
  0 siblings, 0 replies; 11+ messages in thread
From: Alejandro Colomar @ 2023-07-15 13:41 UTC (permalink / raw)
  To: наб; +Cc: linux-man, Tom Schwindl


[-- Attachment #1.1: Type: text/plain, Size: 1741 bytes --]

On 2023-07-08 22:01, наб wrote:
> Quoting myself from #musl:
> 01:59:40 hm, I think this was just invented for symmetry with bfree/bavail
> 02:00:46 FFS has minfree for space but nothing equivalent for inodes
> 02:32:31 (this is mirrored in ext4;
> 	  a global grep over DragonFlyBSD and the illumos gate
> 	  showed just NFSv3 forwarding from the server;
> 	  OpenBSD always sets it to the same thing as f_ffree;
> 	  oddly, NetBSD /does/ calculate it differently
> 	  for LFS and FFS but due to queued writes or
> 	  w/e not because of root reservation;
> 	  and as expected a lot of "/* what to put in here? */"
> 	                       and "// XXX same??")
> 
> Link: https://lore.kernel.org/linux-man/f54kudgblgk643u32tb6at4cd3kkzha6hslahv24szs4raroaz@ogivjbfdaqtb/t/#u
> Cc: Tom Schwindl <schwindl@posteo.de>
> Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
> ---
>  man3/statvfs.3 | 8 ++++++++
>  1 file changed, 8 insertions(+)
> 
> diff --git a/man3/statvfs.3 b/man3/statvfs.3
> index b1f0e7545..50b568ab1 100644
> --- a/man3/statvfs.3
> +++ b/man3/statvfs.3
> @@ -227,6 +227,14 @@ .SH NOTES
>  .BR statvfs ()
>  with the argument
>  .IR path .
> +.PP
> +Under Linux,
> +.I f_favail
> +is always the same as
> +.IR f_ffree ,
> +and there's no way for a filesystem to report otherwise.
> +This is not an issue, since no filesystems with an inode

The break point of this line is strange.  I fixed it to right after the
comma.

Nevertheless, patch applied.

Thanks,
Alex

> +root reservation exist.
>  .SH STANDARDS
>  POSIX.1-2008.
>  .SH HISTORY

-- 
<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] 11+ messages in thread

* Re: [PATCH v2 2/2] statvfs.3: note f_favail = f_ffree on Linux
  2023-07-05 13:57       ` Tom Schwindl
  2023-07-08 17:11         ` Alejandro Colomar
@ 2023-07-18 11:43         ` Alejandro Colomar
  2023-07-18 11:48           ` Alejandro Colomar
  1 sibling, 1 reply; 11+ messages in thread
From: Alejandro Colomar @ 2023-07-18 11:43 UTC (permalink / raw)
  To: Tom Schwindl, наб; +Cc: linux-man


[-- Attachment #1.1: Type: text/plain, Size: 2874 bytes --]

Hi Tom, наб,

On 2023-07-05 15:57, Tom Schwindl wrote:
> On Sat Jun 24, 2023 at 2:39 AM CEST, наб wrote:
>> Quoting myself from #musl:
>> 01:59:40 hm, I think this was just invented for symmetry with bfree/bavail
>> 02:00:46 FFS has minfree for space but nothing equivalent for inodes
>> 02:32:31 (this is mirrored in ext4;
>> 	  a global grep over DragonFlyBSD and the illumos gate
>> 	  showed just NFSv3 forwarding from the server;
>> 	  OpenBSD always sets it to the same thing as f_ffree;
>> 	  oddly, NetBSD /does/ calculate it differently
>> 	  for LFS and FFS but due to queued writes or
>> 	  w/e not because of root reservation;
>> 	  and as expected a lot of "/* what to put in here? */"
>> 	                       and "// XXX same??")
>>
>> Link: https://lore.kernel.org/linux-man/f54kudgblgk643u32tb6at4cd3kkzha6hslahv24szs4raroaz@ogivjbfdaqtb/t/#u
>> Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
>> ---
>>  man3/statvfs.3 | 8 ++++++++
>>  1 file changed, 8 insertions(+)
>>
>> diff --git a/man3/statvfs.3 b/man3/statvfs.3
>> index b1f0e7545..272ee5391 100644
>> --- a/man3/statvfs.3
>> +++ b/man3/statvfs.3
>> @@ -227,6 +227,14 @@ .SH NOTES
>>  .BR statvfs ()
>>  with the argument
>>  .IR path .
>> +.PP
>> +Under Linux,
>> +.I f_favail
>> +is always the same as
>> +.IR f_ffree ,
>> +and there's no way for a file-system to report otherwise.
> 
> s/file-system/filesystem/ as that's what's used elsewhere.
> 
>> +This is not an issue, since no filesystems with an i-node
>> +root reservation exist.
> 
> s/i-node/inode/ for the same reason.

IIRC, I've already written this in the past, but I can't find it.
I'll write again, just in case.

man-pages(7) seems to confirm what Tom says:

   Preferred terms
       The following table lists some preferred terms to  use  in  man
       pages, mainly to ensure consistency across pages.
       Term                 Avoid using              Notes
       ──────────────────────────────────────────────────────────────
       bit mask             bitmask
       built‐in             builtin
       Epoch                epoch                    For the UNIX
                                                     Epoch
                                                     (00:00:00, 1
                                                     Jan 1970 UTC)
       filename             file name
       filesystem           file system
       hostname             host name
       inode                i‐node

Cheers,
Alex

> 
>>  .SH STANDARDS
>>  POSIX.1-2008.
>>  .SH HISTORY
> 

-- 
<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] 11+ messages in thread

* Re: [PATCH v2 2/2] statvfs.3: note f_favail = f_ffree on Linux
  2023-07-18 11:43         ` [PATCH v2 " Alejandro Colomar
@ 2023-07-18 11:48           ` Alejandro Colomar
  0 siblings, 0 replies; 11+ messages in thread
From: Alejandro Colomar @ 2023-07-18 11:48 UTC (permalink / raw)
  To: Tom Schwindl, наб; +Cc: linux-man


[-- Attachment #1.1: Type: text/plain, Size: 3221 bytes --]

On 2023-07-18 13:43, Alejandro Colomar wrote:
> Hi Tom, наб,
> 
> On 2023-07-05 15:57, Tom Schwindl wrote:
>> On Sat Jun 24, 2023 at 2:39 AM CEST, наб wrote:
>>> Quoting myself from #musl:
>>> 01:59:40 hm, I think this was just invented for symmetry with bfree/bavail
>>> 02:00:46 FFS has minfree for space but nothing equivalent for inodes
>>> 02:32:31 (this is mirrored in ext4;
>>> 	  a global grep over DragonFlyBSD and the illumos gate
>>> 	  showed just NFSv3 forwarding from the server;
>>> 	  OpenBSD always sets it to the same thing as f_ffree;
>>> 	  oddly, NetBSD /does/ calculate it differently
>>> 	  for LFS and FFS but due to queued writes or
>>> 	  w/e not because of root reservation;
>>> 	  and as expected a lot of "/* what to put in here? */"
>>> 	                       and "// XXX same??")
>>>
>>> Link: https://lore.kernel.org/linux-man/f54kudgblgk643u32tb6at4cd3kkzha6hslahv24szs4raroaz@ogivjbfdaqtb/t/#u
>>> Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
>>> ---
>>>  man3/statvfs.3 | 8 ++++++++
>>>  1 file changed, 8 insertions(+)
>>>
>>> diff --git a/man3/statvfs.3 b/man3/statvfs.3
>>> index b1f0e7545..272ee5391 100644
>>> --- a/man3/statvfs.3
>>> +++ b/man3/statvfs.3
>>> @@ -227,6 +227,14 @@ .SH NOTES
>>>  .BR statvfs ()
>>>  with the argument
>>>  .IR path .
>>> +.PP
>>> +Under Linux,
>>> +.I f_favail
>>> +is always the same as
>>> +.IR f_ffree ,
>>> +and there's no way for a file-system to report otherwise.
>>
>> s/file-system/filesystem/ as that's what's used elsewhere.
>>
>>> +This is not an issue, since no filesystems with an i-node
>>> +root reservation exist.
>>
>> s/i-node/inode/ for the same reason.
> 
> IIRC, I've already written this in the past, but I can't find it.
> I'll write again, just in case.
> 
> man-pages(7) seems to confirm what Tom says:
> 
>    Preferred terms
>        The following table lists some preferred terms to  use  in  man
>        pages, mainly to ensure consistency across pages.
>        Term                 Avoid using              Notes
>        ──────────────────────────────────────────────────────────────
>        bit mask             bitmask
>        built‐in             builtin
>        Epoch                epoch                    For the UNIX
>                                                      Epoch
>                                                      (00:00:00, 1
>                                                      Jan 1970 UTC)
>        filename             file name
>        filesystem           file system
>        hostname             host name
>        inode                i‐node
> 
> Cheers,
> Alex

Ahh, never mind; I could find now my old mail, which had been responded
with v3, which I have already applied as

c3f43ba17 ("statvfs.3: note f_favail = f_ffree on Linux")

Cheers,
Alex

> 
>>
>>>  .SH STANDARDS
>>>  POSIX.1-2008.
>>>  .SH HISTORY
>>
> 

-- 
<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] 11+ messages in thread

end of thread, other threads:[~2023-07-18 11:48 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-06-23 19:58 [f]statfs(2) shaded as deprecated? наб
2023-06-23 20:08 ` Alejandro Colomar
2023-06-23 21:00   ` [PATCH 1/2] statfs.2: unshade as deprecated, but direct to statvfs(3) наб
2023-06-23 21:00   ` [PATCH 2/2] statvfs.3: note f_favail = f_ffree on Linux наб
2023-06-24  0:39     ` [PATCH v2 " наб
2023-07-05 13:57       ` Tom Schwindl
2023-07-08 17:11         ` Alejandro Colomar
2023-07-08 20:01           ` [PATCH v3 " наб
2023-07-15 13:41             ` Alejandro Colomar
2023-07-18 11:43         ` [PATCH v2 " Alejandro Colomar
2023-07-18 11:48           ` 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).