nfs: increment i_dio_count for reads, too
authorChristoph Hellwig <hch@infradead.org>
Thu, 14 Nov 2013 16:50:30 +0000 (08:50 -0800)
committerJiri Slaby <jslaby@suse.cz>
Thu, 3 Apr 2014 08:32:15 +0000 (10:32 +0200)
commit59653950df4c63079a10c015606eda9abc2221b8
tree184f5051f907cd9051924c6c561b9a86eb085788
parent2f786d997db547ad88c6560e7d9f214ab6d5e913
nfs: increment i_dio_count for reads, too

commit 1f90ee27461e31a1c18e5d819f6ea6f5c7304b16 upstream.

i_dio_count is used to protect dio access against truncate.  We want
to make sure there are no dio reads pending either when doing a
truncate.  I suspect on plain NFS things might work even without
this, but once we use a pnfs layout driver that access backing devices
directly things will go bad without the proper synchronization.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
fs/nfs/direct.c