diff options
| author | Chuck Lever <chuck.lever@oracle.com> | 2026-02-17 17:07:19 -0500 |
|---|---|---|
| committer | Chuck Lever <chuck.lever@oracle.com> | 2026-03-29 21:25:09 -0400 |
| commit | 515788fa985fee596ddc9f8cd1e295e01883bb9e (patch) | |
| tree | 1d567639874748f855de941f20de0f01195d2fb6 | |
| parent | b201ce7af2a28d8d6c43a3b5bd099a44f98c1c3e (diff) | |
lockd: Add LOCKD_SHARE_SVID constant for DOS sharing mode
Replace the magic value ~(u32)0 with a named constant. This value
is used as a synthetic svid when looking up lockowners for DOS
share operations, which have no real process ID associated with
them.
Reviewed-by: Jeff Layton <jlayton@kernel.org>
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
| -rw-r--r-- | fs/lockd/share.h | 3 | ||||
| -rw-r--r-- | fs/lockd/svc4proc.c | 4 | ||||
| -rw-r--r-- | fs/lockd/xdr.c | 3 |
3 files changed, 7 insertions, 3 deletions
diff --git a/fs/lockd/share.h b/fs/lockd/share.h index a2867e30c593..20ea8ee49168 100644 --- a/fs/lockd/share.h +++ b/fs/lockd/share.h @@ -8,6 +8,9 @@ #ifndef _LOCKD_SHARE_H #define _LOCKD_SHARE_H +/* Synthetic svid for lockowner lookup during share operations */ +#define LOCKD_SHARE_SVID (~(u32)0) + /* * DOS share for a specific file */ diff --git a/fs/lockd/svc4proc.c b/fs/lockd/svc4proc.c index ca0409ea6b2d..ce340ea0d304 100644 --- a/fs/lockd/svc4proc.c +++ b/fs/lockd/svc4proc.c @@ -985,7 +985,7 @@ static __be32 nlm4svc_proc_share(struct svc_rqst *rqstp) struct nlm4_lock xdr_lock = { .fh = argp->xdrgen.share.fh, .oh = argp->xdrgen.share.oh, - .svid = ~(u32)0, + .svid = LOCKD_SHARE_SVID, }; resp->xdrgen.cookie = argp->xdrgen.cookie; @@ -1051,7 +1051,7 @@ static __be32 nlm4svc_proc_unshare(struct svc_rqst *rqstp) struct nlm4_lock xdr_lock = { .fh = argp->xdrgen.share.fh, .oh = argp->xdrgen.share.oh, - .svid = ~(u32)0, + .svid = LOCKD_SHARE_SVID, }; struct nlm_host *host = NULL; struct nlm_file *file = NULL; diff --git a/fs/lockd/xdr.c b/fs/lockd/xdr.c index 5aac49d1875a..dfca8b8dab73 100644 --- a/fs/lockd/xdr.c +++ b/fs/lockd/xdr.c @@ -19,6 +19,7 @@ #include <uapi/linux/nfs2.h> #include "lockd.h" +#include "share.h" #include "svcxdr.h" static inline loff_t @@ -274,7 +275,7 @@ nlmsvc_decode_shareargs(struct svc_rqst *rqstp, struct xdr_stream *xdr) memset(lock, 0, sizeof(*lock)); locks_init_lock(&lock->fl); - lock->svid = ~(u32)0; + lock->svid = LOCKD_SHARE_SVID; if (!svcxdr_decode_cookie(xdr, &argp->cookie)) return false; |
