nfs: block notification on fs with its own ->lock
[sfrench/cifs-2.6.git] / fs / lockd / svclock.c
index e9b85d8fd5fe756acd55934b7e619fa0ea9c1a50..cb3658ab9b7aed37baaef3183590d52dbed91c10 100644 (file)
@@ -470,8 +470,10 @@ nlmsvc_lock(struct svc_rqst *rqstp, struct nlm_file *file,
            struct nlm_host *host, struct nlm_lock *lock, int wait,
            struct nlm_cookie *cookie, int reclaim)
 {
-       struct nlm_block        *block = NULL;
+#if IS_ENABLED(CONFIG_SUNRPC_DEBUG)
        struct inode            *inode = nlmsvc_file_inode(file);
+#endif
+       struct nlm_block        *block = NULL;
        int                     error;
        int                     mode;
        int                     async_block = 0;
@@ -484,7 +486,7 @@ nlmsvc_lock(struct svc_rqst *rqstp, struct nlm_file *file,
                                (long long)lock->fl.fl_end,
                                wait);
 
-       if (inode->i_sb->s_export_op->flags & EXPORT_OP_SYNC_LOCKS) {
+       if (nlmsvc_file_file(file)->f_op->lock) {
                async_block = wait;
                wait = 0;
        }