Re: [PATCH v7 3.2-rc2 9/30] uprobes: Background page replacement.

From: Peter Zijlstra
Date: Fri Nov 25 2011 - 09:29:11 EST


On Fri, 2011-11-18 at 16:38 +0530, Srikar Dronamraju wrote:
> + /* poke the new insn in, ASSUMES we don't cross page boundary */
> + vaddr &= ~PAGE_MASK;
> + memcpy(vaddr_new + vaddr, &opcode, uprobe_opcode_sz);

I still don't get why you don't simply write something like:

BUG_ON(vaddr + uprobe_opcode_size >= PAGE_SIZE);

That's as descriptive as the comment and actually does something if
someone got it wrong, instead of silently corrupting crap.

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/