Re: [PATCH v2] xfs: fix incorrect return type for fsdax fault handlers

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

 



On Thu, Oct 27, 2022 at 02:11:22PM -0700, Darrick J. Wong wrote:
> From: Darrick J. Wong <djwong@xxxxxxxxxx>
> 
> The kernel robot complained about this:
> 
> >> fs/xfs/xfs_file.c:1266:31: sparse: sparse: incorrect type in return expression (different base types) @@     expected int @@     got restricted vm_fault_t @@
>    fs/xfs/xfs_file.c:1266:31: sparse:     expected int
>    fs/xfs/xfs_file.c:1266:31: sparse:     got restricted vm_fault_t
>    fs/xfs/xfs_file.c:1314:21: sparse: sparse: incorrect type in assignment (different base types) @@     expected restricted vm_fault_t [usertype] ret @@     got int @@
>    fs/xfs/xfs_file.c:1314:21: sparse:     expected restricted vm_fault_t [usertype] ret
>    fs/xfs/xfs_file.c:1314:21: sparse:     got int
> 
> Fix the incorrect return type for these two functions.
> 
> While we're at it, make the !fsdax version return VM_FAULT_SIGBUS
> because a zero return value will cause some callers to try to lock
> vmf->page, which we never set here.
> 
> Fixes: ea6c49b784f0 ("xfs: support CoW in fsdax mode")
> Signed-off-by: Darrick J. Wong <djwong@xxxxxxxxxx>
> ---
> v2: less confusing commit message, add a debug assert to the !fsdax case
> ---

Looks fine to me.

Reviewed-by: Dave Chinner <dchinner@xxxxxxxxxx>
-- 
Dave Chinner
david@xxxxxxxxxxxxx



[Index of Archives]     [XFS Filesystem Development (older mail)]     [Linux Filesystem Development]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux RAID]     [Linux SCSI]


  Powered by Linux