public inbox for linux-man@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] tmpfs.5: document size/blocks=0 and nr_inodes=0 <=> unlimited
@ 2023-08-11 13:41 наб
  2023-08-12 18:08 ` Alejandro Colomar
  0 siblings, 1 reply; 6+ messages in thread
From: наб @ 2023-08-11 13:41 UTC (permalink / raw)
  To: Alejandro Colomar (man-pages); +Cc: linux-man

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

Bitten by this again. Behaviour blames back to at least 2005
(so probably original to shmem.c), documented upstream in tmpfs.txt.

Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
---
 man5/tmpfs.5 | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/man5/tmpfs.5 b/man5/tmpfs.5
index cdd5f2fd8..0e5bc853f 100644
--- a/man5/tmpfs.5
+++ b/man5/tmpfs.5
@@ -51,6 +51,8 @@ .SS Mount options
 .BR size "=\fIbytes\fP"
 Specify an upper limit on the size of the filesystem.
 The size is given in bytes, and rounded up to entire pages.
+The limit is removed if the size is
+.BR 0 .
 .IP
 The size may have a
 .BR k ,
@@ -89,6 +91,8 @@ .SS Mount options
 The maximum number of inodes for this instance.
 The default is half of the number of your physical RAM pages, or (on a
 machine with highmem) the number of lowmem RAM pages, whichever is smaller.
+The limit is removed if the number is
+.BR 0 .
 .IP
 Inodes may be specified with
 .BR k ,
-- 
2.39.2

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

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

* Re: [PATCH] tmpfs.5: document size/blocks=0 and nr_inodes=0 <=> unlimited
  2023-08-11 13:41 [PATCH] tmpfs.5: document size/blocks=0 and nr_inodes=0 <=> unlimited наб
@ 2023-08-12 18:08 ` Alejandro Colomar
  2023-08-12 19:04   ` Jakub Wilk
  0 siblings, 1 reply; 6+ messages in thread
From: Alejandro Colomar @ 2023-08-12 18:08 UTC (permalink / raw)
  To: наб; +Cc: linux-man


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

Hi наб,

On 2023-08-11 15:41, наб wrote:
> Bitten by this again. Behaviour blames back to at least 2005
> (so probably original to shmem.c), documented upstream in tmpfs.txt.

This is a bit unclear to me.  I guess you refer to the Linux kernel as
"upstream", but the Linux kernel repository doesn't have a tmpfs.txt
file.  I recall that they moved their .txt docs to .rst, so would you
please share the full link to the .txt file that you refer?  That way
you can ask git(1) to show the history of that file even if it doesn't
exist now.  It would also be useful to mention the new location of the
file, and that it has moved.

Also important: please share a small shell session that shows this
behavior, so that it's easier to review.  Since you were bitten, I
guess you'll have some shell session that would reproduce this, no?

Thanks,
Alex

> 
> Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
> ---
>  man5/tmpfs.5 | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/man5/tmpfs.5 b/man5/tmpfs.5
> index cdd5f2fd8..0e5bc853f 100644
> --- a/man5/tmpfs.5
> +++ b/man5/tmpfs.5
> @@ -51,6 +51,8 @@ .SS Mount options
>  .BR size "=\fIbytes\fP"
>  Specify an upper limit on the size of the filesystem.
>  The size is given in bytes, and rounded up to entire pages.
> +The limit is removed if the size is
> +.BR 0 .
>  .IP
>  The size may have a
>  .BR k ,
> @@ -89,6 +91,8 @@ .SS Mount options
>  The maximum number of inodes for this instance.
>  The default is half of the number of your physical RAM pages, or (on a
>  machine with highmem) the number of lowmem RAM pages, whichever is smaller.
> +The limit is removed if the number is
> +.BR 0 .
>  .IP
>  Inodes may be specified with
>  .BR k ,

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

* Re: [PATCH] tmpfs.5: document size/blocks=0 and nr_inodes=0 <=> unlimited
  2023-08-12 18:08 ` Alejandro Colomar
@ 2023-08-12 19:04   ` Jakub Wilk
  2023-08-12 20:03     ` [PATCH v2] " наб
  2023-08-12 20:48     ` [PATCH] " Alejandro Colomar
  0 siblings, 2 replies; 6+ messages in thread
From: Jakub Wilk @ 2023-08-12 19:04 UTC (permalink / raw)
  To: Alejandro Colomar; +Cc: наб, linux-man

* Alejandro Colomar <colomar.6.4.3@gmail.com>, 2023-08-12 20:08:
>>Bitten by this again. Behaviour blames back to at least 2005 (so 
>>probably original to shmem.c), documented upstream in tmpfs.txt.

(I've been bitten by this too!)

>This is a bit unclear to me.  I guess you refer to the Linux kernel as 
>"upstream", but the Linux kernel repository doesn't have a tmpfs.txt 
>file.  I recall that they moved their .txt docs to .rst, so would you 
>please share the full link to the .txt file that you refer?  That way 
>you can ask git(1) to show the history of that file even if it doesn't 
>exist now.

You can ask git for history of tmpfs.txt even if you don't know the 
exact location, although admittedly it's pretty slow:

    $ git log --oneline -1 '**/tmpfs.txt'
    7e7cd458b810 docs: filesystems: convert tmpfs.txt to ReST

    $ git show --oneline --stat 7e7cd458b810
    7e7cd458b810 docs: filesystems: convert tmpfs.txt to ReST
     Documentation/filesystems/index.rst                |  1 +
     Documentation/filesystems/{tmpfs.txt => tmpfs.rst} | 44 +++++++++++++++++++++++++++++---------------
     2 files changed, 30 insertions(+), 15 deletions(-)

-- 
Jakub Wilk

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

* [PATCH v2] tmpfs.5: document size/blocks=0 and nr_inodes=0 <=> unlimited
  2023-08-12 19:04   ` Jakub Wilk
@ 2023-08-12 20:03     ` наб
  2023-08-12 20:49       ` Alejandro Colomar
  2023-08-12 20:48     ` [PATCH] " Alejandro Colomar
  1 sibling, 1 reply; 6+ messages in thread
From: наб @ 2023-08-12 20:03 UTC (permalink / raw)
  To: alx; +Cc: linux-man

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

Bitten by this again. Behaviour blames back to at least 2005
(probably original to shmem.c), documented upstream in
Documentation/filesystems/tmpfs.rst (formerly .txt).

For example:
  # mount -t tmpfs -o size=0 tmpfs /etc/
  # df /etc/
  Filesystem 1k-blocks Used Avail Use% Mounted on
  tmpfs              0    0     0    - /etc
  # head -c100M  < /dev/urandom > /etc/passwd
  # df /etc/
  Filesystem 1k-blocks Used Avail Use% Mounted on
  tmpfs              0    0     0    - /etc
  # ls -l /etc/passwd
  -rw-r--r-- 1 0 0 104857600 08-12 19:55 /etc/passwd
  # du /etc/passwd
  204800  /etc/passwd
whereas the current manual insinuates head should ENOSPC instantly.

Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
---
 man5/tmpfs.5 | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/man5/tmpfs.5 b/man5/tmpfs.5
index cdd5f2fd8..5274e632d 100644
--- a/man5/tmpfs.5
+++ b/man5/tmpfs.5
@@ -51,6 +51,8 @@ .SS Mount options
 .BR size "=\fIbytes\fP"
 Specify an upper limit on the size of the filesystem.
 The size is given in bytes, and rounded up to entire pages.
+The limit is removed if the size is
+.BR 0 .
 .IP
 The size may have a
 .BR k ,
@@ -89,6 +91,8 @@ .SS Mount options
 The maximum number of inodes for this instance.
 The default is half of the number of your physical RAM pages, or (on a
 machine with highmem) the number of lowmem RAM pages, whichever is smaller.
+The limit is removed if the number is
+.BR 0 .
 .IP
 Inodes may be specified with
 .BR k ,
-- 
2.39.2

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

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

* Re: [PATCH] tmpfs.5: document size/blocks=0 and nr_inodes=0 <=> unlimited
  2023-08-12 19:04   ` Jakub Wilk
  2023-08-12 20:03     ` [PATCH v2] " наб
@ 2023-08-12 20:48     ` Alejandro Colomar
  1 sibling, 0 replies; 6+ messages in thread
From: Alejandro Colomar @ 2023-08-12 20:48 UTC (permalink / raw)
  To: Jakub Wilk; +Cc: наб, linux-man


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

