Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp6254780ybi; Wed, 31 Jul 2019 11:01:10 -0700 (PDT) X-Google-Smtp-Source: APXvYqzdiJQZyDuryweB6DvICQkAjNBtE2wUgnBbG7e89h99Kk0T4S42rcEBJXq/EsKawqNui8Qv X-Received: by 2002:a17:902:2f84:: with SMTP id t4mr118253610plb.57.1564596070362; Wed, 31 Jul 2019 11:01:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564596070; cv=none; d=google.com; s=arc-20160816; b=mLUoAPuAMZgOitQaXR0SG3YbDRcD+qBn1/5LD6PlHSBm2PXNdIMZTo0ZGZAh6EPtlV 0gEIAZQAq9NuO5hEiGo8dbKk1tWkScjBnuqaFOVbUx+uJc5fXbARC4+oSHrYBWsxThJy TmyiP1e7YJsNrdDELGV4cdKE/LbhvTapdmYUJFWvCsJQnuIhUOMsSQid+YG0HB1hdZXV JsBkWBWDVpfDoZjY05PfGiB98868I3dKa/EWokiuOtub6zycdpkVJJ2rOMpCiY09VJS5 /0t4FnWrHm7yNrXSuARGOar/KuLpx9JVN5dEjyAzZ5KbO7ztEmWJi+YJnG2AwUM3hyoU Pp4A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=T31WwXYsxgU8fO97C5XG4W+sh6cfy84Mun+fk+tA2/o=; b=X/8i963aZ0/wCRqz0GA7VuLkqoFJG0dpgmsGhtoBnXIyXqZCelmB8RkQvdRqEMrV+t XqC9+GSpvNX9qmsLEiW0mXRhAtTW1RoL10MWuj2rcIlL7Nd8cyMccVar0PGRg+dqN7VF Ei7sJEXuQIPT4cxl0YNVrI0K1NhrZ9rnGSOz1BbMphyx0kvTzvfLMTVACWAuEcOWNH8Y 6y4XC4hYdTE2HPeJAJfH61BcYqP2y+zjBfE+gHyuJVRocoR7wzsPulLN+slpff9h6dCS Nl8LePJD3fsg1/jzVp6AKBnH3mGTy2SxuzoUao1U+hlkoFI1tt7gmRlYuJYEy6nVe4U3 67Lg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="sX/iidQk"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k76si31993900pga.294.2019.07.31.11.00.55; Wed, 31 Jul 2019 11:01:10 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="sX/iidQk"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727506AbfGaR5y (ORCPT + 99 others); Wed, 31 Jul 2019 13:57:54 -0400 Received: from mail-wm1-f67.google.com ([209.85.128.67]:36155 "EHLO mail-wm1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726377AbfGaR5y (ORCPT ); Wed, 31 Jul 2019 13:57:54 -0400 Received: by mail-wm1-f67.google.com with SMTP id g67so56530850wme.1; Wed, 31 Jul 2019 10:57:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=T31WwXYsxgU8fO97C5XG4W+sh6cfy84Mun+fk+tA2/o=; b=sX/iidQk0dUvgAG6y3YxYqtNQUGhiSU4kesR+IvEkmGd43zb5yH6iziI4AciHJLuB8 jq27iR560vhwkgZCmbqw2Je1yW+Glpfp0dKwf5KLywXz2ZSn8Li2tBGqOqePW+xGWTT9 9zRVLdAq1jm2GwIvZDS6GGhcZ4E66o84q9qvMCvAkS7epxWPvj9ObnL1irGDJ5nSAuSD b/ugzxNL8zkMW5ROxvQLKq3Ijn6bhJJUPFv/M3qXMItq8ZqEPNdPSP05qYSRkm46NAXH ZbgOwyH25TbHMsHaiGcmUGz54DBcaBKXGptYzB76c6vs524bh+5aO3gkpwluOh9QpN6/ b7qg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=T31WwXYsxgU8fO97C5XG4W+sh6cfy84Mun+fk+tA2/o=; b=mJBidjI7Z7nO54tn1mF0Kg7WpBVcA6AKE08EliHXVHB6dRdF313sNTV3OKLbVSObXy 6Yc3v5f2X2rYwNqo4Cxb+FLdKDXg0AKDuBDOmpujdlsJZnsPMiqaW8OizX/rW9Oej0cT pbfIRqAsG4OGcsm+4+MZoKOT/WAc4oJHOteaH2ngultyY97CaHYFB9KjcpdaaY5O1SAn XL+F6Ac/4Ny8X0j3biEvauuchPpg60qbVVjDMphQWK36h8MpJjCP+AJNstnRVevnlcYR mbA5k9my3XTLMTNjR+yy9xHIGsQRCfM1zvoIP6ooDIrLkS9BHgQ7rT6V7QnHH8/BM7Kt bhRg== X-Gm-Message-State: APjAAAV/cGj0oPYBqcqb/ABv0L7Nqq21AQmrN6+a7a4WH4s4nHi9vLM3 6uFcqI/zJjb5GeebBodnr2A= X-Received: by 2002:a7b:c081:: with SMTP id r1mr62622176wmh.76.1564595871090; Wed, 31 Jul 2019 10:57:51 -0700 (PDT) Received: from archlinux-threadripper ([2a01:4f8:222:2f1b::2]) by smtp.gmail.com with ESMTPSA id c6sm70486993wma.25.2019.07.31.10.57.50 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Wed, 31 Jul 2019 10:57:50 -0700 (PDT) Date: Wed, 31 Jul 2019 10:57:48 -0700 From: Nathan Chancellor To: Daniel Rosenberg Cc: Jaegeuk Kim , Chao Yu , Jonathan Corbet , linux-f2fs-devel@lists.sourceforge.net, linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-api@vger.kernel.org, kernel-team@android.com Subject: Re: [PATCH v4 3/3] f2fs: Support case-insensitive file name lookups Message-ID: <20190731175748.GA48637@archlinux-threadripper> References: <20190723230529.251659-1-drosen@google.com> <20190723230529.251659-4-drosen@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190723230529.251659-4-drosen@google.com> User-Agent: Mutt/1.12.1 (2019-06-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi all, > diff --git a/fs/f2fs/hash.c b/fs/f2fs/hash.c > index cc82f142f811f..99e79934f5088 100644 > --- a/fs/f2fs/hash.c > +++ b/fs/f2fs/hash.c > @@ -14,6 +14,7 @@ > #include > #include > #include > +#include > > #include "f2fs.h" > > @@ -67,7 +68,7 @@ static void str2hashbuf(const unsigned char *msg, size_t len, > *buf++ = pad; > } > > -f2fs_hash_t f2fs_dentry_hash(const struct qstr *name_info, > +static f2fs_hash_t __f2fs_dentry_hash(const struct qstr *name_info, > struct fscrypt_name *fname) > { > __u32 hash; > @@ -103,3 +104,35 @@ f2fs_hash_t f2fs_dentry_hash(const struct qstr *name_info, > f2fs_hash = cpu_to_le32(hash & ~F2FS_HASH_COL_BIT); > return f2fs_hash; > } > + > +f2fs_hash_t f2fs_dentry_hash(const struct inode *dir, > + const struct qstr *name_info, struct fscrypt_name *fname) > +{ > +#ifdef CONFIG_UNICODE > + struct f2fs_sb_info *sbi = F2FS_SB(dir->i_sb); > + const struct unicode_map *um = sbi->s_encoding; > + int r, dlen; > + unsigned char *buff; > + struct qstr *folded; > + > + if (name_info->len && IS_CASEFOLDED(dir)) { > + buff = f2fs_kzalloc(sbi, sizeof(char) * PATH_MAX, GFP_KERNEL); > + if (!buff) > + return -ENOMEM; > + > + dlen = utf8_casefold(um, name_info, buff, PATH_MAX); > + if (dlen < 0) { > + kvfree(buff); > + goto opaque_seq; > + } > + folded->name = buff; > + folded->len = dlen; > + r = __f2fs_dentry_hash(folded, fname); > + > + kvfree(buff); > + return r; > + } > +opaque_seq: > +#endif > + return __f2fs_dentry_hash(name_info, fname); > +} Clang now warns: fs/f2fs/hash.c:128:3: warning: variable 'folded' is uninitialized when used here [-Wuninitialized] folded->name = buff; ^~~~~~ fs/f2fs/hash.c:116:21: note: initialize the variable 'folded' to silence this warning struct qstr *folded; ^ = NULL 1 warning generated. I assume that it wants to be initialized with f2fs_kzalloc as well but I am not familiar with this code and what it expects to do. Please look into this when you get a chance! Nathan