ceph: fix a wrong comparison
diff mbox

Message ID 1455125883-27735-1-git-send-email-a.s.protopopov@gmail.com
State New
Headers show

Commit Message

Anton Protopopov Feb. 10, 2016, 5:38 p.m. UTC
A negative value rc compared to the positive value ENOENT in the
finish_read() function.

Signed-off-by: Anton Protopopov <a.s.protopopov@gmail.com>
---
 fs/ceph/addr.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Yan, Zheng Feb. 11, 2016, 2:52 a.m. UTC | #1
> On Feb 11, 2016, at 01:38, Anton Protopopov <a.s.protopopov@gmail.com> wrote:
> 
> A negative value rc compared to the positive value ENOENT in the
> finish_read() function.
> 
> Signed-off-by: Anton Protopopov <a.s.protopopov@gmail.com>
> ---
> fs/ceph/addr.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/fs/ceph/addr.c b/fs/ceph/addr.c
> index c222137..1b809c9 100644
> --- a/fs/ceph/addr.c
> +++ b/fs/ceph/addr.c
> @@ -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

> -- 
> 2.6.5
> 

--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Patch
diff mbox

diff --git a/fs/ceph/addr.c b/fs/ceph/addr.c
index c222137..1b809c9 100644
--- a/fs/ceph/addr.c
+++ b/fs/ceph/addr.c
@@ -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 */