From owner-freebsd-bugs@FreeBSD.ORG Thu Dec 22 17:10:04 2005 Return-Path: X-Original-To: freebsd-bugs@hub.freebsd.org Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id ABE4F16A41F for ; Thu, 22 Dec 2005 17:10:04 +0000 (GMT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4C64E43D53 for ; Thu, 22 Dec 2005 17:10:03 +0000 (GMT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.4/8.13.4) with ESMTP id jBMHA31Z002208 for ; Thu, 22 Dec 2005 17:10:03 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.13.4/8.13.4/Submit) id jBMHA3P5002207; Thu, 22 Dec 2005 17:10:03 GMT (envelope-from gnats) Resent-Date: Thu, 22 Dec 2005 17:10:03 GMT Resent-Message-Id: <200512221710.jBMHA3P5002207@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Rudolf Cejka Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id E99F516A41F for ; Thu, 22 Dec 2005 17:00:44 +0000 (GMT) (envelope-from cejkar@fit.vutbr.cz) Received: from kazi.fit.vutbr.cz (kazi.fit.vutbr.cz [147.229.8.12]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8EA7043D5F for ; Thu, 22 Dec 2005 17:00:34 +0000 (GMT) (envelope-from cejkar@fit.vutbr.cz) Received: from kazi.fit.vutbr.cz (localhost [127.0.0.1]) by kazi.fit.vutbr.cz (envelope-from cejkar@fit.vutbr.cz) (8.13.5/8.13.5) with ESMTP id jBMH0Td6084847 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Thu, 22 Dec 2005 18:00:29 +0100 (CET) Received: (from cejkar@localhost) by kazi.fit.vutbr.cz (8.13.5/8.13.1/Submit) id jBMH0TDb084846; Thu, 22 Dec 2005 18:00:29 +0100 (CET) (envelope-from cejkar) Message-Id: <200512221700.jBMH0TDb084846@kazi.fit.vutbr.cz> Date: Thu, 22 Dec 2005 18:00:29 +0100 (CET) From: Rudolf Cejka To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Cc: Subject: kern/90815: SMBFS with character conversions sometimes hangs X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Rudolf Cejka List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Dec 2005 17:10:04 -0000 >Number: 90815 >Category: kern >Synopsis: SMBFS with character conversions sometimes hangs >Confidential: no >Severity: serious >Priority: medium >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Thu Dec 22 17:10:02 GMT 2005 >Closed-Date: >Last-Modified: >Originator: Rudolf Cejka >Release: 6.0-STABLE #11: Thu Dec 22 17:12:43 CET 2005 >Organization: FIT, Brno University of Technology, Czech Republic >Environment: >Description: If I mount smb fs with mount_smbfs -Eiso8859-2:cp852 -Lcs_CZ.ISO8859-2 ... and there are some file/directory names, where some characters could not be converted, directory tree traversion hangs. It is because iconv_xxx() function returns -1, which is forwarded to the upper layer, where -1 is incorrectly taken as ERESTART and path conversion is restarted from the beginning, which results in infinite loop. >How-To-Repeat: Try to mount some smb fs with character conversions (for example, I do use -Eiso8859-2:cp852,-Lcs_CZ.ISO8859-2), where iconv could not convert all characters in file/directory names and try to run find . on mounted directory - it should hang when it finds nonconvertible file/directory name (maybe it "works" just for directory names, which is the case where I tried to find the problem). >Fix: I'm currently trying the following patch, which fixes the hang problem, however I'm not sure, how much is it really correct. --- sys/netsmb/smb_subr.c.orig Thu Dec 22 16:52:55 2005 +++ sys/netsmb/smb_subr.c Thu Dec 22 17:11:19 2005 @@ -323,7 +323,10 @@ { size_t outlen = len; - return iconv_conv((struct iconv_drv*)mbp->mb_udata, &src, &len, &dst, &outlen); + if (iconv_conv((struct iconv_drv*)mbp->mb_udata, + &src, &len, &dst, &outlen) == -1) + bcopy(src, dst, len); + return 0; } int >Release-Note: >Audit-Trail: >Unformatted: