]> git.neil.brown.name Git - history.git/commitdiff
[PATCH] flock_lock_file livelock fix
authorMatthew Wilcox <willy@debian.org>
Tue, 24 Sep 2002 06:33:38 +0000 (23:33 -0700)
committerLinus Torvalds <torvalds@home.transmeta.com>
Tue, 24 Sep 2002 06:33:38 +0000 (23:33 -0700)
Looks like I dropped a hunk from my patchset, sorry.

We never set FL_SLEEP in the flock case, so if we should block, we'll
livelock instead.

fs/locks.c

index a52afbf2a1da3011038936ccf853472c0d6900f3..3702820a3de1eb50908216a9aeb6e1aba797f5d5 100644 (file)
@@ -253,7 +253,7 @@ static int flock_make_lock(struct file *filp,
 
        fl->fl_file = filp;
        fl->fl_pid = current->pid;
-       fl->fl_flags = FL_FLOCK;
+       fl->fl_flags = (cmd & LOCK_NB) ? FL_FLOCK : FL_FLOCK | FL_SLEEP;
        fl->fl_type = type;
        fl->fl_end = OFFSET_MAX;