linux-next.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Re: [PATCH v3 2/2] lib/scatterlist: use page iterator in the mapping iterator
       [not found] ` <1360768224-18163-2-git-send-email-imre.deak@intel.com>
@ 2013-02-23  4:29   ` Stephen Warren
  2013-02-23 20:04     ` Imre Deak
  2013-02-23 23:45     ` Stephen Warren
  0 siblings, 2 replies; 3+ messages in thread
From: Stephen Warren @ 2013-02-23  4:29 UTC (permalink / raw)
  To: Imre Deak
  Cc: linux-kernel, Andrew Morton, Maxim Levitsky, Tejun Heo,
	Daniel Vetter, linaro-mm-sig, linux-next

On 02/13/2013 08:10 AM, Imre Deak wrote:
> For better code reuse use the newly added page iterator to iterate
> through the pages. The offset, length within the page is still
> calculated by the mapping iterator as well as the actual mapping.
> Idea from Tejun Heo <tj@kernel.org>.

This patch appears in linux-next since next-20130220. It breaks mounting
a root filesystem on an SD card on the Raspberry Pi ARM platform, with
errors such as those shown below.

next-20130222 with just this patch reverted works fine.

> [    0.708426] VFS: Mounted root (ext4 filesystem) on device 179:2.
> [    0.723742] devtmpfs: mounted
> [    0.733064] Freeing init memory: 204K
> [    0.777992] EXT4-fs error (device mmcblk0p2): ext4_iget:3814: inode #4259: comm swapper: bad extra_isize (57200 != 256)
> [    0.815172] EXT4-fs error (device mmcblk0p2): ext4_lookup:1428: inode #8198: comm swapper: deleted inode referenced: 487
> [    0.826179] Kernel panic - not syncing: No init found.  Try passing init= option to kernel. See Linux Documentation/init.txt for guidance.

> [    0.719365] VFS: Mounted root (ext4 filesystem) on device 179:2.
> [    0.740918] devtmpfs: mounted
> [    0.745219] Freeing init memory: 204K
> ERROR: ld.so: object '/usr/lib/arm-linux-gnueabihf/libcofi_rpi.so' from /etc/ld.so.preload cannot be preloaded: ignored.
> [    0.906840] Kernel panic - not syncing: Attempted to kill init! exitcode=0x0000000b

> [    0.724018] VFS: Mounted root (ext4 filesystem) on device 179:2.
> [    0.739404] devtmpfs: mounted
> [    0.748741] Freeing init memory: 204K
> [    0.793603] EXT4-fs error (device mmcblk0p2): ext4_iget:3814: inode #4259: comm swapper: bad extra_isize (57200 != 256)
> [    0.822138] Kernel panic - not syncing: No init found.  Try passing init= option to kernel. See Linux Documentation/init.txt for guidance.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH v3 2/2] lib/scatterlist: use page iterator in the mapping iterator
  2013-02-23  4:29   ` [PATCH v3 2/2] lib/scatterlist: use page iterator in the mapping iterator Stephen Warren
@ 2013-02-23 20:04     ` Imre Deak
  2013-02-23 23:45     ` Stephen Warren
  1 sibling, 0 replies; 3+ messages in thread
From: Imre Deak @ 2013-02-23 20:04 UTC (permalink / raw)
  To: Stephen Warren
  Cc: linux-kernel, Andrew Morton, Maxim Levitsky, Tejun Heo,
	Daniel Vetter, linaro-mm-sig, linux-next

On Fri, 2013-02-22 at 21:29 -0700, Stephen Warren wrote:
> On 02/13/2013 08:10 AM, Imre Deak wrote:
> > For better code reuse use the newly added page iterator to iterate
> > through the pages. The offset, length within the page is still
> > calculated by the mapping iterator as well as the actual mapping.
> > Idea from Tejun Heo <tj@kernel.org>.
> 
> This patch appears in linux-next since next-20130220. It breaks mounting
> a root filesystem on an SD card on the Raspberry Pi ARM platform, with
> errors such as those shown below.
> 
> next-20130222 with just this patch reverted works fine.

Thanks for tracking this down. I noticed now an obvious mistake I've
made, not limiting the mapping size to page size :/ I didn't hit it
since it only causes a problem when the user of miter modifies
miter->consumed and I think nothing does this on my machine. Since the
sdhci driver on Raspberry Pi does this the following might fix the
problem you saw. Could you give it a try? It applies on top of
v4 of the patch [1]:

diff --git a/lib/scatterlist.c b/lib/scatterlist.c
index 2645acf..b83c144 100644
--- a/lib/scatterlist.c
+++ b/lib/scatterlist.c
@@ -493,6 +493,8 @@ bool sg_miter_next(struct sg_mapping_iter *miter)
 		miter->__offset = pgoffset ? 0 : sg->offset;
 		miter->__remaining = sg->offset + sg->length -
 				(pgoffset << PAGE_SHIFT) - miter->__offset;
+		miter->__remaining = min_t(unsigned long, miter->__remaining,
+					   PAGE_SIZE - miter->__offset);
 	}
 	miter->page = miter->piter.page;
 	miter->consumed = miter->length = miter->__remaining;


--Imre

[1]
http://lists.linaro.org/pipermail/linaro-mm-sig/2013-February/003069.html

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH v3 2/2] lib/scatterlist: use page iterator in the mapping iterator
  2013-02-23  4:29   ` [PATCH v3 2/2] lib/scatterlist: use page iterator in the mapping iterator Stephen Warren
  2013-02-23 20:04     ` Imre Deak
@ 2013-02-23 23:45     ` Stephen Warren
  1 sibling, 0 replies; 3+ messages in thread
From: Stephen Warren @ 2013-02-23 23:45 UTC (permalink / raw)
  To: Imre Deak
  Cc: linux-kernel, Andrew Morton, Maxim Levitsky, Tejun Heo,
	Daniel Vetter, linaro-mm-sig, linux-next

On Sat, 23 Feb 2013 22:04:06 +0200, Imre Deak wrote:
> On Fri, 2013-02-22 at 21:29 -0700, Stephen Warren wrote:
>> On 02/13/2013 08:10 AM, Imre Deak wrote:
>>> For better code reuse use the newly added page iterator to iterate
>>> through the pages. The offset, length within the page is still
>>> calculated by the mapping iterator as well as the actual mapping.
>>> Idea from Tejun Heo <tj@kernel.org>.
>>
>> This patch appears in linux-next since next-20130220. It breaks mounting
>> a root filesystem on an SD card on the Raspberry Pi ARM platform, with
>> errors such as those shown below.
>>
>> next-20130222 with just this patch reverted works fine.
> 
> ...
> the following might fix the
> problem you saw. Could you give it a try? It applies on top of
> v4 of the patch [1]:

Yes, thanks very much. That incremental patch you gave solves the
problem perfectly.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2013-02-23 23:45 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <1360768224-18163-1-git-send-email-imre.deak@intel.com>
     [not found] ` <1360768224-18163-2-git-send-email-imre.deak@intel.com>
2013-02-23  4:29   ` [PATCH v3 2/2] lib/scatterlist: use page iterator in the mapping iterator Stephen Warren
2013-02-23 20:04     ` Imre Deak
2013-02-23 23:45     ` Stephen Warren

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).