Skip to contentSkip to conversation

statx.2: Update STATX_WRITE_ATOMIC filesystem support

PATCH Applied John Garry 4 participants 11 messages Dec 3, 2024 – Jan 4, 2025

Subsystems (2)
lore
Share & tools
lore

John Garry

author
#0 lore raw

PATCH 1/1 statx.2: Update STATX_WRITE_ATOMIC filesystem support

Linux v6.13 will include atomic write support for xfs and ext4, so update STATX_WRITE_ATOMIC commentary to mention that.

man/man2/statx.2 +9 -0
index c5b5a28ec..2d33998c5 100644
@@ -482,6 +482,15 @@ The minimum and maximum sizes (in bytes) supported for direct I/O
 .RB ( O_DIRECT )
 on the file to be written with torn-write protection.
 These values are each guaranteed to be a power-of-2.
+.IP
+.B STATX_WRITE_ATOMIC
+.RI ( stx_atomic_write_unit_min,
+.RI stx_atomic_write_unit_max,
+and
+.IR stx_atomic_write_segments_max )
+is supported on block devices since Linux 6.11.
+The support on regular files varies by filesystem;
+it is supported by xfs and ext4 since Linux 6.13.
 .TP
 .I stx_atomic_write_segments_max
 The maximum number of elements in an array of vectors
Signature · 1 line
2.31.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 12 lines · John Garry

Linux v6.13 will include atomic write support for xfs and ext4, so update STATX_WRITE_ATOMIC commentary to mention that.

man/man2/statx.2 +0 -0
index c5b5a28ec..2d33998c5 100644
@@ -482,6 +482,15 @@ The minimum and maximum sizes (in bytes) supported for direct I/O
 .RB ( O_DIRECT )
 on the file to be written with torn-write protection.

man/man2/statx.2 The minimum and maximum sizes (in bytes) supported for direct I/O · line 493

Quoted 10 lines
man/man2/statx.2 +9 -0
 These values are each guaranteed to be a power-of-2.
+.IP
+.B STATX_WRITE_ATOMIC
+.RI ( stx_atomic_write_unit_min,
+.RI stx_atomic_write_unit_max,
+and
+.IR stx_atomic_write_segments_max )
+is supported on block devices since Linux 6.11.
+The support on regular files varies by filesystem;
+it is supported by xfs and ext4 since Linux 6.13.

woot!

--D

Quoted 6 lines
man/man2/statx.2 +0 -0
 .TP
 .I stx_atomic_write_segments_max
 The maximum number of elements in an array of vectors
Signature · 1 line
2.31.1
#2 lore raw
In reply to John Garry

Hi John,

Quoted 1 line · John Garry

Linux v6.13 will

Is this already in Linus's tree?

Quoted 4 lines

include atomic write support for xfs and ext4, so update STATX_WRITE_ATOMIC commentary to mention that.

Thanks for the patch! Please see some small comment below.

Have a lovely night!
Alex

man/man2/statx.2 The minimum and maximum sizes (in bytes) supported for direct I/O · line 488

Quoted 13 lines
man/man2/statx.2 +4 -0
index c5b5a28ec..2d33998c5 100644
@@ -482,6 +482,15 @@ The minimum and maximum sizes (in bytes) supported for direct I/O
 .RB ( O_DIRECT )
 on the file to be written with torn-write protection.
 These values are each guaranteed to be a power-of-2.
+.IP
+.B STATX_WRITE_ATOMIC
+.RI ( stx_atomic_write_unit_min,
+.RI stx_atomic_write_unit_max,

There should be a space before the ','.

Quoted 11 lines
man/man2/statx.2 +5 -0
+and
+.IR stx_atomic_write_segments_max )
+is supported on block devices since Linux 6.11.
+The support on regular files varies by filesystem;
+it is supported by xfs and ext4 since Linux 6.13.
 .TP
 .I stx_atomic_write_segments_max
 The maximum number of elements in an array of vectors
Signature · 1 line
2.31.1
Signature · 1 line
<https://www.alejandro-colomar.es/>
author
#3 lore raw
Quoted 6 lines · Alejandro Colomar

Hi John,

Quoted 1 line · John Garry

Linux v6.13 will

Is this already in Linus's tree?

The code to support xfs and ext4 is in Linus' tree from v6.13-rc1, but v6.13 final is not released yet.

So maybe you want to hold off on this patch until v6.13 final is released.

Quoted 12 lines
Quoted 5 lines

include atomic write support for xfs and ext4, so update STATX_WRITE_ATOMIC commentary to mention that.

Thanks for the patch! Please see some small comment below.

Have a lovely night!
Alex

Quoted 1 line
Quoted 17 lines

man/man2/statx.2 The minimum and maximum sizes (in bytes) supported for direct I/O · line 488

Quoted 12 lines
man/man2/statx.2 +4 -0
index c5b5a28ec..2d33998c5 100644
@@ -482,6 +482,15 @@ The minimum and maximum sizes (in bytes) supported for direct I/O
  .RB ( O_DIRECT )
  on the file to be written with torn-write protection.
  These values are each guaranteed to be a power-of-2.
+.IP
+.B STATX_WRITE_ATOMIC
+.RI ( stx_atomic_write_unit_min,
+.RI stx_atomic_write_unit_max,

There should be a space before the ','.

Quoted 2 lines
man/man2/statx.2 +2 -0
+and
+.IR stx_atomic_write_segments_max )

How about this:

.B STATX_WRITE_ATOMIC
.RI ( stx_atomic_write_unit_min,
.I stx_atomic_write_unit_max,
and
.IR stx_atomic_write_segments_max )

I think that this looks right.

Thanks,
John

#4 lore raw

Hi John,

Quoted 4 lines · John Garry
Quoted 3 lines · Alejandro Colomar

Hi John,

On Tue, Dec 03, 2024 at 02:53:59PM +0000, John Garry wrote:

Quoted 8 lines
Quoted 3 lines
Quoted 1 line

Linux v6.13 will

Is this already in Linus's tree?

The code to support xfs and ext4 is in Linus' tree from v6.13-rc1, but v6.13 final is not released yet.

So maybe you want to hold off on this patch until v6.13 final is released.

Nah, we can apply it already. Just let me know if anything changes before the release.

Quoted 20 lines
Quoted 6 lines
Quoted 6 lines
man/man2/statx.2 +0 -0
index c5b5a28ec..2d33998c5 100644
@@ -482,6 +482,15 @@ The minimum and maximum sizes (in bytes) supported for direct I/O
  .RB ( O_DIRECT )
Quoted 11 lines

man/man2/statx.2 The minimum and maximum sizes (in bytes) supported for direct I/O · line 488

Quoted 6 lines
man/man2/statx.2 +4 -0
  on the file to be written with torn-write protection.
  These values are each guaranteed to be a power-of-2.
+.IP
+.B STATX_WRITE_ATOMIC
+.RI ( stx_atomic_write_unit_min,
+.RI stx_atomic_write_unit_max,

There should be a space before the ','.

Quoted 2 lines
man/man2/statx.2 +2 -0
+and
+.IR stx_atomic_write_segments_max )

How about this:

Quoted 7 lines

.B STATX_WRITE_ATOMIC
.RI ( stx_atomic_write_unit_min,
.I stx_atomic_write_unit_max,
and
.IR stx_atomic_write_segments_max )

I think that this looks right.

No; the comma shouldn't be in italics.

.B STATX_WRITE_ATOMIC
.RI ( stx_atomic_write_unit_min ,
.IR stx_atomic_write_unit_max ,
and
.IR stx_atomic_write_segments_max )

Cheers,
Alex

Signature · 1 line
<https://www.alejandro-colomar.es/>
#5 lore raw

[trimming the linux-fsdevel list from CC, reasoning that it cares little about typography]

Hi Alex,

Quoted 7 lines · Alejandro Colomar

No; the comma shouldn't be in italics.

.B STATX_WRITE_ATOMIC
.RI ( stx_atomic_write_unit_min ,
.IR stx_atomic_write_unit_max ,
and
.IR stx_atomic_write_segments_max )

Style authorities differ on this point.[1] At least three factors are in tension:

1. In traditional typography, one does in fact set the comma in italics like the preceding word. To some eyes, including mine, that looks better.

2. It is true that the comma is not part of the named parameter, so under rules analogous to those that govern quotation marks in the U.K., for instance, one would _not_ put the comma in italics.

3. It doesn't matter all that much because unlike with literals, like STATX_WRITE_ATOMIC, precise copy-and-pasting doesn't buy you much. A formal argument name frequently _lacks_ a corresponding symbol of the same name in source code. Users of memmem(3) need not name their parameters "needle" or "haystack". So almost no one needs to precisely aim their pointer between the final letter of the parameter name and the trailing punctuation.

Given these factors, if you have a strong preference here, I think you should document it in man-pages(7).

Regards,
Branden

[1] https://iconlogic.blogs.com/weblog/2011/04/writing-grammar-do-i-italicize-the-comma-after-an-italic-word.html

https://english.stackexchange.com/questions/9878/should-punctuation-surrounding-italicised-words-be-italicised

(The foregoing quotes the [in]famous Chicago Manual of Style, which I generally like except for the malicious lies about historical inter-sentence spacing practices promulgated by its editor, the dreadful Russell Harper.[2])

https://style.mla.org/comma-after-italicized-element/

[2] https://web.archive.org/web/20171217060354/http://www.heracliteanriver.com/?p=324

#6 lore raw

Hi Branden,

Quoted 14 lines · G. Branden Robinson

[trimming the linux-fsdevel list from CC, reasoning that it cares little about typography]

Hi Alex,

Quoted 7 lines · Alejandro Colomar

No; the comma shouldn't be in italics.

.B STATX_WRITE_ATOMIC
.RI ( stx_atomic_write_unit_min ,
.IR stx_atomic_write_unit_max ,
and
.IR stx_atomic_write_segments_max )

Quoted 6 lines

Style authorities differ on this point.[1] At least three factors are in tension:

1. In traditional typography, one does in fact set the comma in italics like the preceding word. To some eyes, including mine, that looks better.

I think this is in concordance with the other meh thing US typographers
do: put punctuation within quotes, misattributing them to the quotee. I don't like that.

Quoted 4 lines

2. It is true that the comma is not part of the named parameter, so under rules analogous to those that govern quotation marks in the U.K., for instance, one would _not_ put the comma in italics.

Indeed. Similar rules apply in Spain, AFAIR.

And this isn't documented in man-pages(7) either. We probaby should.

Quoted 7 lines

3. It doesn't matter all that much because unlike with literals, like STATX_WRITE_ATOMIC, precise copy-and-pasting doesn't buy you much. A formal argument name frequently _lacks_ a corresponding symbol of the same name in source code. Users of memmem(3) need not name their parameters "needle" or "haystack". So almost no one needs to precisely aim their pointer between the final letter of the parameter name and the trailing punctuation.

In PDF output it doesn't matter much, but underscoring a comma (which will happen in terminals) is quite more egregious than just a minor oddity when the last letter overlaps the punctuation slightly in the PDF. So, I'd say it matters in our case.

Quoted 3 lines

Given these factors, if you have a strong preference here, I think you should document it in man-pages(7).

I do.

Quoted 6 lines

Regards,
Branden

[1] https://iconlogic.blogs.com/weblog/2011/04/writing-grammar-do-i-italicize-the-comma-after-an-italic-word.html

Quoted 8 lines

https://english.stackexchange.com/questions/9878/should-punctuation-surrounding-italicised-words-be-italicised

(The foregoing quotes the [in]famous Chicago Manual of Style, which I generally like except for the malicious lies about historical inter-sentence spacing practices promulgated by its editor, the dreadful Russell Harper.[2])

https://style.mla.org/comma-after-italicized-element/

I like the advice in that link. :)

Quoted 2 lines

[2] https://web.archive.org/web/20171217060354/http://www.heracliteanriver.com/?p=324

Thanks for the link! I applied this commit now:
<https://www.alejandro-colomar.es/src/alx/linux/man-pages/man-pages.git/commit/?h=contrib&id=bcf7d00fa4c7ce270f07d6e347c01b1f1e37580f>

Have a lovely day!
Alex

Signature · 1 line
<https://www.alejandro-colomar.es/>
author
#7 lore raw
In reply to Alejandro Colomar
Quoted 11 lines · Alejandro Colomar

Hi John,

Quoted 8 lines · John Garry
Quoted 6 lines · Alejandro Colomar

Hi John,

Quoted 1 line · John Garry

Linux v6.13 will

Is this already in Linus's tree?

Quoted 7 lines
Quoted 4 lines

The code to support xfs and ext4 is in Linus' tree from v6.13-rc1, but v6.13 final is not released yet.

