[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20170824071624.GB20465@quack2.suse.cz>
Date: Thu, 24 Aug 2017 09:16:24 +0200
From: Jan Kara <jack@...e.cz>
To: Christoph Hellwig <hch@...radead.org>
Cc: Jan Kara <jack@...e.cz>, linux-fsdevel@...r.kernel.org,
linux-nvdimm@...ts.01.org, Andy Lutomirski <luto@...nel.org>,
linux-ext4@...r.kernel.org, linux-xfs@...r.kernel.org,
Ross Zwisler <ross.zwisler@...ux.intel.com>,
Dan Williams <dan.j.williams@...el.com>,
Boaz Harrosh <boazh@...app.com>
Subject: Re: [PATCH 10/13] mm: Wire up MAP_SYNC
On Wed 23-08-17 11:43:49, Christoph Hellwig wrote:
> On Thu, Aug 17, 2017 at 06:08:12PM +0200, Jan Kara wrote:
> > Pretty crude for now...
> >
> > Signed-off-by: Jan Kara <jack@...e.cz>
> > ---
> > fs/ext4/file.c | 2 ++
> > include/linux/mm.h | 1 +
> > include/linux/mman.h | 3 ++-
> > include/uapi/asm-generic/mman.h | 1 +
> > mm/mmap.c | 5 +++++
> > 5 files changed, 11 insertions(+), 1 deletion(-)
> >
> > diff --git a/fs/ext4/file.c b/fs/ext4/file.c
> > index f84bb29e941e..850037e140d7 100644
> > --- a/fs/ext4/file.c
> > +++ b/fs/ext4/file.c
> > @@ -340,6 +340,8 @@ static int ext4_file_mmap(struct file *file, struct vm_area_struct *vma)
> > vma->vm_flags |= VM_MIXEDMAP | VM_HUGEPAGE;
> > } else {
> > vma->vm_ops = &ext4_file_vm_ops;
> > + if (vma->vm_flags & VM_SYNC)
> > + return -EOPNOTSUPP;
> > }
>
> So each mmap instance would need to reject the flag explicitly?
>
> Or do I misunderstand this VM_SYNC flag?
Yes, if this should be cleaned up, then each mmap instance not supporting
it would need to reject it. However Dan has in his version of mmap()
syscall a mask of supported flags so when I switch to that, it would be
just opt-in. Or I could just reject VM_SYNC for any !IS_DAX inode so then
only ext2 & xfs would need to reject it... But the biggest problem with
this patch is that we need to settle on a safe way of adding new mmap flag.
Honza
--
Jan Kara <jack@...e.com>
SUSE Labs, CR
Powered by blists - more mailing lists