/* * This file contains all the stubs needed when communicating with lockd. * This level of indirection is necessary so we can run nfsd+lockd without * requiring the nfs client to be compiled in/loaded, and vice versa. * * Copyright (C) 1996, Olaf Kirch */ #include #include #include "nfsd.h" #include "vfs.h" #define NFSDDBG_FACILITY NFSDDBG_LOCKD #ifdef CONFIG_LOCKD_V4 #define nlm_stale_fh nlm4_stale_fh #define nlm_failed nlm4_failed #else #define nlm_stale_fh nlm_lck_denied_nolocks #define nlm_failed nlm_lck_denied_nolocks #endif /* * Note: we hold the dentry use count while the file is open. */ static __be32 nlm_fopen(struct svc_rqst *rqstp, struct nfs_fh *f, struct file **filp) { __be32 nfserr; struct svc_fh fh; /* must initialize before using! but maxsize doesn't matter */ fh_init(&fh,0); fh.fh_handle.fh_size = f->size; memcpy((char*)&fh.fh_handle.fh_base, f->data, f->size); fh.fh_export = NULL; nfserr = nfsd_open(rqstp, &fh, S_IFREG, NFSD_MAY_LOCK, filp); fh_put(&fh); /* We return nlm error codes as nlm doesn't know * about nfsd, but nfsd does know about nlm.. */ switch (nfserr) { case nfs_ok: return 0; case nfserr_dropit: return nlm_drop_reply; case nfserr_stale: return nlm_stale_fh; default: return nlm_failed; } } static void nlm_fclose(struct file *filp) { fput(filp); } static const struct nlmsvc_binding nfsd_nlm_ops = { .fopen = nlm_fopen, /* open file for locking */ .fclose = nlm_fclose, /* close file */ }; void nfsd_lockd_init(void) { dprintk("nfsd: initializing lockd\n"); nlmsvc_ops = &nfsd_nlm_ops; } void nfsd_lockd_shutdown(void) { nlmsvc_ops = NULL; } 11c80'>refslogtreecommitdiff
diff options
context:
space:
mode:
authorStephan Mueller <smueller@chronox.de>2016-12-08 07:09:44 +0100
committerHerbert Xu <herbert@gondor.apana.org.au>2016-12-08 20:09:22 +0800
commit678b5c6b22fed89a13d5b2267f423069a9b11c80 (patch)
tree033a4087eb17cd5ec1c164a0ae5e04b7bb030fee
parent48a992727d82cb7db076fa15d372178743b1f4cd (diff)
crypto: algif_aead - fix uninitialized variable warning
In case the user provided insufficient data, the code may return prematurely without any operation. In this case, the processed data indicated with outlen is zero. Reported-by: Stephen Rothwell <sfr@canb.auug.org.au> Signed-off-by: Stephan Mueller <smueller@chronox.de> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>