GFS2: Fix incorrect invalidation for DIO/buffered I/O
authorSteven Whitehouse <swhiteho@redhat.com>
Wed, 18 Dec 2013 14:14:52 +0000 (14:14 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 9 Jan 2014 20:25:15 +0000 (12:25 -0800)
commit3d508835389d026df5a6cefa4209ee012abfb764
tree672eb427141ef461b636c64504e94401555e99a0
parente93b100931a45490cd07960a1ec51d9d8e5100cb
GFS2: Fix incorrect invalidation for DIO/buffered I/O

commit dfd11184d894cd0a92397b25cac18831a1a6a5bc upstream.

In patch 209806aba9d540dde3db0a5ce72307f85f33468f we allowed
local deferred locks to be granted against a cached exclusive
lock. That opened up a corner case which this patch now
fixes.

The solution to the problem is to check whether we have cached
pages each time we do direct I/O and if so to unmap, flush
and invalidate those pages. Since the glock state machine
normally does that for us, mostly the code will be a no-op.

Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/gfs2/aops.c