Skip to contentSkip to conversation

libxfs: capture error return of cache_node_allocate()

PATCH In review Eric Sandeen 3 participants 3 messages Nov 6 – Nov 9

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 libxfs: capture error return of cache_node_allocate()

I guess during the revisions of this series I managed to lose the actual error return of the cache node allocation failure, which pretty much defeated the purpose of the change. Fix that.

Fixes 92d45f83 ("libxfs: Return -ENOMEM on actual cache node allocation failures")
---
 libxfs/cache.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
libxfs/cache.c +1 -1
index 5cf6bef1..81509cee 100644
@@ -475,7 +475,7 @@ next_object:
 		/*
 		 * not found, allocate a new entry
 		 */
-		cache_node_allocate(cache, key, &node);
+		error = cache_node_allocate(cache, key, &node);
 		if (node)
 			break;
 
Signature · 1 line
2.56.0
Reviewed-by on v1 1/1
#1 lore raw
Quoted 2 lines · Eric Sandeen

I guess during the revisions of this series I managed to lose the actual error return of the cache node allocation failure

nope, that's me, I dropped the hunk with if (error > 0) based on the review, while applying. Didn't noticed the 'error =' is actually what matters here, sorry :(

Quoted 26 lines

, which pretty
much defeated the purpose of the change. Fix that.

Fixes 92d45f83 ("libxfs: Return -ENOMEM on actual cache node allocation failures")
---
 libxfs/cache.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
libxfs/cache.c +1 -1
index 5cf6bef1..81509cee 100644
@@ -475,7 +475,7 @@ next_object:
 		/*
 		 * not found, allocate a new entry
 		 */
-		cache_node_allocate(cache, key, &node);
+		error = cache_node_allocate(cache, key, &node);
 		if (node)
 			break;
 
Signature · 1 line
2.56.0

Looks good to me

Signature · 1 line
- Andrey
#2 lore raw
Quoted 7 lines · Andrey Albershteyn
Quoted 2 lines · Eric Sandeen

I guess during the revisions of this series I managed to lose the actual error return of the cache node allocation failure

nope, that's me, I dropped the hunk with if (error > 0) based on the review, while applying. Didn't noticed the 'error =' is actually what matters here, sorry :(

hehe ok :) In that case we might want to change the commit log here?

Thanks,
-Eric

Quoted 30 lines
Quoted 26 lines

, which pretty
much defeated the purpose of the change. Fix that.

Fixes 92d45f83 ("libxfs: Return -ENOMEM on actual cache node allocation failures")
---
 libxfs/cache.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
libxfs/cache.c +1 -1
index 5cf6bef1..81509cee 100644
@@ -475,7 +475,7 @@ next_object:
 		/*
 		 * not found, allocate a new entry
 		 */
-		cache_node_allocate(cache, key, &node);
+		error = cache_node_allocate(cache, key, &node);
 		if (node)
 			break;
 
Signature · 1 line
2.56.0

Looks good to me