Linux Documentation
 help / color / mirror / Atom feed
* [PATCH] btrfs: add a maintainer entry profile
@ 2026-11-25  4:46 Qu Wenruo
  2026-11-26 13:37 ` Leon Romanovsky
  2026-11-26 15:51 ` David Sterba
  0 siblings, 2 replies; 4+ messages in thread
From: Qu Wenruo @ 2026-11-25  4:46 UTC (permalink / raw)
  To: linux-btrfs, workflows, linux-doc

This new file is mostly based on my personal preferences, focusing on
how to improve the human readability in the LLM era.

The new file should also act as a guide for humans that want to be a
long term contributor to btrfs.

Signed-off-by: Qu Wenruo <wqu@suse.com>
---
Changelog:
RFC->v1:
- Use maintainer entry profile instead of agent.md

- Further simplfy the content for human readers

---
 Documentation/process/maintainer-btrfs.rst | 154 +++++++++++++++++++++
 MAINTAINERS                                |   2 +
 2 files changed, 156 insertions(+)
 create mode 100644 Documentation/process/maintainer-btrfs.rst

diff --git a/Documentation/process/maintainer-btrfs.rst b/Documentation/process/maintainer-btrfs.rst
new file mode 100644
index 000000000000..5170dd73e655
--- /dev/null
+++ b/Documentation/process/maintainer-btrfs.rst
@@ -0,0 +1,154 @@
+.. SPDX-License-Identifier: GPL-2.0
+
+Btrfs patch guidelines
+======================
+
+Human readability comes first. A reviewer should be able to understand the
+problem and the fix from the message and code.
+
+Bloated LLM-generated information only wastes precious human time, no matter
+whether it is in a comment or a commit message.
+
+Code comments
+-------------
+
+* **Necessary comment only**
+
+  Comment is for things that are not obvious by itself, e.g. a locking
+  rule, an ordering requirement or a non-trivial reason for a workaround.
+
+  Keep the comment short if possible.
+
+  Don't repeat what the code does.
+
+* **Add kernel-doc only for complex and/or exported functions**
+
+  If the function and parameter names are self-explaining, don't waste words
+  on the kernel-doc.
+
+Commit messages and cover letters
+---------------------------------
+
+* **Keep it simple**
+
+  Use short and simple sentences, avoid long paragraphs.
+
+  Simple patch for simple bug. Don't write a full [BUG] [CAUSE] [FIX] analysis
+  for something like a simple error handling enhancement.
+
+  And we don't care how you or your LLM found the bug unless it's hit in the
+  real world, so don't put such information even after the "---" line.
+
+* **Prefer visual aids over long sentences**
+
+  See "Visual aids" section below.
+
+* **Follow the style of well-known btrfs developers**
+
+  Check ``git log -- fs/btrfs`` for recent examples before drafting.
+
+Visual aids
+-----------
+
+Prefer visual aids like an ASCII chart over words, e.g.:
+
+* A race. Show the race window, do not describe it in prose only.
+* An error handling bug in a function, seen from several call sites.
+* A call chain across layers, where the bug only shows on a certain path.
+
+Example, a race::
+
+   CPU0 (endio)                       CPU1 (fsync)
+   end_bbio_data_write()
+   |-btrfs_folio_clear_writeback()
+   |                                  btrfs_sync_file()
+   |                                  |-filemap_fdatawait_range()
+   |                                  | Returns after writeback finished
+   |                                  |
+   |                                  \-test_and_clear_bit(COW_WRITE_ERROR)
+   |                                    Still 0, skips waiting
+   \-set_bit(COW_WRITE_ERROR)
+     Too late.
+
+Example, an error handling bug, from commit c9583ada8cc4. The callee cleans up
+on error, then the caller cleans up again::
+
+   btrfs_do_readpage()
+   |-submit_extent_page()
+   | \-submit_one_bio()
+   |   \-btrfs_submit_data_bio()
+   |     \-bio_endio()
+   |       Calls end_page_read() and unlock_extent().
+   |
+   \-end_page_read() and unlock_extent()
+     Cleaned up again, the subpage reader count underflows.
+
+Versioned patches
+-----------------
+
+* **Full history**
+
+  Include all versions, not only the changes of the last version.
+
+* **Newest version first**
+
+  E.g.::
+
+    v3:
+    - Rename the helper to xxx()
+    - Add a missing lock in yyy()
+
+    v2:
+    - Fix the build failure on 32-bit
+
+* **Changelog location**
+
+  Put it in the cover letter for a patch series, or after the "---" line for
+  a single patch.
+
+  Don't put it in the commit message body.
+
+Review
+------
+
+* **Follow the review**
+
+  Don't send a patch and just forget it. If you're not a well known developer,
+  it's uncommon to get merged on the first try.
+
+  One will need to communicate with the reviewers to get at least one review
+  from a well known btrfs developer, before getting the patch merged.
+
+* **Check Sashiko**
+
+  Sashiko posts AI-generated review for patches sent to the mailing list. The
+  btrfs list is at https://sashiko.dev/#/?list=org.kernel.vger.linux-btrfs
+
+  If a report is valid, address it in a newer version.
+
+  If a report is obviously wrong, it can be ignored. If the report is wrong but
+  the reason is not obvious, explaining it on the mailing list can help.
+
+Testing
+-------
+
+* **Run full fstests**
+
+  That's the main test suite we use.
+
+* **Testing procedures and results are only for complex patches**
+
+  Simple fixes shouldn't need a long paragraph on how to verify the fix.
+  Those simple fixes should be explained well by the commit message and code.
+
+  Bloated LLM-generated test procedures and results only waste human time.
+
+Before sending a patch
+----------------------
+
+* **Check the development branch**
+
+* **Check the mailing list**
+
+If your bug was found by an LLM, someone else may have already found, or even
+fixed, it.
diff --git a/MAINTAINERS b/MAINTAINERS
index 44540a1eb2b8..55f0b3dca133 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -5838,9 +5838,11 @@ S:	Maintained
 W:	https://btrfs.readthedocs.io
 Q:	https://patchwork.kernel.org/project/linux-btrfs/list/
 C:	irc://irc.libera.chat/btrfs
+P:	Documentation/process/maintainer-btrfs.rst
 T:	git https://github.com/btrfs/linux.git for-next
 T:	git git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux.git for-next
 F:	Documentation/filesystems/btrfs.rst
+F:	Documentation/process/maintainer-btrfs.rst
 F:	fs/btrfs/
 F:	include/linux/btrfs*
 F:	include/trace/events/btrfs.h
-- 
2.56.1


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

end of thread, other threads:[~2026-11-26 20:16 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-25  4:46 [PATCH] btrfs: add a maintainer entry profile Qu Wenruo
2026-11-26 13:37 ` Leon Romanovsky
2026-11-26 15:51 ` David Sterba
2026-11-26 20:16   ` Qu Wenruo

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