[Bug 2721] New: Improve SFTP server to make remove always work on ZFS/Btrfs

bugzilla-daemon at bugzilla.mindrot.org bugzilla-daemon at bugzilla.mindrot.org
Tue May 23 16:51:09 AEST 2017


https://bugzilla.mindrot.org/show_bug.cgi?id=2721

            Bug ID: 2721
           Summary: Improve SFTP server to make remove always work on
                    ZFS/Btrfs
           Product: Portable OpenSSH
           Version: 7.5p1
          Hardware: Other
                OS: All
            Status: NEW
          Severity: normal
          Priority: P5
         Component: sftp-server
          Assignee: unassigned-bugs at mindrot.org
          Reporter: walteste at inf.ethz.ch

The code in process_remove() in sftp-server.c just tries a simple
unlink for the file to be deleted. This does not work well on ZFS or
Btrfs if the filesystem/pool is completely full, which is a well known
problem of CoW filesystems. See here ofr instance:

 
http://www.surlyjake.com/blog/2010/01/19/zfs-cant-rm-no-space-left-on-device/

Trying to delete a file on a full filesystem just fails:

sftp> rm some_file
Removing /full/some_file
Couldn't delete file: Failure

The trick is to first do a truncate() on a file containing data to free
up data blocks. In this case, truncating the file to be deleted before
the unlink() would solve the problem.

-- 
You are receiving this mail because:
You are watching the assignee of the bug.


More information about the openssh-bugs mailing list