Skip to contentSkip to conversation

mm: softdirty: keep bit when zapping file pte

PATCH In review Peter Feiner 3 participants 5 messages Sep 20, 2014 – Sep 25, 2014

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mm: softdirty: keep bit when zapping file pte

Fixes the same bug as b43790eedd31e9535b89bbfa45793919e9504c34 and 9aed8614af5a05cdaa32a0b78b0f1a424754a958 where the return value of pte_*mksoft_dirty was being ignored.

To be sure that no other pte/pmd "mk" function return values were being ignored, I annotated the functions in arch/x86/include/asm/pgtable.h with __must_check and rebuilt.

---
 mm/memory.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
mm/memory.c +1 -1
index adeac30..fc46934 100644
@@ -1125,7 +1125,7 @@ again:
 						addr) != page->index) {
 				pte_t ptfile = pgoff_to_pte(page->index);
 				if (pte_soft_dirty(ptent))
-					pte_file_mksoft_dirty(ptfile);
+					ptfile = pte_file_mksoft_dirty(ptfile);
 				set_pte_at(mm, addr, pte, ptfile);
 			}
 			if (PageAnon(page))
Signature · 7 lines
2.1.0.rc2.206.gedb03e5

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to [email protected].  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
Acked-by on v1 1/1
#1 lore raw
Quoted 9 lines · Peter Feiner

Fixes the same bug as b43790eedd31e9535b89bbfa45793919e9504c34 and 9aed8614af5a05cdaa32a0b78b0f1a424754a958 where the return value of pte_*mksoft_dirty was being ignored.

To be sure that no other pte/pmd "mk" function return values were being ignored, I annotated the functions in arch/x86/include/asm/pgtable.h with __must_check and rebuilt.

I might be missing it, thanks a huge Peter!

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>

maintainer
#2 lore raw
In reply to Peter Feiner
Quoted 8 lines · On Sat, 20 Sep 2014 01:03:07 -0700 Peter Feiner <[email protected]> wrote:

Fixes the same bug as b43790eedd31e9535b89bbfa45793919e9504c34 and 9aed8614af5a05cdaa32a0b78b0f1a424754a958 where the return value of pte_*mksoft_dirty was being ignored.

To be sure that no other pte/pmd "mk" function return values were being ignored, I annotated the functions in arch/x86/include/asm/pgtable.h with __must_check and rebuilt.

Grumble.

It is useful to identify preceding similar patches but that isn't a good way of describing *this* patch. What is wrong with the current code, how does the patch fix it.

And, particularly, what do you think are the end-user visible effects of the bug? This info helps people to work out which kernel versions need the fix.

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>

#3 lore raw
Quoted 2 lines · Andrew Morton

On Sat, 20 Sep 2014 01:03:07 -0700 Peter Feiner <[email protected]>

Quoted 12 lines · wrote:
Quoted 9 lines

Fixes the same bug as b43790eedd31e9535b89bbfa45793919e9504c34 and 9aed8614af5a05cdaa32a0b78b0f1a424754a958 where the return value of pte_*mksoft_dirty was being ignored.

To be sure that no other pte/pmd "mk" function return values were being ignored, I annotated the functions in arch/x86/include/asm/pgtable.h with __must_check and rebuilt.

Grumble.

Quoted 8 lines

It is useful to identify preceding similar patches but that isn't a good way of describing *this* patch. What is wrong with the current code, how does the patch fix it.

And, particularly, what do you think are the end-user visible effects of the bug? This info helps people to work out which kernel versions need the fix.

Let me think about this and cook up a test case. I'll submit a v2 with a better description.

Peter

#4 lore raw
In reply to Andrew Morton
Quoted 11 lines · Andrew Morton
Quoted 8 lines · On Sat, 20 Sep 2014 01:03:07 -0700 Peter Feiner <[email protected]> wrote:

Fixes the same bug as b43790eedd31e9535b89bbfa45793919e9504c34 and 9aed8614af5a05cdaa32a0b78b0f1a424754a958 where the return value of pte_*mksoft_dirty was being ignored.

To be sure that no other pte/pmd "mk" function return values were being ignored, I annotated the functions in arch/x86/include/asm/pgtable.h with __must_check and rebuilt.

Quoted 5 lines

Grumble.

It is useful to identify preceding similar patches but that isn't a good way of describing *this* patch. What is wrong with the current code, how does the patch fix it.

The userspace effect is that without this patch softdirty mark might be lost if file mapped pte get zapped. It should go into @stable series after 3.12.

Quoted 4 lines

And, particularly, what do you think are the end-user visible effects of the bug? This info helps people to work out which kernel versions need the fix.

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>