Page MenuHomeFreeBSD

rmacklem (Rick Macklem)
User

Projects

User Details

User Since
Jan 13 2015, 10:58 PM (600 w, 6 d)

Recent Activity

Today

rmacklem committed rG94b21dade677: nfsd: Optionally enable use of M_EXTPG mbufs for read replies (authored by rmacklem).
nfsd: Optionally enable use of M_EXTPG mbufs for read replies
Tue, Jul 21, 1:28 AM

Yesterday

rmacklem committed rG55b9f788d348: acl_from_text.c: Allow negative uid/gid numbers to be handled (authored by pen_lysator.liu.se).
acl_from_text.c: Allow negative uid/gid numbers to be handled
Mon, Jul 20, 1:49 AM

Sat, Jul 18

rmacklem committed rGa51fdce1b28a: nfs_clstate.c: Fix handling of delegation upgrades (authored by rmacklem).
nfs_clstate.c: Fix handling of delegation upgrades
Sat, Jul 18, 1:39 AM
rmacklem committed rG299bbb762db7: nfs_clstate.c: Fix handling of delegation upgrades (authored by rmacklem).
nfs_clstate.c: Fix handling of delegation upgrades
Sat, Jul 18, 1:17 AM

Mon, Jul 13

rmacklem added a reverting change for rG74654ba3b1b3: chflags: Add a new UF_DONTCACHE flag: rG88711f144170: Revert "chflags: Add a new UF_DONTCACHE flag".
Mon, Jul 13, 3:02 AM
rmacklem committed rG88711f144170: Revert "chflags: Add a new UF_DONTCACHE flag" (authored by rmacklem).
Revert "chflags: Add a new UF_DONTCACHE flag"
Mon, Jul 13, 3:02 AM
rmacklem added a reverting change for D58181: chflags: Add a new UF_DONTCACHE flag: rG88711f144170: Revert "chflags: Add a new UF_DONTCACHE flag".
Mon, Jul 13, 3:02 AM
rmacklem added a comment to D58181: chflags: Add a new UF_DONTCACHE flag.
In D58181#1334837, @fuz wrote:

This would have been nicer if the flag was named "noucache" with inverse
semantics as with nodump. (so "ucache" to turn it off)
nodontcache is a weird double negation.

Maybe this can still be revised?

Mon, Jul 13, 1:07 AM

Sun, Jul 12

rmacklem committed rG4830670a3f94: chflags.1: Document the new UF_DONTCACHE flag (authored by rmacklem).
chflags.1: Document the new UF_DONTCACHE flag
Sun, Jul 12, 10:59 PM
rmacklem committed rG74654ba3b1b3: chflags: Add a new UF_DONTCACHE flag (authored by rmacklem).
chflags: Add a new UF_DONTCACHE flag
Sun, Jul 12, 10:47 PM
rmacklem closed D58181: chflags: Add a new UF_DONTCACHE flag.
Sun, Jul 12, 10:47 PM
rmacklem requested review of D58181: chflags: Add a new UF_DONTCACHE flag.
Sun, Jul 12, 1:13 AM

Sat, Jul 11

rmacklem committed rG30d4d3db431a: nfsd: Commit missing patches for c52bcd09c2a6 (authored by rmacklem).
nfsd: Commit missing patches for c52bcd09c2a6
Sat, Jul 11, 7:34 PM
rmacklem committed rGc52bcd09c2a6: nfsd: Garbage collect stray NFSv4 state (authored by rmacklem).
nfsd: Garbage collect stray NFSv4 state
Sat, Jul 11, 3:52 PM
rmacklem committed rGf28c41843a65: nfs_clstate.c: Fix CB_RECALL handling for NFSv4.1/4.2 (authored by rmacklem).
nfs_clstate.c: Fix CB_RECALL handling for NFSv4.1/4.2
Sat, Jul 11, 1:07 AM
rmacklem committed rGd2b2fac918a4: nfs_clstate.c: Fix CB_RECALL handling for NFSv4.1/4.2 (authored by rmacklem).
nfs_clstate.c: Fix CB_RECALL handling for NFSv4.1/4.2
Sat, Jul 11, 1:03 AM

