[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-core-devel
Subject:    Re: File corruption with KSaveFile on full disk
From:       Michael Pyne <mpyne () purinchu ! net>
Date:       2009-01-18 0:29:36
Message-ID: 200901171929.37773.mpyne () purinchu ! net
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


On Saturday 17 January 2009, Sebastian Sauer wrote:
> Michael Leupold wrote:
> > Hi,
> >
> > I received a bugreport about someone loosing his wallet today. Basically
> > a process filled his disk while the wallet was open. On closing it
> > something went terribly wrong and he ended up with a kdewallet.kwl with
> > size 0.
> >
> > I'm pretty much stuck because I couldn't reproduce myself but I assumed
> > this couldn't happen as kwalletd's backend uses KSaveFile to make sure
> > either the whole wallet gets saved or nothing. As KSaveFile seems to be
> > currently unmaintained I hope someone of you knows if it's supposed to
> > handle full disk and if there's a corner case where this might indeed
> > lead to corruption.
> >
> > The bugreport is: http://bugs.kde.org/show_bug.cgi?id=181059
> >
> > Thanks and regards,
> > Michael
>
> in the method Backend::sync() in kwalletbackend.cc shouldn't the
> returnvalues of the sf.write() be checked? else the sf.write() may fail, we
> ignore it and then finalize the empty file...

Yeah, that certainly seems possible (and every single sf.write() needs to be 
checked no less).  Hard to say if this is the case for the bug reporter but 
just as RAID doesn't save you from rm -rf /, KSaveFile doesn't save you from 
trying to finalize() and empty file.

Regards,
 - Michael Pyne

[Attachment #5 (text/html)]

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" \
"http://www.w3.org/TR/REC-html40/strict.dtd"><html><head><meta name="qrichtext" \
content="1" /><style type="text/css">p, li { white-space: pre-wrap; \
}</style></head><body style=" font-family:'Consolas'; font-size:11pt; \
font-weight:400; font-style:normal;">On Saturday 17 January 2009, Sebastian Sauer \
wrote:<br> &gt; Michael Leupold wrote:<br>
&gt; &gt; Hi,<br>
&gt; &gt;<br>
&gt; &gt; I received a bugreport about someone loosing his wallet today. \
Basically<br> &gt; &gt; a process filled his disk while the wallet was open. On \
closing it<br> &gt; &gt; something went terribly wrong and he ended up with a \
kdewallet.kwl with<br> &gt; &gt; size 0.<br>
&gt; &gt;<br>
&gt; &gt; I'm pretty much stuck because I couldn't reproduce myself but I assumed<br>
&gt; &gt; this couldn't happen as kwalletd's backend uses KSaveFile to make sure<br>
&gt; &gt; either the whole wallet gets saved or nothing. As KSaveFile seems to be<br>
&gt; &gt; currently unmaintained I hope someone of you knows if it's supposed to<br>
&gt; &gt; handle full disk and if there's a corner case where this might indeed<br>
&gt; &gt; lead to corruption.<br>
&gt; &gt;<br>
&gt; &gt; The bugreport is: http://bugs.kde.org/show_bug.cgi?id=181059<br>
&gt; &gt;<br>
&gt; &gt; Thanks and regards,<br>
&gt; &gt; Michael<br>
&gt;<br>
&gt; in the method Backend::sync() in kwalletbackend.cc shouldn't the<br>
&gt; returnvalues of the sf.write() be checked? else the sf.write() may fail, we<br>
&gt; ignore it and then finalize the empty file...<br>
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; \
margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; \
-qt-user-state:0;"><br></p>Yeah, that certainly seems possible (and every single \
sf.write() needs to be checked no less).  Hard to say if this is the case for the bug \
reporter but just as RAID doesn't save you from rm -rf /, KSaveFile doesn't save you \
from trying to finalize() and empty file.<br> <p style="-qt-paragraph-type:empty; \
margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; \
                -qt-block-indent:0; text-indent:0px; \
                -qt-user-state:0;"><br></p>Regards,<br>
 - Michael Pyne</p></body></html>


["signature.asc" (application/pgp-signature)]

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic