Bug 845488
Summary: | Long filenames on NTFS cause tar-out, copy-out etc to fail with error "Cannot open: File name too long" | ||
---|---|---|---|
Product: | [Community] Virtualization Tools | Reporter: | Richard W.M. Jones <rjones> |
Component: | libguestfs | Assignee: | Richard W.M. Jones <rjones> |
Status: | CLOSED UPSTREAM | QA Contact: | |
Severity: | unspecified | Docs Contact: | |
Priority: | unspecified | ||
Version: | unspecified | CC: | dyasny, mbooth |
Target Milestone: | --- | ||
Target Release: | --- | ||
Hardware: | Unspecified | ||
OS: | Unspecified | ||
Whiteboard: | |||
Fixed In Version: | Doc Type: | Bug Fix | |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2012-08-03 10:54:33 UTC | Type: | Bug |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: |
Description
Richard W.M. Jones
2012-08-03 08:32:23 UTC
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 . 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. 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. 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). Likely NOTABUG, but should be documented. For a longer explanation see: https://www.redhat.com/archives/libguestfs/2012-August/msg00031.html Fixed upstream by documentation in commit 7fa67427c6b2725bdcce52c08511f8813b7bd42e. |