Jeff Layton cf01f4eef9 locks: only validate the lock vs. f_mode in F_SETLK codepaths
v2: replace missing break in switch statement (as pointed out by Dave
    Jones)

commit bce7560d4946 (locks: consolidate checks for compatible
filp->f_mode values in setlk handlers) introduced a regression in the
F_GETLK handler.

flock64_to_posix_lock is a shared codepath between F_GETLK and F_SETLK,
but the f_mode checks should only be applicable to the F_SETLK codepaths
according to POSIX.

Instead of just reverting the patch, add a new function to do this
checking and have the F_SETLK handlers call it.

Cc: Dave Jones <davej@redhat.com>
Reported-and-Tested-by: Reuben Farrelly <reuben@reub.net>
Signed-off-by: Jeff Layton <jlayton@poochiereds.net>
2014-05-09 11:41:54 -04:00
..
2014-05-06 13:04:59 -07:00
2014-04-16 23:08:57 -05:00
2014-04-28 16:43:44 +02:00
2013-12-04 12:27:46 +01:00
2014-04-07 10:17:30 -07:00
2014-01-25 03:14:05 -05:00
2014-05-05 09:31:33 +03:00
2014-05-08 19:20:45 -07:00
2013-12-05 16:36:21 -06:00
2013-06-29 12:57:04 +04:00
2013-10-24 23:34:54 -04:00
2014-04-19 13:23:31 -07:00
2014-04-04 15:50:08 -07:00
2013-11-09 00:16:20 -05:00
2013-10-24 23:34:54 -04:00
2014-02-07 16:08:57 -08:00
2014-02-07 16:08:57 -08:00
2014-04-01 23:19:09 -04:00
2013-11-23 22:33:47 -08:00
2014-04-01 23:19:08 -04:00
2014-04-01 23:19:08 -04:00
2014-04-01 23:19:09 -04:00
2013-10-24 23:34:54 -04:00
2013-11-09 00:16:31 -05:00
2014-04-16 11:53:08 -07:00