]> asedeno.scripts.mit.edu Git - linux.git/blobdiff - fs/locks.c
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input
[linux.git] / fs / locks.c
index 686eae21daf6aeeac4d13a492009f224f678a096..a364ebc5cec3b1b974da670c72e9af0a42e07c2a 100644 (file)
@@ -1592,7 +1592,7 @@ int __break_lease(struct inode *inode, unsigned int mode, unsigned int type)
        ctx = smp_load_acquire(&inode->i_flctx);
        if (!ctx) {
                WARN_ON_ONCE(1);
-               return error;
+               goto free_lock;
        }
 
        percpu_down_read(&file_rwsem);
@@ -1672,6 +1672,7 @@ int __break_lease(struct inode *inode, unsigned int mode, unsigned int type)
        spin_unlock(&ctx->flc_lock);
        percpu_up_read(&file_rwsem);
        locks_dispose_list(&dispose);
+free_lock:
        locks_free_lock(new_fl);
        return error;
 }
@@ -2784,10 +2785,10 @@ static void lock_get_status(struct seq_file *f, struct file_lock *fl,
                               ? (fl->fl_type & LOCK_WRITE) ? "RW   " : "READ "
                               : (fl->fl_type & LOCK_WRITE) ? "WRITE" : "NONE ");
        } else {
-               seq_printf(f, "%s ",
-                              (lease_breaking(fl))
-                              ? (fl->fl_type == F_UNLCK) ? "UNLCK" : "READ "
-                              : (fl->fl_type == F_WRLCK) ? "WRITE" : "READ ");
+               int type = IS_LEASE(fl) ? target_leasetype(fl) : fl->fl_type;
+
+               seq_printf(f, "%s ", (type == F_WRLCK) ? "WRITE" :
+                                    (type == F_RDLCK) ? "READ" : "UNLCK");
        }
        if (inode) {
                /* userspace relies on this representation of dev_t */