nlm: Ensure callback code also checks that the files match
[GitHub/mt8127/android_kernel_alcatel_ttab.git] / include / linux / lockd / lockd.h
index dcaad79f54ed5e74985c165585a354c6d04e0bc0..669af5eaa8982756debf3d89dbb98c0878a90f09 100644 (file)
@@ -236,7 +236,8 @@ void                  nlm_rebind_host(struct nlm_host *);
 struct nlm_host * nlm_get_host(struct nlm_host *);
 void             nlm_shutdown_hosts(void);
 void             nlm_shutdown_hosts_net(struct net *net);
-void             nlm_host_rebooted(const struct nlm_reboot *);
+void             nlm_host_rebooted(const struct net *net,
+                                       const struct nlm_reboot *);
 
 /*
  * Host monitoring
@@ -244,11 +245,13 @@ void                nlm_host_rebooted(const struct nlm_reboot *);
 int              nsm_monitor(const struct nlm_host *host);
 void             nsm_unmonitor(const struct nlm_host *host);
 
-struct nsm_handle *nsm_get_handle(const struct sockaddr *sap,
+struct nsm_handle *nsm_get_handle(const struct net *net,
+                                       const struct sockaddr *sap,
                                        const size_t salen,
                                        const char *hostname,
                                        const size_t hostname_len);
-struct nsm_handle *nsm_reboot_lookup(const struct nlm_reboot *info);
+struct nsm_handle *nsm_reboot_lookup(const struct net *net,
+                                       const struct nlm_reboot *info);
 void             nsm_release(struct nsm_handle *nsm);
 
 /*
@@ -352,7 +355,8 @@ static inline int nlm_privileged_requester(const struct svc_rqst *rqstp)
 static inline int nlm_compare_locks(const struct file_lock *fl1,
                                    const struct file_lock *fl2)
 {
-       return  fl1->fl_pid   == fl2->fl_pid
+       return file_inode(fl1->fl_file) == file_inode(fl2->fl_file)
+            && fl1->fl_pid   == fl2->fl_pid
             && fl1->fl_owner == fl2->fl_owner
             && fl1->fl_start == fl2->fl_start
             && fl1->fl_end   == fl2->fl_end