]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
nfs: fix dio deadlock when O_DIRECT flag is flipped
authorPeng Tao <tao.peng@primarydata.com>
Mon, 19 Jan 2015 23:44:29 +0000 (07:44 +0800)
committerJiri Slaby <jslaby@suse.cz>
Sun, 8 Feb 2015 19:01:58 +0000 (20:01 +0100)
commit88bc02271ea706c54abf4237744436c5982d09bf
treeb693ec90ca4286c4ecbcd19bbadb9c8e8e7983ec
parent6633edfec196ef3a3f0a5cd4bbcdb1c65c532694
nfs: fix dio deadlock when O_DIRECT flag is flipped

commit ee8a1a8b160a87dc3a9c81a86796aa4db85ea815 upstream.

We only support swap file calling nfs_direct_IO. However, application
might be able to get to nfs_direct_IO if it toggles O_DIRECT flag
during IO and it can deadlock because we grab inode->i_mutex in
nfs_file_direct_write(). So return 0 for such case. Then the generic
layer will fall back to buffer IO.

Signed-off-by: Peng Tao <tao.peng@primarydata.com>
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
fs/nfs/direct.c