public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Matthew Wilcox <willy@linux.intel.com>
To: Dave Chinner <david@fromorbit.com>
Cc: xfs@oss.sgi.com
Subject: Re: [PATCH 1/4] xfs: call dax_fault on read page faults for DAX
Date: Tue, 21 Jul 2015 09:57:58 -0400	[thread overview]
Message-ID: <20150721135758.GO13681@linux.intel.com> (raw)
In-Reply-To: <1437440945-23457-2-git-send-email-david@fromorbit.com>

On Tue, Jul 21, 2015 at 11:09:02AM +1000, Dave Chinner wrote:
> @@ -339,6 +344,8 @@ int __dax_fault(struct vm_area_struct *vma, struct vm_fault *vmf,
>  	int error;
>  	int major = 0;
>  
> +	WARN_ON_ONCE((vmf->flags & FAULT_FLAG_WRITE) && !complete_unwritten);
> +
>  	size = (i_size_read(inode) + PAGE_SIZE - 1) >> PAGE_SHIFT;
>  	if (vmf->pgoff >= size)
>  		return VM_FAULT_SIGBUS;

This warning is always going to trigger for ext2, since it doesn't
support the concept of unwritten extents.  Instead, ext2 zeroes the block
before linking it into the tree and returning from get_block.

> @@ -437,7 +444,7 @@ int __dax_fault(struct vm_area_struct *vma, struct vm_fault *vmf,
>  	 * as for normal BH based IO completions.
>  	 */
>  	error = dax_insert_mapping(inode, &bh, vma, vmf);
> -	if (buffer_unwritten(&bh))
> +	if (buffer_unwritten(&bh) && complete_unwritten)
>  		complete_unwritten(&bh, !error);
>  
>   out:

... so maybe we should do something here like:

	if (buffer_unwritten(&bh)) {
		if (complete_unwritten)
			complete_unwritten(&bh, !error);
		else
			BUG_ON(vmf->flags & FAULT_FLAG_WRITE);
	}

(the XFS changes look fine to me)

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

  parent reply	other threads:[~2015-07-21 13:58 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-21  1:09 [PATCH 0/4] xfs: various fixes Dave Chinner
2015-07-21  1:09 ` [PATCH 1/4] xfs: call dax_fault on read page faults for DAX Dave Chinner
2015-07-21 11:50   ` Brian Foster
2015-07-21 13:57   ` Matthew Wilcox [this message]
2015-07-24  1:31     ` [PATCH 1/4 v2] " Dave Chinner
2015-07-24 13:44       ` Matthew Wilcox
2015-07-21  1:09 ` [PATCH 2/4] xfs: remote attribute headers contain an invalid LSN Dave Chinner
2015-07-21 11:50   ` Brian Foster
2015-07-21  1:09 ` [PATCH 3/4] xfs: remote attributes need to be considered data Dave Chinner
2015-07-21 11:50   ` Brian Foster
2015-07-21  1:09 ` [PATCH 4/4] xfs: xfs_bunmapi() does not need XFS_BMAPI_METADATA flag Dave Chinner
2015-07-21 11:50   ` Brian Foster

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=20150721135758.GO13681@linux.intel.com \
    --to=willy@linux.intel.com \
    --cc=david@fromorbit.com \
    --cc=xfs@oss.sgi.com \
    /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