[Bug 206431] New: time stamp of mmaped file not updated
https://bugzilla.novell.com/show_bug.cgi?id=206431 Summary: time stamp of mmaped file not updated Product: SUSE Linux 10.1 Version: Final Platform: i386 OS/Version: SuSE Linux 10.1 Status: NEW Severity: Normal Priority: P5 - None Component: Kernel AssignedTo: kernel-maintainers@forge.provo.novell.com ReportedBy: yxu@novell.com QAContact: qa@suse.de it is about ltp mmap testcase, mmap_14_1: * intention: checks if st_mtime and st_ctime of a file are updated after a write reference to the mapped file (POSIX says they should be marked updated) * test result: st_mtime and st_ctime are not updated * since the test file itself looks fine, so i guess it might be a bug of linux kernel? -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug, or are watching someone who is.
https://bugzilla.novell.com/show_bug.cgi?id=206431 ------- Comment #1 from lmb@novell.com 2006-09-19 03:47 MST ------- POSIX says: === The st_ctime and st_mtime fields of a file that is mapped with MAP_SHARED and ROT_WRITE shall be marked for update at some point in the interval between a write reference to the mapped region and the next call to msync( ) with MS_ASYNC or MS_SYNC for that portion of the file by any process. If there is no such call and if the underlying file is modified as a result of a write reference, then these fields shall be marked for update at some time after the write reference. === This seems to allow for lazy ctime/mtime updates, with an unspecified timing window in between. a) Does the testcase call msync()? Does it call munmap()? b) Can you attach a small testcase here for reproduction? c) This is reported against 10.1; is SLE10 also affected? d) Does it occur on all architectures? (The bug is only reported against i386 and doesn't mention anything else.) -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug, or are watching someone who is.
https://bugzilla.novell.com/show_bug.cgi?id=206431 lmb@novell.com changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |NEEDINFO Info Provider| |yxu@novell.com -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug, or are watching someone who is.
https://bugzilla.novell.com/show_bug.cgi?id=206431 ------- Comment #2 from yxu@novell.com 2006-09-19 08:09 MST ------- Created an attachment (id=99065) --> (https://bugzilla.novell.com/attachment.cgi?id=99065&action=view) mmap/14-1.c testcase this one is a bit modified by me, you can also find the original testcase here: ltp-full-20060412/testcases/open_posix_testsuite/conformance/interfaces/mmap/14-1.c -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug, or are watching someone who is.
https://bugzilla.novell.com/show_bug.cgi?id=206431 yxu@novell.com changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEEDINFO |NEW Info Provider|yxu@novell.com | ------- Comment #3 from yxu@novell.com 2006-09-19 08:13 MST ------- a) it does both. it checks time stamp after munmap b) yes, see the attachment c) i didn't check d) yes, on all based on my colleague's test -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug, or are watching someone who is.
https://bugzilla.novell.com/show_bug.cgi?id=206431 lmb@novell.com changed: What |Removed |Added ---------------------------------------------------------------------------- AssignedTo|kernel- |andrea@novell.com |maintainers@forge.provo.nove| |ll.com | ------- Comment #4 from lmb@novell.com 2006-09-19 08:31 MST ------- OK. Problem confirmed. Thanks. Known bug: Recent upstream discussion starts at http://www.uwsg.iu.edu/hypermail/linux/kernel/0605.2/0593.html http://www.uwsg.iu.edu/hypermail/linux/kernel/0606.2/0602.html No upstream conclusion has been arrived at, though. Andrea, mmap()s are your area, are they not? Can you please drive this one? If he not, please bounce it back to the kernel-maintainers alias. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug, or are watching someone who is.
https://bugzilla.novell.com/show_bug.cgi?id=206431 mszeredi@novell.com changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |ASSIGNED -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug, or are watching someone who is.
https://bugzilla.novell.com/show_bug.cgi?id=206431 mszeredi@novell.com changed: What |Removed |Added ---------------------------------------------------------------------------- AssignedTo|andrea@novell.com |mszeredi@novell.com -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug, or are watching someone who is.
https://bugzilla.novell.com/show_bug.cgi?id=206431 ------- Comment #5 from mszeredi@novell.com 2007-02-21 10:43 MST ------- Created an attachment (id=120356) --> (https://bugzilla.novell.com/attachment.cgi?id=120356&action=view) update mtime and ctime for mmaped write This is against 2.6.20-vanilla. It does require some effort to backport to less recent kernels. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug, or are watching someone who is.
https://bugzilla.novell.com/show_bug.cgi?id=206431 mszeredi@novell.com changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #120356|0 |1 is obsolete| | ------- Comment #6 from mszeredi@novell.com 2007-02-22 05:46 MST ------- Created an attachment (id=120515) --> (https://bugzilla.novell.com/attachment.cgi?id=120515&action=view) update mtime and ctime for mmaped write rev 1 against 2.6.20 -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug, or are watching someone who is.
https://bugzilla.novell.com/show_bug.cgi?id=206431 ------- Comment #7 from mszeredi@novell.com 2007-02-22 05:51 MST ------- Created an attachment (id=120518) --> (https://bugzilla.novell.com/attachment.cgi?id=120518&action=view) update mtime and ctime for mmaped write for SLES10 SP1 This is against 2.6.16. Yi Xu, can you please test if this patch works correctly on SLES10 SP1? -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug, or are watching someone who is.
https://bugzilla.novell.com/show_bug.cgi?id=206431 ------- Comment #8 from yxu@novell.com 2007-02-22 06:24 MST ------- OK, i will test them. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug, or are watching someone who is.
https://bugzilla.novell.com/show_bug.cgi?id=206431 ------- Comment #9 from yxu@novell.com 2007-02-22 08:24 MST ------- hm... Patch for 2.6.16 kernel failed on machine queke133 (10.10.27.133) with SLES10_SP1 installation 2.6.16.37-3-xen kernel. I will attach the output. Two other machines are still running kernel compiling... -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug, or are watching someone who is.
https://bugzilla.novell.com/show_bug.cgi?id=206431 ------- Comment #10 from yxu@novell.com 2007-02-22 08:25 MST ------- Created an attachment (id=120555) --> (https://bugzilla.novell.com/attachment.cgi?id=120555&action=view) strace of mmap14_1 -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug, or are watching someone who is.
https://bugzilla.novell.com/show_bug.cgi?id=206431 ------- Comment #11 from yxu@novell.com 2007-02-22 08:27 MST ------- Created an attachment (id=120556) --> (https://bugzilla.novell.com/attachment.cgi?id=120556&action=view) ctcs2 output of mmap14_1 -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug, or are watching someone who is.
https://bugzilla.novell.com/show_bug.cgi?id=206431 ------- Comment #12 from mszeredi@novell.com 2007-02-22 09:03 MST ------- (In reply to comment #11)
Time before write(): 1172157245 Time before mmap(): 1172157246 Time before write reference: 1172157247 Time before msync(): 1172157250 atime1: 1172157246, atime2: 1172157246 ctime1: 1172157245, ctime2: 1172157250 mtime1: 1172157245, mtime2: 1172157250 Test Fail mmap/14-1.c st_atime was not updated properly
Hmm. Maybe the testcase is wrong. POSIX doesn't say anything about st_atime in msync(). It says that st_atime() must be updated between mmap() and munmap(), and it looks like it _is_ updated in mmap(). -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug, or are watching someone who is.
https://bugzilla.novell.com/show_bug.cgi?id=206431 ------- Comment #13 from yxu@novell.com 2007-02-23 03:14 MST ------- Yes, I didn't update ltp on the machine. The testcase should just compare if ctime and mtime are updated. However I get new results now. Good news is for the patch against 2.6.16 kernel: 1) on x86_64 machine quake133 with 2.6.16.37-3-xen kernel, I did test again. And result looks quite fine: Time before write(): 1172224489 Time before mmap(): 1172224490 Time before write reference: 1172224491 Time before msync(): 1172224492 ctime1: 1172224489, ctime2: 1172224492 mtime1: 1172224489, mtime2: 1172224492 Test Pass And according to my debug code (I changed the first byte of the file and do an msync afterwads), it gives out more output: before mmap ctime00: 1172224515, mtime00: 1172224515 pa, pa, off, size: 34b0c000 a 0 400 pa: a a a after mmap ctime0: 1172224515, mtime0: 1172224515 pa: b a a pa: b a a after msync ctime1: 1172224518, mtime1: 1172224518 pa: c a a pa: c a a after 2nd msync ctime2: 1172224518, mtime2: 1172224518 pa: c a a pa: c a a after 3rd msync ctime02: 1172224518, mtime02: 1172224518 after munmap ctime3: 1172224518, mtime3: 1172224518 2) I did the test on another ix86 machine auake15 with 2.6.16.37-0.18-smp kernel, also succeeded. Time before write(): 1172224065 Time before mmap(): 1172224066 Time before write reference: 1172224067 Time before msync(): 1172224068 ctime1: 1172224065, ctime2: 1172224068 mtime1: 1172224065, mtime2: 1172224068 Test Pass verbose / debug: before mmap ctime00: 1172223829, mtime00: 1172223829 pa, pa, off, size: b7fbe000 a 0 400 pa: a a a after mmap ctime0: 1172223829, mtime0: 1172223829 pa: b a a pa: b a a after msync ctime1: 1172223832, mtime1: 1172223832 pa: c a a pa: c a a after 2nd msync ctime2: 1172223832, mtime2: 1172223832 pa: c a a pa: c a a after 3rd msync ctime02: 1172223832, mtime02: 1172223832 after munmap ctime3: 1172223832, mtime3: 1172223832 Now I am looking for machine with 2.16.20 kernel to test the other patch. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug, or are watching someone who is.
https://bugzilla.novell.com/show_bug.cgi?id=206431 ------- Comment #14 from yxu@novell.com 2007-02-23 05:58 MST ------- hm... the patch against 2.16.20 kernel doesn't work well. I tried with two machines: ia64 machine e45 with 2.6.20-5-default kernel and x86_64 machine quake110 with 2.6.20-4-default kernel. Both failed. Example output: quake110:/tmp/ltp/ltp-full-20061222/testcases/open_posix_testsuite/conformance/interfaces/mmap # ./14-1 Time before write(): 1172235079 Time before mmap(): 1172235080 Time before write reference: 1172235081 Time before msync(): 1172235082 ctime1: 1172235079, ctime2: 1172235079 mtime1: 1172235079, mtime2: 1172235079 Test Fail mmap/14-1.c st_ctime and st_mtime were not updated properly quake110:/tmp/ltp/ltp-full-20061222/testcases/open_posix_testsuite/conformance/interfaces/mmap # ./mmap_14_1-debug before mmap ctime00: 1172235087, mtime00: 1172235087 pa, pa, off, size: efd85000 a 0 400 pa: a a a after mmap ctime0: 1172235087, mtime0: 1172235087 pa: b a a pa: b a a after msync ctime1: 1172235087, mtime1: 1172235087 pa: c a a pa: c a a after 2nd msync ctime2: 1172235087, mtime2: 1172235087 pa: c a a pa: c a a after 3rd msync ctime02: 1172235090, mtime02: 1172235090 after munmap ctime3: 1172235090, mtime3: 1172235090 I will attach strace of it. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug, or are watching someone who is.
https://bugzilla.novell.com/show_bug.cgi?id=206431 ------- Comment #15 from yxu@novell.com 2007-02-23 06:03 MST ------- Created an attachment (id=120757) --> (https://bugzilla.novell.com/attachment.cgi?id=120757&action=view) strace of mmap14_1 on quake110 (10.10.27.110) -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug, or are watching someone who is.
https://bugzilla.novell.com/show_bug.cgi?id=206431 ------- Comment #16 from yxu@novell.com 2007-02-23 06:04 MST ------- Created an attachment (id=120758) --> (https://bugzilla.novell.com/attachment.cgi?id=120758&action=view) strace of mmap14_1 on e45 (10.10.101.45) -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug, or are watching someone who is.
https://bugzilla.novell.com/show_bug.cgi?id=206431 ------- Comment #17 from mszeredi@novell.com 2007-02-23 06:10 MST ------- (In reply to comment #14)
hm... the patch against 2.16.20 kernel doesn't work well.
I tried with two machines: ia64 machine e45 with 2.6.20-5-default kernel and x86_64 machine quake110 with 2.6.20-4-default kernel. Both failed. Example output:
Strange. I have actually tested the patch for 2.6.20 on i386 and it worked fine. And I don't think there's any architecture dependency. Are you sure about using the patched kernel? -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug, or are watching someone who is.
https://bugzilla.novell.com/show_bug.cgi?id=206431 ------- Comment #18 from yxu@novell.com 2007-02-23 06:25 MST ------- hm.. it should be patched kernel. With those two machines, I updated kernel, patched kernel, compiled it and installed it, had a look of /boot and boot menu and then rebooted. And I had a look of relevant kernel source files that should be modified by the patch, and all seem fine. Would you have a look of those two machines and confirm or find out what I missed? -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug, or are watching someone who is.
https://bugzilla.novell.com/show_bug.cgi?id=206431 mszeredi@novell.com changed: What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |RESOLVED Resolution| |FIXED ------- Comment #19 from mszeredi@novell.com 2007-02-28 02:00 MST ------- Fix added to SLES10_SP1_BRANCH, and submitted upstream. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug, or are watching someone who is.
https://bugzilla.novell.com/show_bug.cgi?id=206431 yxu@novell.com changed: What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED ------- Comment #20 from yxu@novell.com 2007-02-28 10:07 MST ------- Yes, finally I got my tests PASS on 3 machines. One machine (e45) seems lost, no one knows where it locats in our lab. But I think we can close the bug now. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug, or are watching someone who is.
participants (1)
-
bugzilla_noreply@novell.com