linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Matthew Wilcox <willy@infradead.org>
To: Souptick Joarder <jrdr.linux@gmail.com>
Cc: mawilcox@microsoft.com, ross.zwisler@linux.intel.com,
	viro@zeniv.linux.org.uk, linux-fsdevel@vger.kernel.org,
	linux-kernel@vger.kernel.org, linux-mm@kvack.org
Subject: Re: [PATCH v2] fs: dax: Adding new return type vm_fault_t
Date: Sat, 21 Apr 2018 13:17:11 -0700	[thread overview]
Message-ID: <20180421201711.GE14610@bombadil.infradead.org> (raw)
In-Reply-To: <20180421171442.GA17919@jordon-HP-15-Notebook-PC>

On Sat, Apr 21, 2018 at 10:44:42PM +0530, Souptick Joarder wrote:
> @@ -1112,7 +1112,7 @@ int __dax_zero_page_range(struct block_device *bdev,
>  }
>  EXPORT_SYMBOL_GPL(dax_iomap_rw);
>  
> -static int dax_fault_return(int error)
> +static vm_fault_t dax_fault_return(int error)
>  {
>  	if (error == 0)
>  		return VM_FAULT_NOPAGE;

At some point, we'll want to get rid of dax_fault_return, but that can be
a follow-on patch after vmf_error is in.

>  		if (write)
> -			error = vm_insert_mixed_mkwrite(vma, vaddr, pfn);
> +			ret = vmf_insert_mixed_mkwrite(vma, vaddr, pfn);
>  		else
> -			error = vm_insert_mixed(vma, vaddr, pfn);
> +			ret = vmf_insert_mixed(vma, vaddr, pfn);
>  
> -		/* -EBUSY is fine, somebody else faulted on the same PTE */
> -		if (error == -EBUSY)
> -			error = 0;
> -		break;
> +		goto finish_iomap;

> @@ -1284,12 +1281,12 @@ static int dax_iomap_pte_fault(struct vm_fault *vmf, pfn_t *pfnp,
>  	}
>  
>   error_finish_iomap:
> -	vmf_ret = dax_fault_return(error) | major;
> +	ret = dax_fault_return(error) | major;
>   finish_iomap:

I think we lose VM_FAULT_MAJOR with this change.

I would suggest fixing this with ...

  error_finish_iomap:
-	vmf_ret = dax_fault_return(error) | major;
+	ret = dax_fault_return(error);
  finish_iomap:

[...]

  out:
-	trace_dax_pte_fault_done(inode, vmf, vmf_ret);
-	return vmf_ret;
+	trace_dax_pte_fault_done(inode, vmf, ret);
+	return ret | major;

  reply	other threads:[~2018-04-21 20:17 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-21 17:14 [PATCH v2] fs: dax: Adding new return type vm_fault_t Souptick Joarder
2018-04-21 20:17 ` Matthew Wilcox [this message]
2018-04-23  5:28 ` kbuild test robot
2018-04-23  6:23   ` Souptick Joarder
2018-04-23  7:40 ` kbuild test robot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180421201711.GE14610@bombadil.infradead.org \
    --to=willy@infradead.org \
    --cc=jrdr.linux@gmail.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mawilcox@microsoft.com \
    --cc=ross.zwisler@linux.intel.com \
    --cc=viro@zeniv.linux.org.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).