Re: [PATCH v2] fs: dax: Adding new return type vm_fault_t

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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;




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux