posix_test_lock() returns void, so there is no need to test the return value.
Checking fl->fl_type for F_UNLCK instead.

Signed-off-by: Eugene Teo <[EMAIL PROTECTED]>
---
 fs/afs/flock.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/fs/afs/flock.c b/fs/afs/flock.c
index 8f07f8d..4f77f3c 100644
--- a/fs/afs/flock.c
+++ b/fs/afs/flock.c
@@ -456,7 +456,8 @@ static int afs_do_getlk(struct file *file, struct file_lock 
*fl)
 
        /* check local lock records first */
        ret = 0;
-       if (posix_test_lock(file, fl) == 0) {
+       posix_test_lock(file, fl);
+       if (fl->fl_type == F_UNLCK) {
                /* no local locks; consult the server */
                ret = afs_vnode_fetch_status(vnode, NULL, key);
                if (ret < 0)
-- 
1.5.2.2

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Reply via email to