diff mbox

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

Message ID 1383963966-10888-1-git-send-email-liwang@ubuntukylin.com (mailing list archive)
State New, archived
Headers show

Commit Message

Li Wang Nov. 9, 2013, 2:26 a.m. UTC
ceph_osdc_readpages() returns number of bytes read, currently,
the code only allocate full-zero page into fscache, this patch
fixes this.

Signed-off-by: Li Wang <liwang@ubuntukylin.com>
---
 fs/ceph/addr.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Milosz Tanski Nov. 9, 2013, 3:19 p.m. UTC | #1
Li, that's a good good catch.


On Fri, Nov 8, 2013 at 9:26 PM, Li Wang <liwang@ubuntukylin.com> wrote:
> ceph_osdc_readpages() returns number of bytes read, currently,
> the code only allocate full-zero page into fscache, this patch
> fixes this.
>
> Signed-off-by: Li Wang <liwang@ubuntukylin.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 6df8bd4..1e561c0 100644
> --- a/fs/ceph/addr.c
> +++ b/fs/ceph/addr.c
> @@ -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
>
diff mbox

Patch

diff --git a/fs/ceph/addr.c b/fs/ceph/addr.c
index 6df8bd4..1e561c0 100644
--- a/fs/ceph/addr.c
+++ b/fs/ceph/addr.c
@@ -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: