summaryrefslogtreecommitdiffstats
path: root/include/linux/fs.h
diff options
context:
space:
mode:
authorDan Williams <dan.j.williams@intel.com>2018-02-21 20:08:01 -0500
committerDan Williams <dan.j.williams@intel.com>2018-02-26 15:32:42 -0500
commit230f5a8969d8345fc9bbe3683f068246cf1be4b8 (patch)
treeb6df1cb9d5379fd341c1d179ebae744e96df9ebb /include/linux/fs.h
parent9d4949b4935831be10534d5432bf611285a572a5 (diff)
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: 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>
Diffstat (limited to 'include/linux/fs.h')
-rw-r--r--include/linux/fs.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/include/linux/fs.h b/include/linux/fs.h
index 2a815560fda0..79c413985305 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -3198,7 +3198,7 @@ static inline bool vma_is_fsdax(struct vm_area_struct *vma)
3198 if (!vma_is_dax(vma)) 3198 if (!vma_is_dax(vma))
3199 return false; 3199 return false;
3200 inode = file_inode(vma->vm_file); 3200 inode = file_inode(vma->vm_file);
3201 if (inode->i_mode == S_IFCHR) 3201 if (S_ISCHR(inode->i_mode))
3202 return false; /* device-dax */ 3202 return false; /* device-dax */
3203 return true; 3203 return true;
3204} 3204}