Skip to content
Commit cf01f4ee authored by Jeff Layton's avatar Jeff Layton
Browse files

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 bce7560d (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: default avatarReuben Farrelly <reuben@reub.net>
Signed-off-by: default avatarJeff Layton <jlayton@poochiereds.net>
parent afcf0a2d
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment