lkml.org 
[lkml]   [2017]   [Aug]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH v5 4/5] fs, xfs: introduce MAP_DIRECT for creating block-map-atomic file ranges
On Wed, Aug 16, 2017 at 9:29 AM, Dan Williams <dan.j.williams@intel.com> wrote:
> On Wed, Aug 16, 2017 at 4:12 AM, Kirill A. Shutemov
> <kirill@shutemov.name> wrote:
>> On Wed, Aug 16, 2017 at 12:44:28AM -0700, Dan Williams wrote:
>>> @@ -1411,6 +1422,9 @@ unsigned long do_mmap(struct file *file, unsigned long addr,
>>>
>>> /* fall through */
>>> case MAP_PRIVATE:
>>> + if ((flags & (MAP_PRIVATE|MAP_DIRECT))
>>> + == (MAP_PRIVATE|MAP_DIRECT))
>>> + return -EINVAL;
>>
>> We've already checked for MAP_PRIVATE in this codepath. Simple (flags &
>> MAP_DIRECT) would be enough.
>
> True, willl fix.

Actually, no, because of the fallthrough we need to check MAP_SHARED
or MAP_PRIVATE along with MAP_DIRECT.

\
 
 \ /
  Last update: 2017-08-16 18:33    [W:0.047 / U:0.920 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site