lkml.org 
[lkml]   [2006]   [Jun]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH] Return error in case flock_lock_file failure
If flock_lock_file() failed to allocate flock with locks_alloc_lock()
then "error = 0" is returned. Need to return some non-zero.

Signed-Off-By: Pavel Emelianov <xemul@openvz.org>
Signed-Off-By: Kirill Korotaev <dev@openvz.org>

--- ./fs/locks.c.flfix 2006-06-05 12:09:42.000000000 +0400
+++ ./fs/locks.c 2006-06-05 12:27:20.000000000 +0400
@@ -705,6 +705,7 @@ static int flock_lock_file(struct file *
if (request->fl_type == F_UNLCK)
goto out;

+ error = -ENOMEM;
new_fl = locks_alloc_lock();
if (new_fl == NULL)
goto out;
@@ -731,6 +732,7 @@ static int flock_lock_file(struct file *
locks_copy_lock(new_fl, request);
locks_insert_lock(&inode->i_flock, new_fl);
new_fl = NULL;
+ error = 0;

out:
unlock_kernel();
\
 
 \ /
  Last update: 2006-06-14 16:02    [W:0.027 / U:0.024 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site