All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alex Elder <elder@inktank.com>
To: "ceph-devel@vger.kernel.org" <ceph-devel@vger.kernel.org>
Subject: [PATCH 1/9] ceph: use page_offset() in ceph_writepages_start()
Date: Thu, 04 Apr 2013 11:18:18 -0500	[thread overview]
Message-ID: <515DA7CA.4040808@inktank.com> (raw)
In-Reply-To: <515DA755.2090504@inktank.com>

There's one spot in ceph_writepages_start() that open-codes what
page_offset() does safely.  Use the macro so we don't have to worry
about wrapping.

This resolves:
    http://tracker.ceph.com/issues/4648

Signed-off-by: Alex Elder <elder@inktank.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 67d4965..6a5a08e 100644
--- a/fs/ceph/addr.c
+++ b/fs/ceph/addr.c
@@ -900,7 +900,7 @@ get_more_pages:
 		}

 		/* submit the write */
-		offset = req->r_data_out.pages[0]->index << PAGE_CACHE_SHIFT;
+		offset = page_offset(req->r_data_out.pages[0]);
 		len = min((snap_size ? snap_size : i_size_read(inode)) - offset,
 			  (u64)locked_pages << PAGE_CACHE_SHIFT);
 		dout("writepages got %d pages at %llu~%llu\n",
-- 
1.7.9.5


  reply	other threads:[~2013-04-04 16:18 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-04 16:16 [PATCH 0/9] Alex Elder
2013-04-04 16:18 ` Alex Elder [this message]
2013-04-04 16:18 ` [PATCH 2/9] libceph: drop ceph_osd_request->r_con_filling_msg Alex Elder
2013-04-04 16:18 ` [PATCH 3/9] libceph: record length of bio list with bio Alex Elder
2013-04-04 16:19 ` [PATCH 4/9] libceph: record message data length Alex Elder
2013-04-04 18:34   ` [PATCH 4/9, v2] " Alex Elder
2013-04-04 16:19 ` [PATCH 5/9] libceph: don't build request in ceph_osdc_new_request() Alex Elder
2013-04-04 16:19 ` [PATCH 6/9] ceph: define ceph_writepages_osd_request() Alex Elder
2013-04-04 16:19 ` [PATCH 7/9] ceph: kill ceph alloc_page_vec() Alex Elder
2013-04-04 16:20 ` [PATCH 8/9] libceph: hold off building osd request Alex Elder
2013-04-04 16:20 ` [PATCH 9/9] ceph: build osd request message later for writepages Alex Elder
2013-04-05  3:03 ` [PATCH 0/9] Josh Durgin
2013-04-05 12:09   ` Alex Elder

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=515DA7CA.4040808@inktank.com \
    --to=elder@inktank.com \
    --cc=ceph-devel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.