Commit 88808fbb authored by Linus Torvalds's avatar Linus Torvalds

Merge tag 'nfsd-5.17-1' of git://git.kernel.org/pub/scm/linux/kernel/git/cel/linux

Pull nfsd fixes from Chuck Lever:
 "Notable bug fixes:

   - Ensure SM_NOTIFY doesn't crash the NFS server host

   - Ensure NLM locks are cleaned up after client reboot

   - Fix a leak of internal NFSv4 lease information"

* tag 'nfsd-5.17-1' of git://git.kernel.org/pub/scm/linux/kernel/git/cel/linux:
  nfsd: nfsd4_setclientid_confirm mistakenly expires confirmed client.
  lockd: fix failure to cleanup client locks
  lockd: fix server crash on reboot of client holding lock
parents d5084ffb ab451ea9
...@@ -179,19 +179,21 @@ nlm_delete_file(struct nlm_file *file) ...@@ -179,19 +179,21 @@ nlm_delete_file(struct nlm_file *file)
static int nlm_unlock_files(struct nlm_file *file) static int nlm_unlock_files(struct nlm_file *file)
{ {
struct file_lock lock; struct file_lock lock;
struct file *f;
locks_init_lock(&lock);
lock.fl_type = F_UNLCK; lock.fl_type = F_UNLCK;
lock.fl_start = 0; lock.fl_start = 0;
lock.fl_end = OFFSET_MAX; lock.fl_end = OFFSET_MAX;
for (f = file->f_file[0]; f <= file->f_file[1]; f++) { if (file->f_file[O_RDONLY] &&
if (f && vfs_lock_file(f, F_SETLK, &lock, NULL) < 0) { vfs_lock_file(file->f_file[O_RDONLY], F_SETLK, &lock, NULL))
pr_warn("lockd: unlock failure in %s:%d\n", goto out_err;
__FILE__, __LINE__); if (file->f_file[O_WRONLY] &&
return 1; vfs_lock_file(file->f_file[O_WRONLY], F_SETLK, &lock, NULL))
} goto out_err;
}
return 0; return 0;
out_err:
pr_warn("lockd: unlock failure in %s:%d\n", __FILE__, __LINE__);
return 1;
} }
/* /*
......
...@@ -4130,8 +4130,10 @@ nfsd4_setclientid_confirm(struct svc_rqst *rqstp, ...@@ -4130,8 +4130,10 @@ nfsd4_setclientid_confirm(struct svc_rqst *rqstp,
status = nfserr_clid_inuse; status = nfserr_clid_inuse;
if (client_has_state(old) if (client_has_state(old)
&& !same_creds(&unconf->cl_cred, && !same_creds(&unconf->cl_cred,
&old->cl_cred)) &old->cl_cred)) {
old = NULL;
goto out; goto out;
}
status = mark_client_expired_locked(old); status = mark_client_expired_locked(old);
if (status) { if (status) {
old = NULL; old = NULL;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment