From: Peng Tao Date: Mon, 19 Jan 2015 23:44:29 +0000 (+0800) Subject: nfs: fix dio deadlock when O_DIRECT flag is flipped X-Git-Tag: fixes-v4.0-rc1~228^2~2 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ee8a1a8b160a87dc3a9c81a86796aa4db85ea815;p=pandora-kernel.git nfs: fix dio deadlock when O_DIRECT flag is flipped 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 Cc: stable@vger.kernel.org Signed-off-by: Trond Myklebust --- Reading git-diff-tree failed