lkml.org 
[lkml]   [2018]   [Feb]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [PATCH v3 1/6] dax: fix vma_is_fsdax() helper
    On Fri 23-02-18 16:43:11, Dan Williams wrote:
    > 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>
    > Signed-off-by: Dan Williams <dan.j.williams@intel.com>

    I wonder how I didn't notice this when reading the original patch. Anyway
    the fix looks good. You can add:

    Reviewed-by: Jan Kara <jack@suse.cz>

    Honza

    > ---
    > include/linux/fs.h | 2 +-
    > 1 file changed, 1 insertion(+), 1 deletion(-)
    >
    > 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)
    > 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;
    > }
    >
    --
    Jan Kara <jack@suse.com>
    SUSE Labs, CR

    \
     
     \ /
      Last update: 2018-02-26 10:52    [W:4.201 / U:0.140 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site