[PATCH] Re: Issues to fix before 4.6.1?

Jindrich Novy jnovy at redhat.com
Wed Mar 30 08:11:19 UTC 2005


Hello Oswald,

On Tue, 2005-03-29 at 22:37 +0200, Oswald Buddenhagen wrote:
> On Tue, Mar 29, 2005 at 05:46:33PM +0200, Jindrich Novy wrote:
> > On Tue, 2005-03-29 at 11:07 +0300, Andrew V. Samoilov wrote:
> > > There is a data loss possible if file is edited with external editor over VFS.
> > 
> > I have similar experience even with mcedit without VFS -> data loss when
> > disk quota is exceeded, the edited file is truncated to zero size. I had
> > these problems with mc-4.5.51 so I'm not sure if it's still a problem
> > with recent mc.
> > 
> i've had this just yesterday ... good luck it was no important file.
> this happens with the quick save mode ... it must, given the way it
> works. not sure it can be fixed properly at all without just switching
> to another mode. oh, well, it could be fixed to not lose data, but the
> resulting file would be a bit inconsistent.
> 

Seems like mc still tests presence of a file on local filesystem in
rather brutal way when quick-saving:

    if (!vfs_file_is_local (filename) ||
        (fd = mc_open (filename, O_WRONLY | O_BINARY)) == -1)

what actually truncates the filename to zero size. The proposed patch
modifies the opening mode to O_RDONLY so that we shouldn't lose any data
at this point.

Furthermore I noticed ctype.h is #included redundantly twice in
edit_cmd.c. This fixes the second patch.

Jindrich

-- 
Jindrich Novy <jnovy at redhat.com>, http://people.redhat.com/jnovy/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: mc-dontrewrite.patch
Type: text/x-patch
Size: 442 bytes
Desc: not available
URL: <http://lists.midnight-commander.org/pipermail/mc-devel/attachments/20050330/07c689fd/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: mc-ctype.patch
Type: text/x-patch
Size: 274 bytes
Desc: not available
URL: <http://lists.midnight-commander.org/pipermail/mc-devel/attachments/20050330/07c689fd/attachment-0001.bin>


More information about the mc-devel mailing list