lkml.org 
[lkml]   [2006]   [Mar]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: fs/locks.c: Fix sys_flock() race
Trond Myklebust <Trond.Myklebust@netapp.com> wrote:
>
> - unlock_kernel();
>
> - if (new_fl->fl_type == F_UNLCK)
> - return 0;
> + if (request->fl_type == F_UNLCK)
> + goto out;
>
> + new_fl = locks_alloc_lock();
> + if (new_fl == NULL)
> + goto out;
> /*
> * If a higher-priority process was blocked on the old file lock,
> * give it the opportunity to lock the file.
> @@ -769,26 +772,27 @@ static int flock_lock_file(struct file *
> if (found)
> cond_resched();
>
> - lock_kernel();

hm, you've extended lock_kernel() coverage (why? Does this help fix the
race??) but we still have a cond_resched() inside the now-newly-locked
region. If that cond_resched() drops the bkl, is the race reopened?
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2006-03-30 02:41    [W:0.034 / U:1.220 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site