Re: [zfs] Mounting from (...) failed with error 19

From: Matthew Fleming <mdf356_at_gmail.com>
Date: Wed, 20 Oct 2010 15:18:16 -0700
On Wed, Oct 20, 2010 at 1:39 PM, Garrett Cooper <gcooper_at_freebsd.org> wrote:
> On Wed, Oct 20, 2010 at 12:45 PM, Peter Jeremy <peterjeremy_at_acm.org> wrote:
>> On 2010-Oct-20 10:50:38 +0400, KOT MATPOCKuH <matpockuh_at_gmail.com> 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
Received on Wed Oct 20 2010 - 20:18:17 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:40:08 UTC