Tue, Jul 7

rmacklem committed rGd516e52373e1: nfsd: Optionally enable use of M_EXTPG mbufs for read replies (authored by rmacklem).
nfsd: Optionally enable use of M_EXTPG mbufs for read replies
Tue, Jul 7, 12:12 AM

Mon, Jul 6

rmacklem committed rGd7d71341ae7d: acl_from_text.c: Allow negative uid/gid numbers to be handled (authored by pen_lysator.liu.se).
acl_from_text.c: Allow negative uid/gid numbers to be handled
Mon, Jul 6, 7:36 PM
rmacklem closed D57180: Allow setfacl / acl_from_text() to handle negative uid / gid numbers in user/group ACL entries.
Mon, Jul 6, 7:36 PM
rmacklem accepted D58053: vfs: Fix resource leaks in kern_symlinkat().
Mon, Jul 6, 3:19 PM

Sun, Jul 5

rmacklem committed rG0c48190463a5: gss_impl.c: Fix a nfsd hang when the kgssapi.ko is loaded, but no gssd (authored by rmacklem).
gss_impl.c: Fix a nfsd hang when the kgssapi.ko is loaded, but no gssd
Sun, Jul 5, 11:05 PM

Sat, Jul 4

rmacklem committed rGfe6677e7f440: nfs_clstate.c: Fix handling of delegation upgrades (authored by rmacklem).
nfs_clstate.c: Fix handling of delegation upgrades
Sat, Jul 4, 10:02 PM

Thu, Jul 2

rmacklem committed rG0b9f4c6b0a03: nfs_nfsdserv.c: Fix setting of birthtime for some ZFS pools (authored by rmacklem).
nfs_nfsdserv.c: Fix setting of birthtime for some ZFS pools
Thu, Jul 2, 1:21 AM
rmacklem committed rG76badd25811e: nfs_nfsdserv.c: Fix setting of birthtime for some ZFS pools (authored by rmacklem).
nfs_nfsdserv.c: Fix setting of birthtime for some ZFS pools
Thu, Jul 2, 1:16 AM

Wed, Jul 1

rmacklem accepted D57982: ffs: do not return ESTALE on attempt to ffs_unotovp() on unlinked inode.

In the NFS game there are two things...

  • The RFCs. They don't define exactly when an NFS server should return ESTALE, so I don't think either the current behaviour or the behaviour with this patch is incorrect.
  • Linux. It has become the "defacto standard" for NFS. (Solaris once was the "defacto standard" but??)

So, if this patch results in behaviour consistent with
Linux, I think it is reasonable to do.

Wed, Jul 1, 2:41 AM

Sat, Jun 27

rmacklem committed rG9e1bbfb88e98: nfs_clstate.c: Fix CB_RECALL handling for NFSv4.1/4.2 (authored by rmacklem).
nfs_clstate.c: Fix CB_RECALL handling for NFSv4.1/4.2
Sat, Jun 27, 11:37 PM

Fri, Jun 26

rmacklem committed rGae9f66486df6: nfs_commonkrpc.c: Improve handling of NFSv4.1/4.2 recovery (authored by rmacklem).
nfs_commonkrpc.c: Improve handling of NFSv4.1/4.2 recovery
Fri, Jun 26, 1:41 AM
rmacklem committed rGafc113696ff6: nfs_commonkrpc.c: Improve handling of NFSv4.1/4.2 recovery (authored by rmacklem).
nfs_commonkrpc.c: Improve handling of NFSv4.1/4.2 recovery
Fri, Jun 26, 1:37 AM
rmacklem committed rG28ae0d849118: nfs: Fix argument typo to avoid a crash (authored by rmacklem).
nfs: Fix argument typo to avoid a crash
Fri, Jun 26, 1:36 AM
rmacklem committed rG84043284ad1f: nfs: Fix argument typo to avoid a crash (authored by rmacklem).
nfs: Fix argument typo to avoid a crash
Fri, Jun 26, 1:31 AM
rmacklem committed rGfe7426b2c9f7: nfs_nfsdport.c: Fix a typo in a KASSERT (authored by rmacklem).
nfs_nfsdport.c: Fix a typo in a KASSERT
Fri, Jun 26, 12:57 AM

Thu, Jun 25

rmacklem committed rG3a3d12112483: nfs_clvnops.c: Fix the case where va_flags are being cleared (authored by rmacklem).
nfs_clvnops.c: Fix the case where va_flags are being cleared
Thu, Jun 25, 12:50 AM

Tue, Jun 23

rmacklem committed rGcf523f4beb8f: nfscl: Add support for flexible file layout striping (authored by rmacklem).
nfscl: Add support for flexible file layout striping
Tue, Jun 23, 1:23 AM

Sun, Jun 21

rmacklem committed rG455c354dd4db: gss_impl.c: Fix a nfsd hang when the kgssapi.ko is loaded, but no gssd (authored by rmacklem).
gss_impl.c: Fix a nfsd hang when the kgssapi.ko is loaded, but no gssd
Sun, Jun 21, 11:17 PM
rmacklem closed D57455: gss_impl.c: Fix a nfsd hang when kgssapi.ko is loaded, but gssd not running.
Sun, Jun 21, 11:17 PM

Jun 21 2026

rmacklem added a comment to D57455: gss_impl.c: Fix a nfsd hang when kgssapi.ko is loaded, but gssd not running.

I also updated the comment in kgss_load().

Jun 21 2026, 3:46 PM
rmacklem committed rGc57fab60daeb: nfs_nfsdstate.c: Another unnecessary initialization for gcc (authored by rmacklem).
nfs_nfsdstate.c: Another unnecessary initialization for gcc
Jun 21 2026, 2:45 PM
rmacklem committed rGfa515f60fce0: nfs_nfsdport.c: One more unnecessary initialization for gcc (authored by rmacklem).
nfs_nfsdport.c: One more unnecessary initialization for gcc
Jun 21 2026, 2:55 AM
rmacklem committed rG61152df00aee: nfs_nfsdport.c: Do unnecessary initializations to quiet gcc (authored by rmacklem).
nfs_nfsdport.c: Do unnecessary initializations to quiet gcc
Jun 21 2026, 12:09 AM

Jun 20 2026

rmacklem committed rGd8e8f9251975: pNFSd: Add a directory of newly created files for the pNFSd (authored by rmacklem).
pNFSd: Add a directory of newly created files for the pNFSd
Jun 20 2026, 6:46 PM
rmacklem closed D57554: pNFSd: Add a directory of newly created files for the pNFSd.
Jun 20 2026, 6:46 PM
rmacklem added inline comments to D57681: vfs: rename vop_mmapped() to vop_update_atime().
Jun 20 2026, 12:21 AM

Jun 19 2026

rmacklem accepted D57681: vfs: rename vop_mmapped() to vop_update_atime().
Jun 19 2026, 10:50 PM
rmacklem added a comment to D57681: vfs: rename vop_mmapped() to vop_update_atime().
In D57681#1322466, @kib wrote:

This looks ok to me, although I'll admit I am not
conversant with UFS semantics, so I'll leave that
to others.

All existing callers pass tsa == NULL, so the intent is that the semantic does not change.
It is the question whether your case is served when tsa != NULL is provided.

I guess it does. I don't know UFS, but it does seem "inefficient" to first do
UFS_INODE_SET_FLAG_SHARED(), which locks/unlocks the vnode interlock and
then call ufs_itimes(), which locks the vnode interlock again and calls ufs_itimes_locked().

