• 
      

    Add is_nfs_path() to check if a path may be in an NFS mount.

    Review Request #15191 — Created July 23, 2026 and updated

    Information

    Review Board
    release-9.x

    Reviewers

    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 return False.

    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
    Add is_nfs_path() to check if a path may be in an NFS mount.
    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 return `False`. 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).
    94b2234d58dcbbea33ed0b66c47b61eaf770d392
    Description From Last Updated

    're' imported but unused Column: 1 Error code: F401

    reviewbot reviewbot

    Should be typed as Final[Pattern[str]]

    david david

    This might be better named as _NFS_FS_TYPES?

    david david

    Have you actually seen "efs" in the wild? I would expect EFS to show up as "nfs4" (covered by the …

    david david
    Checks run (1 failed, 1 succeeded)
    flake8 failed.
    JSHint passed.

    flake8

    chipx86
    Review request changed
    Change Summary:

    Removed an unused import.

    Commits:
    Summary ID
    Add is_nfs_path() to check if a path may be in an NFS mount.
    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 return `False`. 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).
    6f88b8acaecdc9b6748077ebeafe9cc99afd6490
    Add is_nfs_path() to check if a path may be in an NFS mount.
    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 return `False`. 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).
    94b2234d58dcbbea33ed0b66c47b61eaf770d392

    Checks run (2 succeeded)

    flake8 passed.
    JSHint passed.
    david
    1. 
        
    2. reviewboard/admin/server.py (Diff revision 2)
       
       
      Show all issues

      Should be typed as Final[Pattern[str]]

    3. reviewboard/admin/server.py (Diff revision 2)
       
       
      Show all issues

      This might be better named as _NFS_FS_TYPES?

    4. reviewboard/admin/server.py (Diff revision 2)
       
       
      Show all issues

      Have you actually seen "efs" in the wild? I would expect EFS to show up as "nfs4" (covered by the "nfs" prefix check already).

      1. We use it on our servers, but it does end up translating to nfs4. It's efs in /etc/fstab (requires its own drivers), but translates to nfs4 in /proc/mounts. But I wouldn't have expected that?

      2. That matches what I was seeing.

    5.