Fw: [linux-cifs-client] patch for properly converting Japanese et al to utf8

Steve French smfrench at austin.rr.com
Thu Sep 30 03:17:27 GMT 2004


You are solving the right problem, but the cifs_readdir code needs more 
surgery than that (not just for that - but also to workaround a netapp 
server bug as well in which the last entry is set incorrectly by the 
server and to avoid an extra memcopy and to fix search rewind).  I think 
it is easier to solve this (and safer) to not convert in place - and 
therefore never call cifs_strtoUCS with an identical source and target.


> This patch works for me.  Please give it a review.
>
> The problem was that file.c calls cifs_strfromUCS_le() and
> cifs_strtoUCS_wrapped() with the same input and output strings.  This
> results in an in-place copy, which breaks when the character pointer
> doesn't advance the same amount for the source and the target
> (i.e. Japanese utf-8 vs utf-16).
>
> I wrapped the functions and used a temporary buffer to ensure that the
> target and destination are different buffers.  The only issue I can
> imagine is if the length can be over MAX_PATHCONF, or if the length of
> the input string is less than MAX_PATHCONF.  I didn't check these
> cases.
>
>

-------------- next part --------------
HTML attachment scrubbed and removed


More information about the linux-cifs-client mailing list