Commit e3191a7
NFSD: simplify error paths in nfsd_svc()
commit bf32075 upstream.
The error paths in nfsd_svc() are needlessly complex and can result in a
final call to svc_put() without nfsd_last_thread() being called. This
results in the listening sockets not being closed properly.
The per-netns setup provided by nfsd_startup_new() and removed by
nfsd_shutdown_net() is needed precisely when there are running threads.
So we don't need nfsd_up_before. We don't need to know if it *was* up.
We only need to know if any threads are left. If none are, then we must
call nfsd_shutdown_net(). But we don't need to do that explicitly as
nfsd_last_thread() does that for us.
So simply call nfsd_last_thread() before the last svc_put() if there are
no running threads. That will always do the right thing.
Also discard:
pr_info("nfsd: last server has exited, flushing export cache\n");
It may not be true if an attempt to start the first server failed, and
it isn't particularly helpful and it simply reports normal behaviour.
Signed-off-by: NeilBrown <neilb@suse.de>
Reviewed-by: Jeff Layton <jlayton@kernel.org>
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Reported-by: Li Lingfeng <lilingfeng3@huawei.com>
Suggested-by: Li Lingfeng <lilingfeng3@huawei.com>
Tested-by: Li Lingfeng <lilingfeng3@huawei.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>1 parent 8013010 commit e3191a7
1 file changed
+4
-10
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
572 | 572 | | |
573 | 573 | | |
574 | 574 | | |
575 | | - | |
576 | 575 | | |
577 | 576 | | |
578 | 577 | | |
| |||
787 | 786 | | |
788 | 787 | | |
789 | 788 | | |
790 | | - | |
791 | 789 | | |
792 | 790 | | |
793 | 791 | | |
| |||
807 | 805 | | |
808 | 806 | | |
809 | 807 | | |
810 | | - | |
811 | | - | |
812 | 808 | | |
813 | 809 | | |
814 | 810 | | |
815 | 811 | | |
816 | 812 | | |
817 | 813 | | |
818 | 814 | | |
819 | | - | |
| 815 | + | |
820 | 816 | | |
821 | | - | |
822 | | - | |
823 | | - | |
824 | | - | |
825 | | - | |
826 | 817 | | |
827 | 818 | | |
828 | 819 | | |
829 | 820 | | |
| 821 | + | |
| 822 | + | |
| 823 | + | |
830 | 824 | | |
831 | 825 | | |
832 | 826 | | |
| |||
0 commit comments