Skip to contentSkip to conversation

fs/xfs: Fix return code of xfs_break_leased_layouts()

PATCH In review [email protected] 2 participants 2 messages Aug 19, 2019 XFS filesystem

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 fs/xfs: Fix return code of xfs_break_leased_layouts()

From: Ira Weiny <[email protected]>

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.

---
 fs/xfs/xfs_pnfs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/xfs/xfs_pnfs.c +1 -1
index 0c954cad7449..a339bd5fa260 100644
@@ -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);
Signature · 1 line
2.20.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 9 lines · On Mon, Aug 19, 2019 at 02:39:18PM -0700, [email protected] wrote:

From: Ira Weiny <[email protected]>

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.

Doh.

--D

Quoted 20 lines
---
 fs/xfs/xfs_pnfs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/xfs/xfs_pnfs.c +1 -1
index 0c954cad7449..a339bd5fa260 100644
@@ -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);
Signature · 1 line
2.20.1