Skip to content

Commit 8db14ca

Browse files
neilbrownchucklever
authored andcommitted
lockd: remove SIGKILL handling
lockd allows SIGKILL and responds by dropping all locks and restarting the grace period. This functionality has been present since 2.1.32 when lockd was added to Linux. This functionality is undocumented and most likely added as a useful debug aid. When there is a need to drop locks, the better approach is to use /proc/fs/nfsd/unlock_*. This patch removes SIGKILL handling as part of preparation for removing all signal handling from sunrpc service threads. Signed-off-by: NeilBrown <[email protected]> Reviewed-by: Jeff Layton <[email protected]> Signed-off-by: Chuck Lever <[email protected]>
1 parent de8d38c commit 8db14ca

File tree

1 file changed

+0
-24
lines changed

1 file changed

+0
-24
lines changed

fs/lockd/svc.c

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@
4545

4646
#define NLMDBG_FACILITY NLMDBG_SVC
4747
#define LOCKD_BUFSIZE (1024 + NLMSVC_XDRSIZE)
48-
#define ALLOWED_SIGS (sigmask(SIGKILL))
4948

5049
static struct svc_program nlmsvc_program;
5150

@@ -111,19 +110,6 @@ static void set_grace_period(struct net *net)
111110
schedule_delayed_work(&ln->grace_period_end, grace_period);
112111
}
113112

114-
static void restart_grace(void)
115-
{
116-
if (nlmsvc_ops) {
117-
struct net *net = &init_net;
118-
struct lockd_net *ln = net_generic(net, lockd_net_id);
119-
120-
cancel_delayed_work_sync(&ln->grace_period_end);
121-
locks_end_grace(&ln->lockd_manager);
122-
nlmsvc_invalidate_all();
123-
set_grace_period(net);
124-
}
125-
}
126-
127113
/*
128114
* This is the lockd kernel thread
129115
*/
@@ -138,9 +124,6 @@ lockd(void *vrqstp)
138124
/* try_to_freeze() is called from svc_recv() */
139125
set_freezable();
140126

141-
/* Allow SIGKILL to tell lockd to drop all of its locks */
142-
allow_signal(SIGKILL);
143-
144127
dprintk("NFS locking service started (ver " LOCKD_VERSION ").\n");
145128

146129
/*
@@ -154,12 +137,6 @@ lockd(void *vrqstp)
154137
/* update sv_maxconn if it has changed */
155138
rqstp->rq_server->sv_maxconn = nlm_max_connections;
156139

157-
if (signalled()) {
158-
flush_signals(current);
159-
restart_grace();
160-
continue;
161-
}
162-
163140
timeout = nlmsvc_retry_blocked();
164141

165142
/*
@@ -174,7 +151,6 @@ lockd(void *vrqstp)
174151

175152
svc_process(rqstp);
176153
}
177-
flush_signals(current);
178154
if (nlmsvc_ops)
179155
nlmsvc_invalidate_all();
180156
nlm_shutdown_hosts();

0 commit comments

Comments
 (0)