Jun 19 2026, 9:37 PM
rmacklem accepted D57681: vfs: rename vop_mmapped() to vop_update_atime().

This looks ok to me, although I'll admit I am not
conversant with UFS semantics, so I'll leave that
to others.

Jun 19 2026, 8:53 PM
rmacklem added a comment to D57681: vfs: rename vop_mmapped() to vop_update_atime().
In D57681#1322365, @kib wrote:

What is not clear to me, should ufs_itimes() only use the passed timespec for atime update, or it shall be used for all times as I did in the initial version of the patch.
Perhaps this is the question to Rick, since I believe the only caller with tsa != NULL would be nfs server.

Jun 19 2026, 8:10 PM

Jun 18 2026

rmacklem added inline comments to D57554: pNFSd: Add a directory of newly created files for the pNFSd.
Jun 18 2026, 9:43 PM
rmacklem updated the diff for D57554: pNFSd: Add a directory of newly created files for the pNFSd.

Made changes as suggested by kib@.

Jun 18 2026, 9:35 PM
rmacklem committed rGb1af05406b51: nfs_nfsdserv.c: Fix setting of birthtime for some ZFS pools (authored by rmacklem).
nfs_nfsdserv.c: Fix setting of birthtime for some ZFS pools
Jun 18 2026, 3:47 PM
rmacklem committed rG572680712c31: nfs_clvnops.c: Fix the case where va_flags are being cleared (authored by rmacklem).
nfs_clvnops.c: Fix the case where va_flags are being cleared
Jun 18 2026, 12:38 AM

Jun 17 2026

rmacklem added inline comments to D57554: pNFSd: Add a directory of newly created files for the pNFSd.
Jun 17 2026, 4:12 PM
rmacklem updated the diff for D57554: pNFSd: Add a directory of newly created files for the pNFSd.

Changed return value to EBUSY when the nfsd
are running and got rid of the locking around
reading the list head, as suggested by markj@.

Jun 17 2026, 4:07 PM

Jun 16 2026

rmacklem added a reverting change for rG7a289fe3cd5c: rpc.tlsservd.c: Pin max threads at 1 for now: rG62e7ac83ae14: Revert "rpc.tlsservd.c: Pin max threads at 1 for now".
Jun 16 2026, 4:18 PM
rmacklem committed rG62e7ac83ae14: Revert "rpc.tlsservd.c: Pin max threads at 1 for now" (authored by rmacklem).
Revert "rpc.tlsservd.c: Pin max threads at 1 for now"
Jun 16 2026, 4:18 PM
rmacklem committed rG2e6615b26bb5: netexport: Move struct netexport in a .h file and refcnt it (authored by rmacklem).
netexport: Move struct netexport in a .h file and refcnt it
Jun 16 2026, 3:38 PM
rmacklem closed D57553: netexport: Move struct netexport into a .h file and refcnt it.
Jun 16 2026, 3:37 PM
rmacklem added inline comments to D57553: netexport: Move struct netexport into a .h file and refcnt it.
Jun 16 2026, 12:34 AM
rmacklem updated the diff for D57553: netexport: Move struct netexport into a .h file and refcnt it.

Add vfs_netexport_reset() as suggested by markj@.
Also, add KASSERT()s to check ne_ref > 0.

Jun 16 2026, 12:32 AM

Jun 15 2026

rmacklem added a comment to D57555: rpcsec_tls: Avoid a socket reference underflow in rpctls_server().

Mark, again thanks a lot for fixing my bug that I was too slow (extremely slow!) to fix. I feel shame for that. Rick, very sorry for delaying looking into the problem for two months.

Jun 15 2026, 3:12 PM
rmacklem added a comment to D57554: pNFSd: Add a directory of newly created files for the pNFSd.
In D57554#1320166, @kib wrote:

Do you need a kernel thread and code to create the placeholder files? Could it be done in userspace?

