Skip to content

Commit 230f5a8

Browse files
committed
dax: fix vma_is_fsdax() helper
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: 2bb6d28 ("mm: introduce get_user_pages_longterm") Cc: <[email protected]> Reported-by: Gerd Rausch <[email protected]> Acked-by: Jane Chu <[email protected]> Reported-by: Haozhong Zhang <[email protected]> Reviewed-by: Jan Kara <[email protected]> Signed-off-by: Dan Williams <[email protected]>
1 parent 9d4949b commit 230f5a8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

include/linux/fs.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3198,7 +3198,7 @@ static inline bool vma_is_fsdax(struct vm_area_struct *vma)
31983198
if (!vma_is_dax(vma))
31993199
return false;
32003200
inode = file_inode(vma->vm_file);
3201-
if (inode->i_mode == S_IFCHR)
3201+
if (S_ISCHR(inode->i_mode))
32023202
return false; /* device-dax */
32033203
return true;
32043204
}

0 commit comments

Comments
 (0)