So maybe you want to hold off on this patch until v6.13 final is released.

Nah, we can apply it already. Just let me know if anything changes before the release.

Hi Alex,

I'd suggest that it is ok to merge this now, but Branden seems to have comments...

Quoted 27 lines
Quoted 27 lines
Quoted 18 lines

man/man2/statx.2 The minimum and maximum sizes (in bytes) supported for direct I/O · line 488

Quoted 13 lines
man/man2/statx.2 +4 -0
index c5b5a28ec..2d33998c5 100644
@@ -482,6 +482,15 @@ The minimum and maximum sizes (in bytes) supported for direct I/O
   .RB ( O_DIRECT )
   on the file to be written with torn-write protection.
   These values are each guaranteed to be a power-of-2.
+.IP
+.B STATX_WRITE_ATOMIC
+.RI ( stx_atomic_write_unit_min,
+.RI stx_atomic_write_unit_max,

There should be a space before the ','.

Quoted 2 lines
man/man2/statx.2 +2 -0
+and
+.IR stx_atomic_write_segments_max )

How about this:

.B STATX_WRITE_ATOMIC
.RI ( stx_atomic_write_unit_min,
.I stx_atomic_write_unit_max,
and
.IR stx_atomic_write_segments_max )

Quoted 3 lines
Quoted 1 line

I think that this looks right.

No; the comma shouldn't be in italics.

Please fix up as you see fit.

Quoted 7 lines

.B STATX_WRITE_ATOMIC
.RI ( stx_atomic_write_unit_min ,
.IR stx_atomic_write_unit_max ,
and
.IR stx_atomic_write_segments_max )

Thanks,
John

#8 lore raw

Hi John,

Quoted 7 lines · John Garry
Quoted 3 lines · Alejandro Colomar

On Thu, Dec 05, 2024 at 09:33:18AM +0000, John Garry wrote:
Nah, we can apply it already. Just let me know if anything changes before the release.

I'd suggest that it is ok to merge this now, but Branden seems to have comments...

I don't generally intend my review comments to be gating, and this is no exception. (I should try harder to state that explicitly more often.) Please don't delay on my account. :)

Regards,
Branden

#9 lore raw

Hi Branden, John,

Quoted 8 lines · G. Branden Robinson

Hi John,

Quoted 5 lines · John Garry
Quoted 3 lines · Alejandro Colomar

On Thu, Dec 05, 2024 at 09:33:18AM +0000, John Garry wrote:
Nah, we can apply it already. Just let me know if anything changes before the release.

Quoted 5 lines
Quoted 2 lines

I'd suggest that it is ok to merge this now, but Branden seems to have comments...

I don't generally intend my review comments to be gating, and this is no exception. (I should try harder to state that explicitly more often.)

Nah, I just forgot about this patch. Thanks for the ping; I'll apply it later today (if I don't forget again). :)

Cheers,
Alex

Quoted 4 lines

Please don't delay on my account. :)

Regards,
Branden

Signature · 1 line
<https://www.alejandro-colomar.es/>
maintainer Applied
#10 lore raw

Hi John,

Quoted 11 lines · Alejandro Colomar

Hi Branden, John,

Quoted 8 lines · G. Branden Robinson

Hi John,

Quoted 5 lines · John Garry
Quoted 3 lines · Alejandro Colomar

On Thu, Dec 05, 2024 at 09:33:18AM +0000, John Garry wrote:
Nah, we can apply it already. Just let me know if anything changes before the release.

Quoted 8 lines
Quoted 5 lines
Quoted 2 lines

I'd suggest that it is ok to merge this now, but Branden seems to have comments...

I don't generally intend my review comments to be gating, and this is no exception. (I should try harder to state that explicitly more often.)

Nah, I just forgot about this patch. Thanks for the ping; I'll apply it later today (if I don't forget again). :)

I did forget again. :)

I have applied the patch now. Thanks!
<https://www.alejandro-colomar.es/src/alx/linux/man-pages/man-pages.git/commit/?h=contrib&id=e2d3dadf562ac07d086a9732993cb79898bc6b17>

Cheers,
Alex

Quoted 13 lines

Cheers,
Alex

Quoted 4 lines

Please don't delay on my account. :)

Regards,
Branden

Signature · 1 line
<https://www.alejandro-colomar.es/>
Signature · 1 line
<https://www.alejandro-colomar.es/>