dax: fix vma_is_fsdax() helper
authorDan Williams <dan.j.williams@intel.com>
Thu, 22 Feb 2018 01:08:01 +0000 (17:08 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 9 Mar 2018 06:41:06 +0000 (22:41 -0800)
commit0ba6c33b3287e469622c0ccb2658052661bac579
tree6eecf18d2bc11b382d3bc735d7dd7816917e6abc
parent3379a37a740932ac7661633a5db21c6ccd59f9b4
dax: fix vma_is_fsdax() helper

commit 230f5a8969d8345fc9bbe3683f068246cf1be4b8 upstream.

Gerd reports that ->i_mode may contain other bits besides S_IFCHR. Use
S_ISCHR() instead. Otherwise, get_user_pages_longterm() may fail on
device-dax instances when those are meant to be explicitly allowed.

Fixes: 2bb6d2837083 ("mm: introduce get_user_pages_longterm")
Cc: <stable@vger.kernel.org>
Reported-by: Gerd Rausch <gerd.rausch@oracle.com>
Acked-by: Jane Chu <jane.chu@oracle.com>
Reported-by: Haozhong Zhang <haozhong.zhang@intel.com>
Reviewed-by: Jan Kara <jack@suse.cz>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
include/linux/fs.h