[Rpm-maint] [rpm-software-management/rpm] Add statvfs(3) support to the Lua posix module (PR #4324)

coderabbitai[bot] notifications at github.com
Tue Sep 8 15:37:57 UTC 2026


@coderabbitai[bot] commented on this pull request.

**Actionable comments posted: 1**

---

<details>
<summary>ℹ️ Review info</summary>

<details>
<summary>⚙️ Run configuration</summary>

**Configuration used**: Repository UI

**Review profile**: CHILL

**Plan**: Advanced

**Run ID**: `5a3359c3-8dcd-44f1-8857-2e8875f2fcfa`

</details>

<details>
<summary>📥 Commits</summary>

Reviewing files that changed from the base of the PR and between 289a571770f876b48db08734c7129ad797d87367 and ab224f771f7d7741abef14dfff5b0800bc552dd6.

</details>

<details>
<summary>📒 Files selected for processing (3)</summary>

* `docs/man/rpm-lua.7.scd`
* `rpmio/lposix.cc`
* `tests/rpmmacro.at`

</details>

**Included review availability:** Your plan provides up to 4 included reviews per hour; 3 remain after this review.

</details>

<!-- This is an auto-generated comment by CodeRabbit for review status -->

> @@ -1341,6 +1341,19 @@ rpm.call("test", "foo", 6, 29 / 4)
 ])
 RPMTEST_CLEANUP
 
+RPMTEST_SETUP([lua statvfs])
+AT_KEYWORDS([macros lua])
+RPMTEST_CHECK([
+rpm --eval '%{lua:st=posix.statvfs("/"); print(st.bsize, st.flag.nosuid)}' \
+    --eval '%{lua:print(posix.statvfs("/", "namemax") == math.tointeger(posix.pathconf("/", "name_max")))}'
+],
+[0],
+[4096	false

_🎯 Functional Correctness_ | _🟡 Minor_ | _⚡ Quick win_

**Avoid hard-coded filesystem-specific values.**

`f_bsize` and `ST_NOSUID` depend on the filesystem mounted at `/`. A valid test environment can return a block size other than `4096` or set `nosuid` to `true`, which would fail this test even when `posix.statvfs()` is correct. Assert stable properties such as a positive block size and a boolean flag value instead.

<details>
<summary>Proposed portable assertion</summary>

```diff
-  --eval '%{lua:st=posix.statvfs("/"); print(st.bsize, st.flag.nosuid)}' \
+  --eval '%{lua:st=posix.statvfs("/"); print(st.bsize > 0, type(st.flag.nosuid) == "boolean")}' \
...
-[4096 false
+[true true
```
</details>

<!-- fingerprinting:phantom:poseidon:caracal -->

<!-- cr-indicator-types:potential_issue -->

<!-- cr-comment:v1:94c78d4c6763c29d2f9e3a0d -->

<!-- This is an auto-generated comment by CodeRabbit -->

-- 
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/pull/4324#pullrequestreview-5143812945
You are receiving this because you are subscribed to this thread.

Message ID: <rpm-software-management/rpm/pull/4324/review/5143812945 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rpm.org/pipermail/rpm-maint/attachments/20260908/020bba1d/attachment.htm>


More information about the Rpm-maint mailing list