]> git.karo-electronics.de Git - karo-tx-linux.git/commit
locks: only validate the lock vs. f_mode in F_SETLK codepaths
authorJeff Layton <jlayton@poochiereds.net>
Fri, 9 May 2014 15:41:54 +0000 (11:41 -0400)
committerJeff Layton <jlayton@poochiereds.net>
Fri, 9 May 2014 15:41:54 +0000 (11:41 -0400)
commit09e558d9baa6416111bce8610c6bbd9a525ee057
tree2222f99e1cbc1979256996d7fa3bb42196acedfc
parentafcf0a2d9289bbe50aab362e6fb2798038815973
locks: only validate the lock vs. f_mode in F_SETLK codepaths

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.

Reported-by: Reuben Farrelly <reuben@reub.net>
Signed-off-by: Jeff Layton <jlayton@poochiereds.net>
fs/locks.c