[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAPcyv4ioikcZvVqZQZmy9kU6tSX5zRgOqJTKHZLxes2TtT9UkA@mail.gmail.com>
Date: Wed, 16 Aug 2017 09:32:48 -0700
From: Dan Williams <dan.j.williams@...el.com>
To: "Kirill A. Shutemov" <kirill@...temov.name>
Cc: Andrew Morton <akpm@...ux-foundation.org>, Jan Kara <jack@...e.cz>,
"Darrick J. Wong" <darrick.wong@...cle.com>,
Linux API <linux-api@...r.kernel.org>,
"linux-nvdimm@...ts.01.org" <linux-nvdimm@...ts.01.org>,
Dave Chinner <david@...morbit.com>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
linux-xfs@...r.kernel.org, Linux MM <linux-mm@...ck.org>,
Jeff Moyer <jmoyer@...hat.com>,
Alexander Viro <viro@...iv.linux.org.uk>,
Andy Lutomirski <luto@...nel.org>,
linux-fsdevel <linux-fsdevel@...r.kernel.org>,
Ross Zwisler <ross.zwisler@...ux.intel.com>,
Christoph Hellwig <hch@....de>
Subject: Re: [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@...el.com> wrote:
> On Wed, Aug 16, 2017 at 4:12 AM, Kirill A. Shutemov
> <kirill@...temov.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.
Powered by blists - more mailing lists