From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759525AbcAKNdN (ORCPT ); Mon, 11 Jan 2016 08:33:13 -0500 Received: from relay1.mentorg.com ([192.94.38.131]:46009 "EHLO relay1.mentorg.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757899AbcAKNdJ (ORCPT ); Mon, 11 Jan 2016 08:33:09 -0500 From: Andrew Gabbasov To: "'Jan Kara'" CC: Jan Kara , References: <1450974338-22762-1-git-send-email-andrew_gabbasov@mentor.com> <1450974338-22762-7-git-send-email-andrew_gabbasov@mentor.com> <20160104123233.GB13014@quack.suse.cz> In-Reply-To: <20160104123233.GB13014@quack.suse.cz> Subject: RE: [PATCH v2 6/7] udf: Remove struct ustr as non-needed intermediate storage Date: Mon, 11 Jan 2016 16:31:40 +0300 Organization: Mentor Graphics Corporation Message-ID: <000001d14c74$679154b0$36b3fe10$@mentor.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Outlook 14.0 Thread-Index: AQHRPme+4eXzulvvhkCsVO5h+JRL257rWyiAgAryefA= Content-Language: en-us Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Jan, Thank you for your review! And sorry for a delay with response, we had several days of holidays. > -----Original Message----- > From: Jan Kara [mailto:jack@suse.cz] > Sent: Monday, January 04, 2016 3:33 PM > To: Gabbasov, Andrew > Cc: Jan Kara; linux-kernel@vger.kernel.org > Subject: Re: [PATCH v2 6/7] udf: Remove struct ustr as non-needed intermediate storage [skipped] > > > > - ocu[length - 1] = (uint8_t)u_len + 1; > > - return u_len + 1; > > + return u_len; > > It seems you removed setting of the length in the resulting CS0 string. Yes, and it was done deliberately. udf_name_to_CS0 and its caller udf_put_filename functions are used for writing File Identifier fields only, which are not "dstrings", that is not containing the length in last byte. The last byte with the length from these functions would not be copied to filesystem or used in any other way. [skipped] > > - ret = udf_translate_to_linux(dname, dlen, > > - filename->u_name, filename->u_len, > > - unifilename->u_name, unifilename->u_len); > > + ret = udf_translate_to_linux(dname, dlen, filename, dlen, sname, slen); > > Umm, but here you pass CS0 name to udf_translate_to_linux() including > beginning encoding character which didn't happen before your patch. > So in case we have to compute CRC it will be different. Yes, you are correct, this is a mistake (introduced when splitting the original single patch). I will correct it in version 3 of the patches (I will use sname + 1 and slen - 1). Thank you for catching it! I will prepare an update soon. Thanks. Best regards, Andrew