Commit 0ba6c33b authored by Dan Williams's avatar Dan Williams Committed by Greg Kroah-Hartman

dax: fix vma_is_fsdax() helper

commit 230f5a89 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: 2bb6d283 ("mm: introduce get_user_pages_longterm")
Cc: <>
Reported-by: default avatarGerd Rausch <>
Acked-by: default avatarJane Chu <>
Reported-by: default avatarHaozhong Zhang <>
Reviewed-by: default avatarJan Kara <>
Signed-off-by: default avatarDan Williams <>
Signed-off-by: default avatarGreg Kroah-Hartman <>
parent 3379a37a
......@@ -3185,7 +3185,7 @@ static inline bool vma_is_fsdax(struct vm_area_struct *vma)
if (!vma_is_dax(vma))
return false;
inode = file_inode(vma->vm_file);
if (inode->i_mode == S_IFCHR)
if (S_ISCHR(inode->i_mode))
return false; /* device-dax */
return true;
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment