Skip to content

Commit 2728c57

Browse files
committed
Merge tag 'nfsd-4.7-3' of git://linux-nfs.org/~bfields/linux
Pull lockd/locks fixes from Bruce Fields: "One fix for lockd soft lookups in an error path, and one fix for file leases on overlayfs" * tag 'nfsd-4.7-3' of git://linux-nfs.org/~bfields/linux: locks: use file_inode() lockd: unregister notifier blocks if the service fails to come up completely
2 parents 0d064a7 + 6343a21 commit 2728c57

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed

fs/lockd/svc.c

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -335,12 +335,17 @@ static struct notifier_block lockd_inet6addr_notifier = {
335335
};
336336
#endif
337337

338-
static void lockd_svc_exit_thread(void)
338+
static void lockd_unregister_notifiers(void)
339339
{
340340
unregister_inetaddr_notifier(&lockd_inetaddr_notifier);
341341
#if IS_ENABLED(CONFIG_IPV6)
342342
unregister_inet6addr_notifier(&lockd_inet6addr_notifier);
343343
#endif
344+
}
345+
346+
static void lockd_svc_exit_thread(void)
347+
{
348+
lockd_unregister_notifiers();
344349
svc_exit_thread(nlmsvc_rqst);
345350
}
346351

@@ -462,15 +467,17 @@ int lockd_up(struct net *net)
462467
* Note: svc_serv structures have an initial use count of 1,
463468
* so we exit through here on both success and failure.
464469
*/
465-
err_net:
470+
err_put:
466471
svc_destroy(serv);
467472
err_create:
468473
mutex_unlock(&nlmsvc_mutex);
469474
return error;
470475

471476
err_start:
472477
lockd_down_net(serv, net);
473-
goto err_net;
478+
err_net:
479+
lockd_unregister_notifiers();
480+
goto err_put;
474481
}
475482
EXPORT_SYMBOL_GPL(lockd_up);
476483

fs/locks.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1628,7 +1628,7 @@ generic_add_lease(struct file *filp, long arg, struct file_lock **flp, void **pr
16281628
{
16291629
struct file_lock *fl, *my_fl = NULL, *lease;
16301630
struct dentry *dentry = filp->f_path.dentry;
1631-
struct inode *inode = dentry->d_inode;
1631+
struct inode *inode = file_inode(filp);
16321632
struct file_lock_context *ctx;
16331633
bool is_deleg = (*flp)->fl_flags & FL_DELEG;
16341634
int error;

0 commit comments

Comments
 (0)