]> err.no Git - linux-2.6/blobdiff - fs/locks.c
Merge with /home/shaggy/git/linus-clean/
[linux-2.6] / fs / locks.c
index 3fa6a7ce57a7390a7faf6a23effbabe9013720f3..29fa5da6c1170cab553b17b85eab000a2056793d 100644 (file)
@@ -1276,7 +1276,7 @@ int fcntl_getlease(struct file *filp)
  */
 static int __setlease(struct file *filp, long arg, struct file_lock **flp)
 {
-       struct file_lock *fl, **before, **my_before = NULL, *lease = *flp;
+       struct file_lock *fl, **before, **my_before = NULL, *lease;
        struct dentry *dentry = filp->f_dentry;
        struct inode *inode = dentry->d_inode;
        int error, rdlease_count = 0, wrlease_count = 0;
@@ -1287,6 +1287,8 @@ static int __setlease(struct file *filp, long arg, struct file_lock **flp)
        if (!flp || !(*flp) || !(*flp)->fl_lmops || !(*flp)->fl_lmops->fl_break)
                goto out;
 
+       lease = *flp;
+
        error = -EAGAIN;
        if ((arg == F_RDLCK) && (atomic_read(&inode->i_writecount) > 0))
                goto out;
@@ -1548,6 +1550,8 @@ int fcntl_getlk(struct file *filp, struct flock __user *l)
 
        if (filp->f_op && filp->f_op->lock) {
                error = filp->f_op->lock(filp, F_GETLK, &file_lock);
+               if (file_lock.fl_ops && file_lock.fl_ops->fl_release_private)
+                       file_lock.fl_ops->fl_release_private(&file_lock);
                if (error < 0)
                        goto out;
                else
@@ -1690,6 +1694,8 @@ int fcntl_getlk64(struct file *filp, struct flock64 __user *l)
 
        if (filp->f_op && filp->f_op->lock) {
                error = filp->f_op->lock(filp, F_GETLK, &file_lock);
+               if (file_lock.fl_ops && file_lock.fl_ops->fl_release_private)
+                       file_lock.fl_ops->fl_release_private(&file_lock);
                if (error < 0)
                        goto out;
                else
@@ -1873,6 +1879,8 @@ void locks_remove_flock(struct file *filp)
                        .fl_end = OFFSET_MAX,
                };
                filp->f_op->flock(filp, F_SETLKW, &fl);
+               if (fl.fl_ops && fl.fl_ops->fl_release_private)
+                       fl.fl_ops->fl_release_private(&fl);
        }
 
        lock_kernel();