@@ -1460,28 +1460,6 @@ static int create_proc_exports_entry(void)
14601460
14611461unsigned int nfsd_net_id ;
14621462
1463- /**
1464- * nfsd_nl_rpc_status_get_start - Prepare rpc_status_get dumpit
1465- * @cb: netlink metadata and command arguments
1466- *
1467- * Return values:
1468- * %0: The rpc_status_get command may proceed
1469- * %-ENODEV: There is no NFSD running in this namespace
1470- */
1471- int nfsd_nl_rpc_status_get_start (struct netlink_callback * cb )
1472- {
1473- struct nfsd_net * nn = net_generic (sock_net (cb -> skb -> sk ), nfsd_net_id );
1474- int ret = - ENODEV ;
1475-
1476- mutex_lock (& nfsd_mutex );
1477- if (nn -> nfsd_serv )
1478- ret = 0 ;
1479- else
1480- mutex_unlock (& nfsd_mutex );
1481-
1482- return ret ;
1483- }
1484-
14851463static int nfsd_genl_rpc_status_compose_msg (struct sk_buff * skb ,
14861464 struct netlink_callback * cb ,
14871465 struct nfsd_genl_rqstp * rqstp )
@@ -1558,8 +1536,16 @@ static int nfsd_genl_rpc_status_compose_msg(struct sk_buff *skb,
15581536int nfsd_nl_rpc_status_get_dumpit (struct sk_buff * skb ,
15591537 struct netlink_callback * cb )
15601538{
1561- struct nfsd_net * nn = net_generic (sock_net (skb -> sk ), nfsd_net_id );
15621539 int i , ret , rqstp_index = 0 ;
1540+ struct nfsd_net * nn ;
1541+
1542+ mutex_lock (& nfsd_mutex );
1543+
1544+ nn = net_generic (sock_net (skb -> sk ), nfsd_net_id );
1545+ if (!nn -> nfsd_serv ) {
1546+ ret = - ENODEV ;
1547+ goto out_unlock ;
1548+ }
15631549
15641550 rcu_read_lock ();
15651551
@@ -1636,22 +1622,10 @@ int nfsd_nl_rpc_status_get_dumpit(struct sk_buff *skb,
16361622 ret = skb -> len ;
16371623out :
16381624 rcu_read_unlock ();
1639-
1640- return ret ;
1641- }
1642-
1643- /**
1644- * nfsd_nl_rpc_status_get_done - rpc_status_get dumpit post-processing
1645- * @cb: netlink metadata and command arguments
1646- *
1647- * Return values:
1648- * %0: Success
1649- */
1650- int nfsd_nl_rpc_status_get_done (struct netlink_callback * cb )
1651- {
1625+ out_unlock :
16521626 mutex_unlock (& nfsd_mutex );
16531627
1654- return 0 ;
1628+ return ret ;
16551629}
16561630
16571631/**
0 commit comments