[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAFqt6zatfzk8PmBN110LD_x8goU+vO4U9TAGaamJ4UqwRm+g_g@mail.gmail.com>
Date: Tue, 24 Apr 2018 11:29:39 +0530
From: Souptick Joarder <jrdr.linux@...il.com>
To: Matthew Wilcox <willy@...radead.org>
Cc: jack@...e.cz, Al Viro <viro@...iv.linux.org.uk>,
Ross Zwisler <ross.zwisler@...ux.intel.com>,
Andrew Morton <akpm@...ux-foundation.org>,
Dan Williams <dan.j.williams@...el.com>,
Michal Hocko <mhocko@...e.com>,
kirill.shutemov@...ux.intel.com,
linux-fsdevel <linux-fsdevel@...r.kernel.org>,
Linux-MM <linux-mm@...ck.org>, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v5] fs: dax: Adding new return type vm_fault_t
On Tue, Apr 24, 2018 at 1:19 AM, Matthew Wilcox <willy@...radead.org> wrote:
> On Mon, Apr 23, 2018 at 11:36:25PM +0530, Souptick Joarder wrote:
>> If the insertion of PTE failed because someone else
>> already added a different entry in the mean time, we
>> treat that as success as we assume the same entry was
>> actually inserted.
>
> No, Jan said to *make it a comment*. In the source file. That's why
> he formatted it with the /* */. Not in the changelog.
Sorry, got confused.
I think this should be fine -
+/*
+If the insertion of PTE failed because someone else
+already added a different entry in the mean time, we
+treat that as success as we assume the same entry was
+actually inserted.
+*/
-int vm_insert_mixed_mkwrite(struct vm_area_struct *vma, unsigned long addr,
- pfn_t pfn)
+vm_fault_t vmf_insert_mixed_mkwrite(struct vm_area_struct *vma,
+ unsigned long addr, pfn_t pfn)
{
- return __vm_insert_mixed(vma, addr, pfn, true);
+ int err;
+
+ err = __vm_insert_mixed(vma, addr, pfn, true);
+ if (err == -ENOMEM)
+ return VM_FAULT_OOM;
+ if (err < 0 && err != -EBUSY)
+ return VM_FAULT_SIGBUS;
+ return VM_FAULT_NOPAGE;
}
-EXPORT_SYMBOL(vm_insert_mixed_mkwrite);
+EXPORT_SYMBOL(vmf_insert_mixed_mkwrite);
Powered by blists - more mailing lists