Skip to contentSkip to conversation

ceph: fix a wrong comparison

PATCH In review Anton Protopopov 2 participants 2 messages Feb 10, 2016 – Feb 11, 2016 Ceph client

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ceph: fix a wrong comparison

A negative value rc compared to the positive value ENOENT in the finish_read() function.

---
 fs/ceph/addr.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/ceph/addr.c +1 -1
index c222137..1b809c9 100644
@@ -276,7 +276,7 @@ static void finish_read(struct ceph_osd_request *req, struct ceph_msg *msg)
 	for (i = 0; i < num_pages; i++) {
 		struct page *page = osd_data->pages[i];
 
-		if (rc < 0 && rc != ENOENT)
+		if (rc < 0 && rc != -ENOENT)
 			goto unlock;
 		if (bytes < (int)PAGE_CACHE_SIZE) {
 			/* zero (remainder of) page */
Signature · 1 line
2.6.5
#1 lore raw
Quoted 16 lines · Anton Protopopov

A negative value rc compared to the positive value ENOENT in the finish_read() function.

---
fs/ceph/addr.c | 2 +-

1 file changed, 1 insertion(+), 1 deletion(-)
fs/ceph/addr.c +0 -0
index c222137..1b809c9 100644

fs/ceph/addr.c static void finish_read(struct ceph_osd_request *req, struct ceph_msg *msg) · line 282

Quoted 8 lines
fs/ceph/addr.c +1 -1
@@ -276,7 +276,7 @@ static void finish_read(struct ceph_osd_request *req, struct ceph_msg *msg)
 	for (i = 0; i < num_pages; i++) {
 		struct page *page = osd_data->pages[i];
 
-		if (rc < 0 && rc != ENOENT)
+		if (rc < 0 && rc != -ENOENT)
 			goto unlock;
 		if (bytes < (int)PAGE_CACHE_SIZE) {
 			/* zero (remainder of) page */

Good catch, thanks

Yan, Zheng

Quoted 3 lines
Signature · 1 line
2.6.5