From: Jeff Layton Date: Fri, 9 May 2014 15:41:54 +0000 (-0400) Subject: locks: only validate the lock vs. f_mode in F_SETLK codepaths X-Git-Tag: omap-for-v3.16/fixes-against-rc1~186^2 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cf01f4eef9fe367ec0d85b38dd7214e29e376cdb;p=pandora-kernel.git 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 Reported-and-Tested-by: Reuben Farrelly Signed-off-by: Jeff Layton --- Reading git-diff-tree failed