This service will be undergoing maintenance at 00:00 UTC, 2016-08-01. It is expected to last about 1 hours
Bug 845488 - Long filenames on NTFS cause tar-out, copy-out etc to fail with error "Cannot open: File name too long"
Long filenames on NTFS cause tar-out, copy-out etc to fail with error "Cannot...
Status: CLOSED UPSTREAM
Product: Virtualization Tools
Classification: Community
Component: libguestfs (Show other bugs)
unspecified
Unspecified Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: Richard W.M. Jones
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2012-08-03 04:32 EDT by Richard W.M. Jones
Modified: 2012-08-03 06:54 EDT (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2012-08-03 06:54:33 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


Attachments (Terms of Use)

  None (edit)
Description Richard W.M. Jones 2012-08-03 04:32:23 EDT
Description of problem:
(reported by Evaggelos Balaskas)

NTFS allows filenames up to 255 characters.  The tar format seems
to have a smaller limit (although not according to the documentation
I'm reading so I'm not exactly sure what's going on ...)

An example filename which fails:

tar: ./Desktop/ΔΗΜΗΤΡΗΣ/ΣΥΝΤΕΛΕΣΤΕΣ ΑΠΟΣΒΕΣΗΣ Νέοι συντελεστές
απόσβεσεις πάγιων περιουσιακών στοιχείων Οι συντελεστές απόσβεσης,
ανώτεροι και κατώτεροι που προβλέπει το ΠΔ για κάθε είδος
επιχειρηματικής δραστηριότητας.htm: Cannot open: File name too long

Version-Release number of selected component (if applicable):

libguestfs 1.19.28

Additional info:

https://www.redhat.com/archives/libguestfs/2012-August/msg00028.html
Comment 1 Richard W.M. Jones 2012-08-03 06:06:30 EDT
Reproducer (note this command is a single line):

$ guestfish -N fs:ntfs -m /dev/sda1 mkdir /Desktop : mkdir /Desktop/ΔΗΜΗΤΡΗΣ : touch "/Desktop/ΔΗΜΗΤΡΗΣ/ΣΥΝΤΕΛΕΣΤΕΣ ΑΠΟΣΒΕΣΗΣ Νέοι συντελεστές απόσβεσεις πάγιων περιουσιακών στοιχείων Οι συντελεστές απόσβεσης, ανώτεροι και κατώτεροι που προβλέπει το ΠΔ για κάθε είδος επιχειρηματικής δραστηριότητας.htm" : copy-out /Desktop .
Comment 2 Richard W.M. Jones 2012-08-03 06:11:03 EDT
Smaller reproducer:

$ guestfish -N fs:ntfs -m /dev/sda1 mkdir /foo : touch /foo/$(perl -e 'print "Σ"x200') : copy-out /foo /tmp

Note this seems to be something to do with bytes vs characters.

If we use 200 ASCII characters, then the tar command works fine.

If we use 200 sigma characters (in UTF 16 as used in NTFS this is
400 bytes, in UTF 8 it's also 400 bytes since each sigma is encoded
as 0xCE 0xA3), then the command fails.
Comment 3 Richard W.M. Jones 2012-08-03 06:15:27 EDT
Changing ntfs -> ext4 causes the touch command to break, ie.
such a filename cannot be created in the first place.  Presumably
this is because ext4 only allows filenames up to 255 *bytes*
where as ntfs allows filenames up to 255 characters.
Comment 4 Richard W.M. Jones 2012-08-03 06:31:51 EDT
I think I'm being an idiot here.  The problem is on the
host side not the appliance side.

Replacing copy-out with tar-out:

$ guestfish -N fs:ntfs -m /dev/sda1 mkdir /foo : touch /foo/$(perl -e 'print "Σ"x200') : tar-out /foo /dev/null

the command runs successfully.  This indicates that the bug
occurs when we create the file on the host filesystem (which
being ext4 will naturally fail because the name is too long).
Comment 5 Richard W.M. Jones 2012-08-03 06:42:17 EDT
Likely NOTABUG, but should be documented.

For a longer explanation see:
https://www.redhat.com/archives/libguestfs/2012-August/msg00031.html
Comment 6 Richard W.M. Jones 2012-08-03 06:54:33 EDT
Fixed upstream by documentation in
commit 7fa67427c6b2725bdcce52c08511f8813b7bd42e.

Note You need to log in before you can comment on or make changes to this bug.