On 2023-08-12 21:04, Jakub Wilk wrote:
> * Alejandro Colomar <colomar.6.4.3@gmail.com>, 2023-08-12 20:08:
>>> Bitten by this again. Behaviour blames back to at least 2005 (so 
>>> probably original to shmem.c), documented upstream in tmpfs.txt.
> 
> (I've been bitten by this too!)
> 
>> This is a bit unclear to me.  I guess you refer to the Linux kernel as 
>> "upstream", but the Linux kernel repository doesn't have a tmpfs.txt 
>> file.  I recall that they moved their .txt docs to .rst, so would you 
>> please share the full link to the .txt file that you refer?  That way 
>> you can ask git(1) to show the history of that file even if it doesn't 
>> exist now.
> 
> You can ask git for history of tmpfs.txt even if you don't know the 
> exact location, although admittedly it's pretty slow:
> 
>     $ git log --oneline -1 '**/tmpfs.txt'
>     7e7cd458b810 docs: filesystems: convert tmpfs.txt to ReST
> 
>     $ git show --oneline --stat 7e7cd458b810
>     7e7cd458b810 docs: filesystems: convert tmpfs.txt to ReST
>      Documentation/filesystems/index.rst                |  1 +
>      Documentation/filesystems/{tmpfs.txt => tmpfs.rst} | 44 +++++++++++++++++++++++++++++---------------
>      2 files changed, 30 insertions(+), 15 deletions(-)

Interesting.  Thanks!

> 

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

* Re: [PATCH v2] tmpfs.5: document size/blocks=0 and nr_inodes=0 <=> unlimited
  2023-08-12 20:03     ` [PATCH v2] " наб
@ 2023-08-12 20:49       ` Alejandro Colomar
  0 siblings, 0 replies; 6+ messages in thread
From: Alejandro Colomar @ 2023-08-12 20:49 UTC (permalink / raw)
  To: наб; +Cc: linux-man, Jakub Wilk


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

Hi,

On 2023-08-12 22:03, наб wrote:
> Bitten by this again. Behaviour blames back to at least 2005
> (probably original to shmem.c), documented upstream in
> Documentation/filesystems/tmpfs.rst (formerly .txt).
> 
> For example:
>   # mount -t tmpfs -o size=0 tmpfs /etc/
>   # df /etc/
>   Filesystem 1k-blocks Used Avail Use% Mounted on
>   tmpfs              0    0     0    - /etc
>   # head -c100M  < /dev/urandom > /etc/passwd
>   # df /etc/
>   Filesystem 1k-blocks Used Avail Use% Mounted on
>   tmpfs              0    0     0    - /etc
>   # ls -l /etc/passwd
>   -rw-r--r-- 1 0 0 104857600 08-12 19:55 /etc/passwd
>   # du /etc/passwd
>   204800  /etc/passwd
> whereas the current manual insinuates head should ENOSPC instantly.
> 
> Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>

Patch applied.  Thanks,

Alex

> ---
>  man5/tmpfs.5 | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/man5/tmpfs.5 b/man5/tmpfs.5
> index cdd5f2fd8..5274e632d 100644
> --- a/man5/tmpfs.5
> +++ b/man5/tmpfs.5
> @@ -51,6 +51,8 @@ .SS Mount options
>  .BR size "=\fIbytes\fP"
>  Specify an upper limit on the size of the filesystem.
>  The size is given in bytes, and rounded up to entire pages.
> +The limit is removed if the size is
> +.BR 0 .
>  .IP
>  The size may have a
>  .BR k ,
> @@ -89,6 +91,8 @@ .SS Mount options
>  The maximum number of inodes for this instance.
>  The default is half of the number of your physical RAM pages, or (on a
>  machine with highmem) the number of lowmem RAM pages, whichever is smaller.
> +The limit is removed if the number is
> +.BR 0 .
>  .IP
>  Inodes may be specified with
>  .BR k ,

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

end of thread, other threads:[~2023-08-12 20:49 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-08-11 13:41 [PATCH] tmpfs.5: document size/blocks=0 and nr_inodes=0 <=> unlimited наб
2023-08-12 18:08 ` Alejandro Colomar
2023-08-12 19:04   ` Jakub Wilk
2023-08-12 20:03     ` [PATCH v2] " наб
2023-08-12 20:49       ` Alejandro Colomar
2023-08-12 20:48     ` [PATCH] " Alejandro Colomar

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox