Re: [Suspend-devel] [PATCH] Avoid modifying file access time after creating the image
Hi! Well, but if some data structures are different than the tmpfs driver thinks they are, the kernel could oops/panic at umount, couldn't it? Yes, it could, but they won't be. After a successful resume the tmpfs will be in the same state as before the suspend, won't it? Ah, ok. That's the detail that i forgot. [The problem with disk filesystems is they tend to preserve data across the suspend-resume cycle. ;-)] Yes, which is of course a different issue. No objections from my side, then :-) Thanks. Appended is the version of the patch I'd like to apply if there are no objections. Please note this patch will be _necessary_ for s2disk/s2both to work if the kernel starts to carry out the freezeing of bdevs during the suspend (not implemented yet, but coming). Looks good to me... @@ -66,7 +67,9 @@ static char password[PASS_SIZE]; #define encrypt 0 #define key_name NULL #endif +#ifdef CONFIG_BOTH static char s2ram; +#endif I'd say that unused variable is less evil than ifdef... @@ -1221,6 +1226,10 @@ int main(int argc, char *argv[]) } #endif + chroot_path = malloc(MAX_STR_LEN); + if (!chroot_path) + goto Free; + Can we just allocate it statically? Pavel -- (english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html - Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnkkid=120709bid=263057dat=121642 ___ Suspend-devel mailing list Suspend-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/suspend-devel
Re: [Suspend-devel] [PATCH] Avoid modifying file access time after creating the image
On Wed 2006-11-01 11:10:46, Rafael J. Wysocki wrote: Hi, On Wednesday, 1 November 2006 10:57, Pavel Machek wrote: Hi! Well, but if some data structures are different than the tmpfs driver thinks they are, the kernel could oops/panic at umount, couldn't it? Yes, it could, but they won't be. After a successful resume the tmpfs will be in the same state as before the suspend, won't it? Ah, ok. That's the detail that i forgot. [The problem with disk filesystems is they tend to preserve data across the suspend-resume cycle. ;-)] Yes, which is of course a different issue. No objections from my side, then :-) Thanks. Appended is the version of the patch I'd like to apply if there are no objections. Please note this patch will be _necessary_ for s2disk/s2both to work if the kernel starts to carry out the freezeing of bdevs during the suspend (not implemented yet, but coming). Looks good to me... @@ -66,7 +67,9 @@ static char password[PASS_SIZE]; #define encrypt 0 #define key_name NULL #endif +#ifdef CONFIG_BOTH static char s2ram; +#endif I'd say that unused variable is less evil than ifdef... Without the #ifdef the gcc spits a warning somewhere below. Ok then, go ahead with commit... Pavel -- (english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html - Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnkkid=120709bid=263057dat=121642 ___ Suspend-devel mailing list Suspend-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/suspend-devel
Re: [Suspend-devel] [PATCH] Avoid modifying file access time after creating the image
On Wednesday, 1 November 2006 11:13, Pavel Machek wrote: On Wed 2006-11-01 11:10:46, Rafael J. Wysocki wrote: Hi, On Wednesday, 1 November 2006 10:57, Pavel Machek wrote: Hi! Well, but if some data structures are different than the tmpfs driver thinks they are, the kernel could oops/panic at umount, couldn't it? Yes, it could, but they won't be. After a successful resume the tmpfs will be in the same state as before the suspend, won't it? Ah, ok. That's the detail that i forgot. [The problem with disk filesystems is they tend to preserve data across the suspend-resume cycle. ;-)] Yes, which is of course a different issue. No objections from my side, then :-) Thanks. Appended is the version of the patch I'd like to apply if there are no objections. Please note this patch will be _necessary_ for s2disk/s2both to work if the kernel starts to carry out the freezeing of bdevs during the suspend (not implemented yet, but coming). Looks good to me... @@ -66,7 +67,9 @@ static char password[PASS_SIZE]; #define encrypt 0 #define key_name NULL #endif +#ifdef CONFIG_BOTH static char s2ram; +#endif I'd say that unused variable is less evil than ifdef... Without the #ifdef the gcc spits a warning somewhere below. Ok then, go ahead with commit... Done. Rafael -- You never change things by fighting the existing reality. R. Buckminster Fuller - Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnkkid=120709bid=263057dat=121642 ___ Suspend-devel mailing list Suspend-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/suspend-devel
Re: [Suspend-devel] [PATCH] Avoid modifying file access time after creating the image
On Mon, Oct 30, 2006 at 10:36:46AM +0100, Tim Dijkstra wrote: On Mon, 30 Oct 2006 00:20:50 +0100 Rafael J. Wysocki [EMAIL PROTECTED] wrote: Unfortunately in its current form s2disk causes the access time of the resume device special file to be updated after the suspend image has been created, which is potentially dangerous. Why is that dangerous? modifying filesystems while suspended (or better: between snapshot creation and restore time) is dangerous, because after resume, the on-disk state is probably different than what the kernel thinks it is. There are prominent examples of people who just booted knoppix to get a file off that partition on a suspended system. Usually it ends with nasty file system corruption and data loss (since it might do unnoticed for some time and the longer it takes to show up, the heavier the corruptions will probably be). I _believe_ that it is probably mostly harmless for this atime change, and i am not sure if the cure is better or worse than the disease, but there is a potential problem. I am no filesystem expert at all, so take all this with a grain of salt. -- Stefan Seyfried QA / RD Team Mobile Devices| Any ideas, John? SUSE LINUX Products GmbH, Nürnberg | Well, surrounding them's out. - Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnkkid=120709bid=263057dat=121642 ___ Suspend-devel mailing list Suspend-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/suspend-devel
Re: [Suspend-devel] [PATCH] Avoid modifying file access time after creating the image
On Monday, 30 October 2006 09:37, Stefan Seyfried wrote: On Mon, Oct 30, 2006 at 12:20:50AM +0100, Rafael J. Wysocki wrote: Hi, Unfortunately in its current form s2disk causes the access time of the resume device special file to be updated after the suspend image has been created, which is potentially dangerous. We can fix this by mounting a tmpfs, creating the special device file on it and using this file for the suspend, which is done in the appended patch. But the access time of the device on the tmpfs will also be corrupt, and the kernel may go boom when unmounting that tmpfs (just theoretical, but maybe the cure is worse than the disease)? No. tmpfs is in RAM. ;-) --- suspend.c | 63 +- 1 file changed, 46 insertions(+), 17 deletions(-) Index: suspend/suspend.c === --- suspend.orig/suspend.c +++ suspend/suspend.c @@ -1230,23 +1239,43 @@ int main(int argc, char *argv[]) return ret; } + sprintf(chroot_path, /proc/%d, getpid()); + if (mount(none, chroot_path, tmpfs, 0, NULL)) { + fprintf(stderr, suspend: Could not mount tmpfs on %s\n, chroot_path); + return errno; you might return the errno of the failed fprintf here :-). Yes, thanks. -- You never change things by fighting the existing reality. R. Buckminster Fuller - Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnkkid=120709bid=263057dat=121642 ___ Suspend-devel mailing list Suspend-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/suspend-devel
Re: [Suspend-devel] [PATCH] Avoid modifying file access time after creating the image
On Mon, Oct 30, 2006 at 11:57:47AM +0100, Rafael J. Wysocki wrote: On Monday, 30 October 2006 09:37, Stefan Seyfried wrote: On Mon, Oct 30, 2006 at 12:20:50AM +0100, Rafael J. Wysocki wrote: Hi, Unfortunately in its current form s2disk causes the access time of the resume device special file to be updated after the suspend image has been created, which is potentially dangerous. We can fix this by mounting a tmpfs, creating the special device file on it and using this file for the suspend, which is done in the appended patch. But the access time of the device on the tmpfs will also be corrupt, and the kernel may go boom when unmounting that tmpfs (just theoretical, but maybe the cure is worse than the disease)? No. tmpfs is in RAM. ;-) Well, but if some data structures are different than the tmpfs driver thinks they are, the kernel could oops/panic at umount, couldn't it? And today, /dev/ is on tmpfs also :-) I'm not saying that there _will_ be problems, but there _might_ be. -- Stefan Seyfried QA / RD Team Mobile Devices| Any ideas, John? SUSE LINUX Products GmbH, Nürnberg | Well, surrounding them's out. - Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnkkid=120709bid=263057dat=121642 ___ Suspend-devel mailing list Suspend-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/suspend-devel
Re: [Suspend-devel] [PATCH] Avoid modifying file access time after creating the image
On Mon, Oct 30, 2006 at 12:26:55PM +0100, Rafael J. Wysocki wrote: Well, but if some data structures are different than the tmpfs driver thinks they are, the kernel could oops/panic at umount, couldn't it? Yes, it could, but they won't be. After a successful resume the tmpfs will be in the same state as before the suspend, won't it? Ah, ok. That's the detail that i forgot. [The problem with disk filesystems is they tend to preserve data across the suspend-resume cycle. ;-)] Yes, which is of course a different issue. No objections from my side, then :-) -- Stefan Seyfried QA / RD Team Mobile Devices| Any ideas, John? SUSE LINUX Products GmbH, Nürnberg | Well, surrounding them's out. - Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnkkid=120709bid=263057dat=121642 ___ Suspend-devel mailing list Suspend-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/suspend-devel