Bug 14186 - Invalid argument error with surrogate pair in file names at case of 'nocase' option
Summary: Invalid argument error with surrogate pair in file names at case of 'nocase' ...
Status: NEW
Alias: None
Product: CifsVFS
Classification: Unclassified
Component: kernel fs (show other bugs)
Version: 3.x
Hardware: All All
: P5 normal
Target Milestone: ---
Assignee: Steve French
QA Contact: cifs QA contact
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-11-06 12:38 UTC by Konstantin Germanov
Modified: 2020-07-16 02:00 UTC (History)
3 users (show)

See Also:


Attachments
Fix list dir with nocase (1.52 KB, application/mbox)
2019-11-06 12:38 UTC, Konstantin Germanov
no flags Details
Fix list dir and copy with nocase (1.94 KB, patch)
2019-11-07 22:08 UTC, Konstantin Germanov
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Konstantin Germanov 2019-11-06 12:38:49 UTC
Created attachment 15600 [details]
Fix list dir with nocase

Steps to Reproduce for bug:
	client# mount //X.X.X.X/C\$ /tmp/test_data -o 'username=*****,pass=***'
	client# touch /tmp/test_data/$(echo -e '\xf0\x9d\x9f\xa3')
	client# umount /tmp/test_data
	client# mount //X.X.X.X/C\$ /tmp/test_data -o 'username=*****,pass=***,nocase'
	client# ls -1i /tmp/test_data
	/bin/ls: cannot access '/tmp/test_data/1': Invalid argument
	? 1

Fixed it by use raw bytes to hash if we can't convert the character. Proposed patch - in attachment
Comment 1 Konstantin Germanov 2019-11-07 22:03:43 UTC
There is a problem with copying files with surrogate characters at the filename and the 'nocase' option:

root@kgstretch:/usr/src# cp -rf /tmp/test_data/surrogate /tmp/test_data/surrogate_copy
cp: skipping file '/tmp/test_data/surrogate/DF88-D883_surrogate_
Comment 2 Konstantin Germanov 2019-11-07 22:08:21 UTC
Created attachment 15615 [details]
Fix list dir and copy with nocase

Fixed compare