diff --git a/fs/jbd2/transaction.c b/fs/jbd2/transaction.c
index 10b5e3b1ca8b36ce32c1a978bf492fddd2bb9744..80f9b2a3880b1be1af7b9138f5dfdea93ff3a6bd 100644
--- a/fs/jbd2/transaction.c
+++ b/fs/jbd2/transaction.c
@@ -774,7 +774,7 @@ do_get_write_access(handle_t *handle, struct journal_head *jh,
 		J_EXPECT_JH(jh, buffer_uptodate(jh2bh(jh)),
 			    "Possible IO failure.\n");
 		page = jh2bh(jh)->b_page;
-		offset = ((unsigned long) jh2bh(jh)->b_data) & ~PAGE_MASK;
+		offset = offset_in_page(jh2bh(jh)->b_data);
 		source = kmap_atomic(page, KM_USER0);
 		/* Fire data frozen trigger just before we copy the data */
 		jbd2_buffer_frozen_trigger(jh, source + offset,