Jun 15 2026, 1:21 PM

Jun 14 2026

rmacklem updated the diff for D57554: pNFSd: Add a directory of newly created files for the pNFSd.

Updated with changes recommended by markj@
and kib@. Mostly removal of unnecessary locking
calls, plus a couple of important typo fixes.

Jun 14 2026, 10:36 PM
rmacklem updated the diff for D57553: netexport: Move struct netexport into a .h file and refcnt it.

Added vfs_netexport_acquire() as suggested by markj@
and renamed vfs_netexport_free() to vfs_netexport_release(),
since that seemed more consistent.

Jun 14 2026, 10:30 PM
rmacklem added inline comments to D57554: pNFSd: Add a directory of newly created files for the pNFSd.
Jun 14 2026, 8:35 PM
rmacklem accepted D57555: rpcsec_tls: Avoid a socket reference underflow in rpctls_server().

This looks fine to me and seemed to behave when I
tested with lotsa printf()s.

Jun 14 2026, 8:23 PM
rmacklem added a comment to D57555: rpcsec_tls: Avoid a socket reference underflow in rpctls_server().

Ok, so I finally think I remember how this works;-)
Your patch tests out well, but I think it needs something like the following:

  • sys/rpc/rpcsec_tls/rpctls_impl.c.yyy 2026-06-14 09:08:45.910463000 -0700

+++ sys/rpc/rpcsec_tls/rpctls_impl.c 2026-06-14 09:01:06.722976000 -0700
@@ -298,8 +298,18 @@ printf("rpctls_connect soref so=%p\n", so);

	stat = rpctlscd_connect_2(&arg, &res, rpctls_connect_handle);
	if (stat == RPC_SUCCESS)
		*reterr = res.reterr;
  • else

+ else {
+ struct ct_data *ct = (struct ct_data *)newclient->cl_private;
+
+printf("clnt at rpctls_rpc_failed so=%p\n", so);

		rpctls_rpc_failed(&ups, so);

+ /*
+ * Since rpctls_rpc_failed() will do a soclose() if the
+ * daemon is not running, set ct_tlsstate to avoid doing
+ * a close in clnt_vc_destroy().
+ */
+ ct->ct_tlsstate = RPCTLS_INHANDSHAKE;
+ }

Jun 14 2026, 4:19 PM
rmacklem added a comment to D57555: rpcsec_tls: Avoid a socket reference underflow in rpctls_server().

Ok, so now I see what you've done. You are now taking the
soref() when it is inserted in the RB tree instead of when it
is taken out.

I suspect the "else" case in rpctls_rpc_failed() needs a
sorele() along with the soshutdown(), to get rid of the
reference.

Now that I am testing it, this does not seem to be needed.
(You get to the "else" case if rpc.tlsservd is running on the
server and you use your little tls_trigger.c test against it.)

Jun 14 2026, 3:04 PM
rmacklem added a comment to D57554: pNFSd: Add a directory of newly created files for the pNFSd.

Once I've put it through some testing, I'll update the patch.

Jun 14 2026, 2:16 PM
rmacklem added a comment to D57555: rpcsec_tls: Avoid a socket reference underflow in rpctls_server().

Ok, so now I see what you've done. You are now taking the
soref() when it is inserted in the RB tree instead of when it
is taken out.

Jun 14 2026, 12:22 AM

Jun 13 2026

rmacklem updated the diff for D57553: netexport: Move struct netexport into a .h file and refcnt it.

Fix the memset() so that it only zeros out
part of the structure, as spotted by markj@.

Jun 13 2026, 11:44 PM
rmacklem added a comment to D57555: rpcsec_tls: Avoid a socket reference underflow in rpctls_server().

I don't see why adding another soref() stops a socket
from being leaked?

