Skip to contentSkip to conversation

Ceph: allocate non-zero page to fscache in readpage()

PATCH In review Li Wang 3 participants 3 messages Nov 9, 2013

Subsystems (2)
lore
Share & tools
lore

Li Wang

author
#0 lore raw

PATCH 1/1 Ceph: allocate non-zero page to fscache in readpage()

ceph_osdc_readpages() returns number of bytes read, currently, the code only allocate full-zero page into fscache, this patch fixes this.

---
 fs/ceph/addr.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/ceph/addr.c +1 -1
index 6df8bd4..1e561c0 100644
@@ -216,7 +216,7 @@ static int readpage_nounlock(struct file *filp, struct page *page)
 	}
 	SetPageUptodate(page);
 
-	if (err == 0)
+	if (err >= 0)
 		ceph_readpage_to_fscache(inode, page);
 
 out:
Signature · 1 line
1.7.9.5
#1 lore raw

Li, that's a good good catch.

Quoted 25 lines · Li Wang

ceph_osdc_readpages() returns number of bytes read, currently, the code only allocate full-zero page into fscache, this patch fixes this.

---
 fs/ceph/addr.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/ceph/addr.c +1 -2
index 6df8bd4..1e561c0 100644
@@ -216,7 +216,7 @@ static int readpage_nounlock(struct file *filp, struct page *page)
        }
        SetPageUptodate(page);
 
-       if (err == 0)
+       if (err >= 0)
                ceph_readpage_to_fscache(inode, page);
 
 out:
--

1.7.9.5

Signature · 7 lines
Milosz Tanski
CTO
10 East 53rd Street, 37th floor
New York, NY 10022

p: 646-253-9055
e: [email protected]
#2 lore raw

Added to the testing branch.

Thanks!

Quoted 46 lines · Milosz Tanski

Li, that's a good good catch.

fs/ceph/addr.c static int readpage_nounlock(struct file *filp,

Quoted 14 lines · Li Wang

ceph_osdc_readpages() returns number of bytes read, currently, the code only allocate full-zero page into fscache, this patch fixes this.

---
 fs/ceph/addr.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/ceph/addr.c +0 -0
index 6df8bd4..1e561c0 100644
@@ -216,7 +216,7 @@ static int readpage_nounlock(struct file *filp,

struct page *page)

Quoted 11 lines
fs/ceph/addr.c +1 -2
        }
        SetPageUptodate(page);
 
-       if (err == 0)
+       if (err >= 0)
                ceph_readpage_to_fscache(inode, page);
 
 out:
--

1.7.9.5

Signature · 12 lines
Milosz Tanski
CTO
10 East 53rd Street, 37th floor
New York, NY 10022

p: 646-253-9055
e: [email protected]
--
To unsubscribe from this list: send the line "unsubscribe ceph-devel"
in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html