Add is_nfs_path() to check if a path may be in an NFS mount.
Review Request #15191 — Created July 23, 2026 and updated
There are certain operations that aren't considered safe on all NFS
paths. These often involve operations where file locking is required
or the oepration is sensitive to proper synchronization. In these cases,
it can be helpful or important to log some information to help
administrators if something were to act up. This is going to be true for
the local broker.This change introduces
reviewboard.admin.server.is_nfs_path()to help
perform this check. This takes a path and checks to see if there's a
known mount point that it may live in. This is a best-effort check and
is only capable of checking Linux's/proc/mounts. On other sytsems (or
if there is an issue accessing this), this will returnFalse.The result is cached in an LRU cache to avoid repeated lookups for the
same paths. In practice, this is going to be used only with very few
hard-coded paths (such as a local queue path or parts of the data
directory).
Unit tests pass.
| Summary | ID |
|---|---|
| c6c19e3ccdbf923505f2e84726524ba2edf9d3ea |
- Change Summary:
-
Removed an unused import.
- Commits:
-
Summary ID 6f88b8acaecdc9b6748077ebeafe9cc99afd6490 94b2234d58dcbbea33ed0b66c47b61eaf770d392
Checks run (2 succeeded)
- Change Summary:
-
- Made typing more specific.
- Made the NFS check a simple
nfsstring prefix check.
- Commits:
-
Summary ID 94b2234d58dcbbea33ed0b66c47b61eaf770d392 3c7ed930eda1ebc91aa35abaa16292c4c903f971