diff mbox series

fs/xfs: Fix return code of xfs_break_leased_layouts()

Message ID 20190819213918.29371-1-ira.weiny@intel.com (mailing list archive)
State Accepted
Headers show
Series fs/xfs: Fix return code of xfs_break_leased_layouts() | expand

Commit Message

Ira Weiny Aug. 19, 2019, 9:39 p.m. UTC
From: Ira Weiny <ira.weiny@intel.com>

The parens used in the while loop would result in error being assigned
the value 1 rather than the intended errno value.

This is required to return -ETXTBSY from follow on break_layout()
changes.

Signed-off-by: Ira Weiny <ira.weiny@intel.com>
---
 fs/xfs/xfs_pnfs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Darrick J. Wong Aug. 19, 2019, 11:10 p.m. UTC | #1
On Mon, Aug 19, 2019 at 02:39:18PM -0700, ira.weiny@intel.com wrote:
> From: Ira Weiny <ira.weiny@intel.com>
> 
> The parens used in the while loop would result in error being assigned
> the value 1 rather than the intended errno value.
> 
> This is required to return -ETXTBSY from follow on break_layout()
> changes.
> 
> Signed-off-by: Ira Weiny <ira.weiny@intel.com>

Doh.
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>

--D

> ---
>  fs/xfs/xfs_pnfs.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/fs/xfs/xfs_pnfs.c b/fs/xfs/xfs_pnfs.c
> index 0c954cad7449..a339bd5fa260 100644
> --- a/fs/xfs/xfs_pnfs.c
> +++ b/fs/xfs/xfs_pnfs.c
> @@ -32,7 +32,7 @@ xfs_break_leased_layouts(
>  	struct xfs_inode	*ip = XFS_I(inode);
>  	int			error;
>  
> -	while ((error = break_layout(inode, false) == -EWOULDBLOCK)) {
> +	while ((error = break_layout(inode, false)) == -EWOULDBLOCK) {
>  		xfs_iunlock(ip, *iolock);
>  		*did_unlock = true;
>  		error = break_layout(inode, true);
> -- 
> 2.20.1
>
diff mbox series

Patch

diff --git a/fs/xfs/xfs_pnfs.c b/fs/xfs/xfs_pnfs.c
index 0c954cad7449..a339bd5fa260 100644
--- a/fs/xfs/xfs_pnfs.c
+++ b/fs/xfs/xfs_pnfs.c
@@ -32,7 +32,7 @@  xfs_break_leased_layouts(
 	struct xfs_inode	*ip = XFS_I(inode);
 	int			error;
 
-	while ((error = break_layout(inode, false) == -EWOULDBLOCK)) {
+	while ((error = break_layout(inode, false)) == -EWOULDBLOCK) {
 		xfs_iunlock(ip, *iolock);
 		*did_unlock = true;
 		error = break_layout(inode, true);