From owner-freebsd-current@FreeBSD.ORG Wed Oct 20 22:46:02 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 2952E106566B for ; Wed, 20 Oct 2010 22:46:02 +0000 (UTC) (envelope-from yanegomi@gmail.com) Received: from mail-wy0-f182.google.com (mail-wy0-f182.google.com [74.125.82.182]) by mx1.freebsd.org (Postfix) with ESMTP id A7CB98FC0A for ; Wed, 20 Oct 2010 22:46:01 +0000 (UTC) Received: by wyb38 with SMTP id 38so4423431wyb.13 for ; Wed, 20 Oct 2010 15:46:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:sender:received :in-reply-to:references:date:x-google-sender-auth:message-id:subject :from:to:cc:content-type:content-transfer-encoding; bh=UB/+kMCFQ25lKdgYi+cbQ8rHtogfmth92sCMXuSZYqo=; b=te+fTvKpRX9DLhwpQZCryUWC7OuRaWjJi2EHBPYDP8xG5s+hC3mqA+N4O7838xGzTL TCgd7u6pSj6cC+K21845LNYQc4Da4bJLbEugKrSk4Lvgqv9bhsI9q8VJLcs+VVvP3awd nYYe7fwSPSbiqp0Ra9pSuUnyPQ8+vib7BO6ro= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; b=SxMBU8yXjgTpQHd0YFg2yVOyVlxEqKmPQ5zieyONDJltpsR8pA4PHfqnVafoK7k7VZ /r41FrdnBZKmghEBYWAHGlaMuCM+OvJOOkfWOoDThwZOU9KB3mGVI0VzykwJEmWtce2g WJVAHbmaY6BkW1PgQldEKAUNe7hUfjDyB6qQA= MIME-Version: 1.0 Received: by 10.216.26.194 with SMTP id c44mr10135wea.104.1287614760108; Wed, 20 Oct 2010 15:46:00 -0700 (PDT) Sender: yanegomi@gmail.com Received: by 10.216.135.67 with HTTP; Wed, 20 Oct 2010 15:46:00 -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:46:00 -0700 X-Google-Sender-Auth: DqfFLDdn9Mfo-Leps6qzmkmZD7c Message-ID: From: Garrett Cooper To: Matthew Fleming Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable 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:46:02 -0000 On Wed, Oct 20, 2010 at 3:18 PM, Matthew Fleming wrote: > On Wed, Oct 20, 2010 at 1:39 PM, Garrett Cooper wro= te: >> On Wed, Oct 20, 2010 at 12:45 PM, Peter Jeremy wro= te: >>> On 2010-Oct-20 10:50:38 +0400, KOT MATPOCKuH wrot= e: >>>>> 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. =A0That's the difference between strcmp and > strncmp(... strlen()). Well, yeah... the because using the above strategy would introduce parsing bugs as you so elegantly put it :). -Garrett