J. Bruce Fields 129a84de23 locks: fix F_GETLK regression (failure to find conflicts)
In 9d6a8c5c213e34c475e72b245a8eb709258e968c we changed posix_test_lock
to modify its single file_lock argument instead of taking separate input
and output arguments.  This makes it no longer safe to set the output
lock's fl_type to F_UNLCK before looking for a conflict, since that
means searching for a conflict against a lock with type F_UNLCK.

This fixes a regression which causes F_GETLK to incorrectly report no
conflict on most filesystems (including any filesystem that doesn't do
its own locking).

Also fix posix_lock_to_flock() to copy the lock type.  This isn't
strictly necessary, since the caller already does this; but it seems
less likely to cause confusion in the future.

Thanks to Doug Chapman for the bug report.

Signed-off-by: "J. Bruce Fields" <bfields@citi.umich.edu>
Acked-by: Doug Chapman <doug.chapman@hp.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-05-10 20:25:59 -07:00
..
2007-05-09 12:30:55 -07:00
2007-05-10 09:26:52 -07:00
2007-05-08 11:14:59 -07:00
2007-05-09 12:30:55 -07:00
2007-05-08 11:15:01 -07:00
2007-05-08 11:14:59 -07:00
2007-05-08 11:14:59 -07:00
2007-05-08 11:14:57 -07:00
2007-05-09 08:58:16 +02:00
2007-05-09 08:58:16 +02:00
2007-05-09 08:57:56 +02:00
2007-05-09 17:58:01 -04:00
2007-05-10 09:26:52 -07:00
2006-10-04 06:51:26 -06:00
2007-05-08 11:14:59 -07:00
2007-05-08 11:15:18 -07:00
2006-12-07 08:39:25 -08:00
2007-05-08 11:15:08 -07:00
2007-05-08 11:15:01 -07:00
2007-05-08 11:15:09 -07:00
2007-05-09 08:58:15 +02:00
2007-05-07 12:12:58 -07:00
2007-05-09 06:44:57 +02:00
2006-12-07 08:39:25 -08:00
2007-05-09 12:30:50 -07:00
2007-05-08 20:10:00 -07:00
2006-10-01 00:39:19 -07:00
2005-04-16 15:20:36 -07:00
2006-03-23 07:38:11 -08:00
2007-05-09 07:10:02 +02:00
2007-05-08 11:15:01 -07:00
2007-05-08 11:15:04 -07:00
2007-05-08 11:15:18 -07:00