Merge tag 'filelock-v5.9-1' of git://git.kernel.org/pub/scm/linux/kernel/git/jlayton...
[linux-block.git] / fs / locks.c
index 36bd2c22178644190beded057fe48a753b49ae1f..938fe325bc54318167ff35ad8d54317c33b2ddfc 100644 (file)
@@ -61,7 +61,7 @@
  *
  *  Initial implementation of mandatory locks. SunOS turned out to be
  *  a rotten model, so I implemented the "obvious" semantics.
- *  See 'Documentation/filesystems/mandatory-locking.txt' for details.
+ *  See 'Documentation/filesystems/mandatory-locking.rst' for details.
  *  Andy Walker (andy@lysaker.kvaerner.no), April 06, 1996.
  *
  *  Don't allow mandatory locks on mmap()'ed files. Added simple functions to
@@ -1558,6 +1558,9 @@ static bool leases_conflict(struct file_lock *lease, struct file_lock *breaker)
 {
        bool rc;
 
+       if (lease->fl_lmops->lm_breaker_owns_lease
+                       && lease->fl_lmops->lm_breaker_owns_lease(lease))
+               return false;
        if ((breaker->fl_flags & FL_LAYOUT) != (lease->fl_flags & FL_LAYOUT)) {
                rc = false;
                goto trace;
@@ -2824,7 +2827,7 @@ static void lock_get_status(struct seq_file *f, struct file_lock *fl,
 {
        struct inode *inode = NULL;
        unsigned int fl_pid;
-       struct pid_namespace *proc_pidns = file_inode(f->file)->i_sb->s_fs_info;
+       struct pid_namespace *proc_pidns = proc_pid_ns(file_inode(f->file)->i_sb);
 
        fl_pid = locks_translate_pid(fl, proc_pidns);
        /*
@@ -2902,7 +2905,7 @@ static int locks_show(struct seq_file *f, void *v)
 {
        struct locks_iterator *iter = f->private;
        struct file_lock *fl, *bfl;
-       struct pid_namespace *proc_pidns = file_inode(f->file)->i_sb->s_fs_info;
+       struct pid_namespace *proc_pidns = proc_pid_ns(file_inode(f->file)->i_sb);
 
        fl = hlist_entry(v, struct file_lock, fl_link);