lkml.org 
[lkml]   [2001]   [May]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: [PATCH] 3 one-liner bugfixes
Manfred Spraul wrote:
>
> + else
> + fl->fl_type & ~F_INPROGRESS;
^^^^^^
> + unlock_kernel();
> + return ret;
> }

The last patch was incorrect. Corrected version attached.

--
Manfred// $Header$
// Kernel Version:
// VERSION = 2
// PATCHLEVEL = 4
// SUBLEVEL = 4
// EXTRAVERSION =
--- 2.4/fs/fcntl.c Thu Nov 16 07:50:25 2000
+++ build-2.4/fs/fcntl.c Sat May 5 00:32:17 2001
@@ -338,7 +338,6 @@
if (!filp)
goto out;

- lock_kernel();
switch (cmd) {
case F_GETLK64:
err = fcntl_getlk64(fd, (struct flock64 *) arg);
@@ -353,7 +352,6 @@
err = do_fcntl(fd, cmd, arg, filp);
break;
}
- unlock_kernel();
fput(filp);
out:
return err;
--- 2.4/fs/locks.c Sun Apr 22 13:21:33 2001
+++ build-2.4/fs/locks.c Sat May 5 01:54:59 2001
@@ -1157,11 +1157,16 @@
int fcntl_getlease(struct file *filp)
{
struct file_lock *fl;
-
+ int ret;
+
+ lock_kernel();
fl = filp->f_dentry->d_inode->i_flock;
if ((fl == NULL) || ((fl->fl_flags & FL_LEASE) == 0))
- return F_UNLCK;
- return fl->fl_type & ~F_INPROGRESS;
+ ret = F_UNLCK;
+ else
+ ret = fl->fl_type & ~F_INPROGRESS;
+ unlock_kernel();
+ return ret;
}

/* We already had a lease on this file; just change its type */
@@ -1357,7 +1362,9 @@
goto out_putf;

if (filp->f_op && filp->f_op->lock) {
+ lock_kernel();
error = filp->f_op->lock(filp, F_GETLK, &file_lock);
+ unlock_kernel();
if (error < 0)
goto out_putf;
else if (error == LOCK_USE_CLNT)
@@ -1481,7 +1488,9 @@
}

if (filp->f_op && filp->f_op->lock != NULL) {
+ lock_kernel();
error = filp->f_op->lock(filp, cmd, file_lock);
+ unlock_kernel();
if (error < 0)
goto out_putf;
}
@@ -1522,7 +1531,9 @@
goto out_putf;

if (filp->f_op && filp->f_op->lock) {
+ lock_kernel();
error = filp->f_op->lock(filp, F_GETLK, &file_lock);
+ unlock_kernel();
if (error < 0)
goto out_putf;
else if (error == LOCK_USE_CLNT)
@@ -1619,7 +1630,9 @@
}

if (filp->f_op && filp->f_op->lock != NULL) {
+ lock_kernel();
error = filp->f_op->lock(filp, cmd, file_lock);
+ unlock_kernel();
if (error < 0)
goto out_putf;
}
\
 
 \ /
  Last update: 2005-03-22 12:52    [W:0.043 / U:0.180 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site