From owner-freebsd-current@FreeBSD.ORG Wed Oct 20 22:18:17 2010 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BCEB7106564A for ; Wed, 20 Oct 2010 22:18:17 +0000 (UTC) (envelope-from mdf356@gmail.com) Received: from mail-iw0-f182.google.com (mail-iw0-f182.google.com [209.85.214.182]) by mx1.freebsd.org (Postfix) with ESMTP id 7200C8FC1B for ; Wed, 20 Oct 2010 22:18:17 +0000 (UTC) Received: by iwn41 with SMTP id 41so1658063iwn.13 for ; Wed, 20 Oct 2010 15:18:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:cc:content-type; bh=OhdCcccC0RBN/rUsEhn9TKX1G/r9+5PluNqy4FvTI5E=; b=iCJr57OB83i6aA6bE0klVnX1zDDbRenRjSzvoJ19pqpTGOsFmeovSzB/j4zjp0yQjX vVvvA9dThK+AVC6Gh57S6tQgHAmDsa/rSHJgQNQB8o6H3rVGvunK89GN6UqEoiA0AUti XRzpAxDoj4O5KzG03+Q8e48OtvYUwQSwtAPRY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=hbB3wbvxYvHULum8UoyurJyuQxUBT6qCC0zaFrQXDU80lzZpF4zfp6DX6l0roOwJ+w XAyRB1D/Iwv5eViZNY0gx8QqRH9OnUWa3/An0NnsHLhYiOqLYnWZPNF0rJKrp1k0/gAB 16NiJZwHJ9230jM/kO2uPmw1tgb8+mjuMrEKk= MIME-Version: 1.0 Received: by 10.231.146.80 with SMTP id g16mr169555ibv.70.1287613096849; Wed, 20 Oct 2010 15:18:16 -0700 (PDT) Received: by 10.231.166.199 with HTTP; Wed, 20 Oct 2010 15:18:16 -0700 (PDT) In-Reply-To: References: <4CBCDD3A.9070404@delphij.net> <4CBD26B4.2020205@yandex.ru> <4CBDB17C.4040607@yandex.ru> <20101020194547.GA94244@server.vk2pj.dyndns.org> Date: Wed, 20 Oct 2010 15:18:16 -0700 Message-ID: From: Matthew Fleming To: Garrett Cooper Content-Type: text/plain; charset=ISO-8859-1 Cc: KOT MATPOCKuH , FreeBSD Current , Peter Jeremy Subject: Re: [zfs] Mounting from (...) failed with error 19 X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Oct 2010 22:18:17 -0000 On Wed, Oct 20, 2010 at 1:39 PM, Garrett Cooper wrote: > On Wed, Oct 20, 2010 at 12:45 PM, Peter Jeremy wrote: >> On 2010-Oct-20 10:50:38 +0400, KOT MATPOCKuH wrote: >>>> I fixed it with attached patch. >>>Omg... Why You are using strcmp, but not strncmp(fs, "zfs", strlen("zfs"))? >> >> Can you explain why you think it should be strncmp() please. > > I'd say that strcmp is perfectly fine because zfs is a 3 character (4 > if you count NUL) string. The comparison logic is dang near the same: It wouldn't be about the length of the string, but whether you want a match on other strings like "zfs2", "zfs_foo", and anything else prefixed with zfs. That's the difference between strcmp and strncmp(... strlen()). Thanks, matthew