Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp6730537pxv; Fri, 30 Jul 2021 00:31:57 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxfZWCKEuDWVtxHrNHe8BfWlCe74e+bpFkKrAfO+YEoomF6MPMPnKjSSwUiqxgmvu4zEU9x X-Received: by 2002:a92:d083:: with SMTP id h3mr946627ilh.157.1627630317835; Fri, 30 Jul 2021 00:31:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627630317; cv=none; d=google.com; s=arc-20160816; b=Rd/KxrbodBXwBK/jeRzIvt/Tn5f0Xu50hiFHVsAhUt1bh1lG9AcGgRoLN9VvQF2C9O KEANQjg4+b+YWnOSlk2tUTci7lSAb2ojZ0O1sl+IZzTXc5FQrW+4iTE3/OwolRvsl9BV iQiiG/QQhE1KS3didmBZsuItz8E0fr8GpKYzbqyoNDGUK3ITvbgv3CHXAXLFKnm4Vbn4 VhR+HmcsmdStj17IY2tXLJWxSmY2inRjcqvbeDyAgKmZ6i/TLB37R7jMLRyHRtY2ybov 7rWD5rMpjWvtfmjlqzLzIkXcqjzXQ6jVrRkL9l6VAlc6XpFtix7RYm8TNF9UmlrlXmSX /Jzg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject; bh=TxJpHw7D+ZCqj68Hf0ohuQMnEb5h/cOGBhA8MEW/9FE=; b=sjG9VBl6UfsC5fjxi30Q3G1eOaxT/iGwjgk4yiOZWtYwVGT0W32Ww2bbVzvbsD5B3R X+3HeaYoEtk3OPAh4GDA0OcWM5+8hpNAzNZWn2+SNghxvR1X4fjLRhHdmMAl+JZ6hOVk ik1lVvqOilo0HmDHuIaYu686ikAZsrqvaG8kQ3dnOKxsonVaD3nvvNSGgifVoulT/LZ+ l/RfhTkaBMGHq+OE42TASmL4MVBZXWMlremTCrhbh4dzD+W53ShHYroYcJKv+1pyRM6M 9RjkwtDILeerDgWZCynwIw82dW1/bhzfDi8jrc6jXQrmUgTpMyTvLuWppkvY3WCnPKTa /Ztw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g14si930113jaj.31.2021.07.30.00.31.46; Fri, 30 Jul 2021 00:31:57 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237737AbhG3Haf (ORCPT + 99 others); Fri, 30 Jul 2021 03:30:35 -0400 Received: from smtp05.smtpout.orange.fr ([80.12.242.127]:21187 "EHLO smtp.smtpout.orange.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230337AbhG3Haf (ORCPT ); Fri, 30 Jul 2021 03:30:35 -0400 Received: from [10.0.2.15] ([86.243.172.93]) by mwinf5d81 with ME id bKWP2500H21Fzsu03KWPbY; Fri, 30 Jul 2021 09:30:29 +0200 X-ME-Helo: [10.0.2.15] X-ME-Auth: Y2hyaXN0b3BoZS5qYWlsbGV0QHdhbmFkb28uZnI= X-ME-Date: Fri, 30 Jul 2021 09:30:29 +0200 X-ME-IP: 86.243.172.93 Subject: Re: [PATCH v27 05/10] fs/ntfs3: Add attrib operations To: Konstantin Komarov , linux-fsdevel@vger.kernel.org Cc: viro@zeniv.linux.org.uk, linux-kernel@vger.kernel.org, pali@kernel.org, dsterba@suse.cz, aaptel@suse.com, willy@infradead.org, rdunlap@infradead.org, joe@perches.com, mark@harmstone.com, nborisov@suse.com, linux-ntfs-dev@lists.sourceforge.net, anton@tuxera.com, dan.carpenter@oracle.com, hch@lst.de, ebiggers@kernel.org, andy.lavr@gmail.com, kari.argillander@gmail.com, oleksandr@natalenko.name References: <20210729134943.778917-1-almaz.alexandrovich@paragon-software.com> <20210729134943.778917-6-almaz.alexandrovich@paragon-software.com> From: Christophe JAILLET Message-ID: <46dbc10f-37a1-80f7-b4b5-e49eb867eff2@wanadoo.fr> Date: Fri, 30 Jul 2021 09:30:23 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.8.1 MIME-Version: 1.0 In-Reply-To: <20210729134943.778917-6-almaz.alexandrovich@paragon-software.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, below are a few comments based on a cppcheck run. Don't take it too seriously into consideration, this is just a minor clean-up. It is reported only if a new iteration is done and if it makes sense to include it. CJ Le 29/07/2021 à 15:49, Konstantin Komarov a écrit : > This adds attrib operations > > Signed-off-by: Konstantin Komarov > --- > fs/ntfs3/attrib.c | 2082 +++++++++++++++++++++++++++++++++++++++++++ > fs/ntfs3/attrlist.c | 456 ++++++++++ > fs/ntfs3/xattr.c | 1046 ++++++++++++++++++++++ > 3 files changed, 3584 insertions(+) > create mode 100644 fs/ntfs3/attrib.c > create mode 100644 fs/ntfs3/attrlist.c > create mode 100644 fs/ntfs3/xattr.c > > diff --git a/fs/ntfs3/attrib.c b/fs/ntfs3/attrib.c > new file mode 100644 > index 000000000..bca85e7b6 > --- /dev/null > +++ b/fs/ntfs3/attrib.c [...] > +/* > + * load runs for given range [from to) > + */ > +int attr_load_runs_range(struct ntfs_inode *ni, enum ATTR_TYPE type, > + const __le16 *name, u8 name_len, struct runs_tree *run, > + u64 from, u64 to) > +{ > + struct ntfs_sb_info *sbi = ni->mi.sbi; > + u8 cluster_bits = sbi->cluster_bits; > + CLST vcn = from >> cluster_bits; This initialization is overwritten in the for loop below. It can be removed. > + CLST vcn_last = (to - 1) >> cluster_bits; > + CLST lcn, clen; > + int err; > + > + for (vcn = from >> cluster_bits; vcn <= vcn_last; vcn += clen) { here > + if (!run_lookup_entry(run, vcn, &lcn, &clen, NULL)) { > + err = attr_load_runs_vcn(ni, type, name, name_len, run, > + vcn); > + if (err) > + return err; > + clen = 0; /*next run_lookup_entry(vcn) must be success*/ > + } > + } > + > + return 0; > +} [...]