bugGNU nano - Bugs: bug #24000, no free space on partition - nano...

 
 

bug #24000: no free space on partition - nano claims successful write - file empty

Submitted by:  Zero C <zec>
Submitted on:  Mon 04 Aug 2008 07:29:59 PM UTC  
 
Severity: 4 - ImportantStatus: Fixed
Assigned to: Chris Allegretta <astyanax>Open/Closed: Closed

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Mon 25 Aug 2008 02:37:24 AM UTC, comment #5:

Closing as 2.0.8 was released today, and that's like much more important than the 2.1 series.

Chris Allegretta <astyanax>
Project AdministratorIn charge of this item.
Sat 16 Aug 2008 11:55:45 PM UTC, comment #4:

Aaaaaaaaahaaaaa!

It seems that we never check the exit code for the fclose() at the end of the write. In this case, it seems that all the fwrite()s will return successfully even though we are out of disk space. So the failure doesn't occur until we try to close, which is now fixed in r4304 for 2.1.5, and I will backport to 2.0.8 due to its severity. Thanks much!

Chris Allegretta <astyanax>
Project AdministratorIn charge of this item.
Mon 11 Aug 2008 04:38:10 PM UTC, comment #3:

I encountered the behaviour on Debian 4.0 (Linux 2.6.18-5-ixp4xx on armv5tel, nano version 2.0.2-1etch1_arm from repo) and could reproduce it on Ubuntu 8.04 (Linux 2.6.24-19-generic on i686, nano version 2.0.7-1ubuntu1 from repo), each on ext-3 partitions.

the mount options were
"defaults,errors=remount-ro,noatime,commit=120" on Debian (USB-stick: noatime+commit slightly tweaked for the medium)
"defaults,errors=remount-ro" on Ubuntu (in an extended partition)

I can try and test on different filesystems as well (vfat, ntfs-3g, nfs), but right now they are in use. Tell me if there's something I should give extra scrutiny. I can try and test latest builds as well.

Thanks a lot, so far.

Zero C <zec>
Sat 09 Aug 2008 03:47:27 AM UTC, comment #2:

In r4297 I changed the behavior of the -B option, so it does not attempt to write the main file if the backup file fails. That way, even if the user then bails out (which means discarding their changes) at least the whole file was not lost. This change will be in nano 2.1.4.

I'm still concerned that you didn't get any error message about a no space left on device message when writing the file, so if you could send me the information I mentioned previously that would be helpful.

Chris Allegretta <astyanax>
Project AdministratorIn charge of this item.
Wed 06 Aug 2008 02:56:52 AM UTC, comment #1:

Hello,

When I attempt to write a file under Linux 2.6 on a full partition, nano seems to correctly identify the issue and reports it back on the status bar: "Error writing <filename>: No space left on device". It does not exit but does unhappily truncate the file.

Nano does offer a -B (backup file) option, but that does not seem to do the Right Thing currently when the partition is full. I will work on fixing that. In the meantime, if you aren't seeing the "No space left on device" message, can you confirm what type of filesystem you are attempting to write to (including mount options) and what the operating system you are using is, that may help me track down why things are going completely awry for you.

Chris Allegretta <astyanax>
Project AdministratorIn charge of this item.
Mon 04 Aug 2008 07:29:59 PM UTC, original submission:

Users don't always realize whether there is actually sufficient space left on a partition, thus nano should inform the user when it cannot write the buffer to disk because of this / other issues, just as it informs about file permission issues.

However, at least up to nano 2.0.7 it even claims "[ Wrote n lines ]" when it actually didn't, even worse: leaving behind an empty file, making the original content non-recoverable.

This has cost me dearly today...

Please fix this quickly or tell me how to adress this

Zero C <zec>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by astyanax (Posted a comment)
  • -unavailable- added by zec (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 5 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Mon 25 Aug 2008 02:37:24 AM UTCastyanaxOpen/ClosedOpen=>Closed
    Sat 16 Aug 2008 11:55:45 PM UTCastyanaxStatusNeed Info=>Fixed
    Wed 06 Aug 2008 02:56:52 AM UTCastyanaxSeverity3 - Normal=>4 - Important
      StatusNone=>Need Info
      Assigned toNone=>astyanax

    Back to the top


    Powered by Savane 3.1-cleanup1