Jun 13 2026, 10:04 PM
rmacklem added inline comments to D57553: netexport: Move struct netexport into a .h file and refcnt it.
Jun 13 2026, 9:27 PM
rmacklem committed rG69e20977a468: acl_to_text_nfs4.c: Fix a snprintf() for large uid (authored by nick_spun.io).
acl_to_text_nfs4.c: Fix a snprintf() for large uid
Jun 13 2026, 9:19 PM
rmacklem closed D57561: acl_to_text_nfs4.c: Fix printing of appended uid/gid (cosmetic).
Jun 13 2026, 9:18 PM
rmacklem updated the diff for D57553: netexport: Move struct netexport into a .h file and refcnt it.

Use refcount_init() as suggested by kib@.

Jun 13 2026, 8:42 PM
rmacklem updated the diff for D57455: gss_impl.c: Fix a nfsd hang when kgssapi.ko is loaded, but gssd not running.

Modified patch to use a local static bool instead
of kgss_gssd_cl. I also moved the svc_nl_create()
and svc_reg() function calls in gssd.c to before
the daemon() call, to avoid any race with nfsd
startup.
As suggested by glebius@.

Jun 13 2026, 8:34 PM
rmacklem accepted D57561: acl_to_text_nfs4.c: Fix printing of appended uid/gid (cosmetic).

Do you need me to commit it or do you have a
commit bit for src?

Jun 13 2026, 7:46 PM
rmacklem added a comment to D57554: pNFSd: Add a directory of newly created files for the pNFSd.

Thanks for the comments.

Jun 13 2026, 1:08 PM

Jun 12 2026

rmacklem accepted D57555: rpcsec_tls: Avoid a socket reference underflow in rpctls_server().
Jun 12 2026, 10:19 PM
rmacklem requested review of D57554: pNFSd: Add a directory of newly created files for the pNFSd.
Jun 12 2026, 9:25 PM
rmacklem requested review of D57553: netexport: Move struct netexport into a .h file and refcnt it.
Jun 12 2026, 9:10 PM

Jun 8 2026

rmacklem added a comment to D57455: gss_impl.c: Fix a nfsd hang when kgssapi.ko is loaded, but gssd not running.

I think this change also creates a potential process level race with gssd. The rc(8) can run nfsd before gssd instantiated the RPC server. Together with this change in the gssd the daemon(3) call needs to be moved down after svc_nl_create() and svc_reg().

Jun 8 2026, 11:43 PM
rmacklem added a comment to D57455: gss_impl.c: Fix a nfsd hang when kgssapi.ko is loaded, but gssd not running.

But why do you need a second pointer? You may have a static bool that marks the kgss_gssd_handle has been successfully checked with a NULL RPC. I would actually suggest not to store a second pointer neither a bool. Make kgss_gssd_client() always return a checked client.

Jun 8 2026, 11:41 PM
rmacklem committed rG36d411987b51: acl_id_to_name.c: Fix printing of uids and gids (authored by pen_lysator.liu.se).
acl_id_to_name.c: Fix printing of uids and gids
Jun 8 2026, 9:41 PM
rmacklem added a comment to D57455: gss_impl.c: Fix a nfsd hang when kgssapi.ko is loaded, but gssd not running.

Sorry, can't understand why do we need a second CLIENT * for this NULL RPC.

Jun 8 2026, 9:00 PM

Jun 5 2026

rmacklem committed rG3dfbbe8586bb: nfsd: Add per-MDS fs striping configuration (authored by rmacklem).
nfsd: Add per-MDS fs striping configuration
Jun 5 2026, 3:02 PM

Jun 4 2026

rmacklem committed rGea4886f2829b: nfs_commonkrpc.c: Improve handling of NFSv4.1/4.2 recovery (authored by rmacklem).
nfs_commonkrpc.c: Improve handling of NFSv4.1/4.2 recovery
Jun 4 2026, 10:04 PM
rmacklem requested review of D57455: gss_impl.c: Fix a nfsd hang when kgssapi.ko is loaded, but gssd not running.
Jun 4 2026, 9:07 PM
rmacklem committed rG72e57bc26417: nfsd: Add support for striped Flexible File layout (authored by rmacklem).
nfsd: Add support for striped Flexible File layout
Jun 4 2026, 1:31 AM

Jun 3 2026

rmacklem committed rG303df71969f5: krpc: Get rid of KRPC_VNET macros (authored by rmacklem).
krpc: Get rid of KRPC_VNET macros
Jun 3 2026, 8:12 PM
rmacklem committed rGfcc7609d699a: nfsd: Get rid of NFSD_VNET macros (authored by rmacklem).
nfsd: Get rid of NFSD_VNET macros
Jun 3 2026, 8:07 PM
rmacklem committed rGce77cd3d9c1a: nfscl: Fix handling of gssd upcalls for the NFS client (authored by rmacklem).
nfscl: Fix handling of gssd upcalls for the NFS client
Jun 3 2026, 8:03 PM
rmacklem committed rG07d733963ecd: nfs_clrpcops.c: Change initial layout type to flex files (authored by rmacklem).
nfs_clrpcops.c: Change initial layout type to flex files
Jun 3 2026, 7:07 PM

Jun 2 2026

rmacklem abandoned D55203: svc_vc.c: Add support for an xp_extpg boolean.

I'll just leave things in their current state.

Jun 2 2026, 12:55 PM

May 28 2026

rmacklem committed rGefe287822bcb: nfsd: Allow vfs.nfsd.srvmaxio to be up to 4Mbytes (authored by rmacklem).
nfsd: Allow vfs.nfsd.srvmaxio to be up to 4Mbytes
May 28 2026, 2:47 AM
rmacklem committed rG947dd1ca1297: subr_uio.c: Remove a KASSERT() for large NFS server I/O (authored by rmacklem).
subr_uio.c: Remove a KASSERT() for large NFS server I/O
May 28 2026, 2:46 AM

May 25 2026

rmacklem added inline comments to D57180: Allow setfacl / acl_from_text() to handle negative uid / gid numbers in user/group ACL entries.
May 25 2026, 7:53 PM
rmacklem committed rG6e7c10c79dea: acl_id_to_name.c: Fix printing of uids and gids (authored by pen_lysator.liu.se).
acl_id_to_name.c: Fix printing of uids and gids
May 25 2026, 7:47 PM
rmacklem closed D57179: Print numeric uids and gids in user:/group: ACL entries as unsigned integers.
May 25 2026, 7:47 PM
rmacklem committed rG4d80d4913e79: nfs: Fix argument typo to avoid a crash (authored by rmacklem).
nfs: Fix argument typo to avoid a crash
May 25 2026, 7:24 PM

May 23 2026

rmacklem added a comment to D57180: Allow setfacl / acl_from_text() to handle negative uid / gid numbers in user/group ACL entries.

Hmm.. Yeah, I didn't want to change that part of the code. But now when I read the fine print in the man page for strtoul() and strtol() I think we should just get rid of that extra check and just use "*endp != '\0'"...

Hmm.. Shouldn't we use strtoumax() and strtoimax() while we're at it...? Perhaps something like:

intmax_t iv;
uintmax_t uv;
uid_t id;
...
if (*name == -) {
        iv = strtoimax(name,&endp,0);
} else {
        uv = strtoumax(name,&endp,0);
}
if (name == endp || *endp != '\0') {
        errno = EINVAL; /* No or invalid number */
        return (-1);
}
if (*name == '-') {
        id = iv;
        if (int32_t) id != iv) {
               errno = EINVAL; /* Overflow */
               return (-1);
       }
} else {
        id = uv;
        if (id != uv) {
                errno = EINVAL; /* Overflow */
                return (-1);
        }
}

Hmm.. Not sure (or I'm too tired right now) how to write a better and fully portably check for under/overflow in the negative case that works if we get 64 bit uid_t/gid_t. :-)

May 23 2026, 9:46 AM