Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp414916pxb; Sat, 18 Sep 2021 06:32:21 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyKA49kFSipV/9vS8qonGWHG8I/GVw9qe8w68lY6nOJiGdQ2SSVzjp1xhp2lQb1FBE+7D3S X-Received: by 2002:a17:906:f8d4:: with SMTP id lh20mr18494495ejb.382.1631971940891; Sat, 18 Sep 2021 06:32:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631971940; cv=none; d=google.com; s=arc-20160816; b=oYmmXPqLDX63J8LtjgaBLPsF4ketWfyOvcV/sLFLRErUD92vipuBQWfGzUnR4jKUnw rSJ04MGUTbZDadOFy3MwAgSpcyVff4bySmbWW6V2GLTjfGSpWumWNXp2cschrH83SS9J vE9ZzuufD7QriRxYh6w9YTCqZO359jPLPvvmRZfY67lDjugt9Zx/aSG/CKN/H6AnGqco i6efsPeUu9pT9ZmEQTP20Z8LMowClD9oSGM5qcS1XFczvf4fVkjMw+ERx7Q95yrI906d Y3DRYhoM4wPK/GykjYGfY9s1PA09EQ0PrDwjK8KMG8oyxilOC2EsbPqynD/JBVJA7/dF L6Vw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=/Iv66vXX7J5CxDss690/EZstKTh3xBr9NHityj90xHw=; b=f535bMU2y6+uEQZ+cTVdgnA9/Ydvnd5pdmCwezIogzuNOkMUTm61grpV/TZlUOWkHs ti30Bxz6KyktQq31ttlkXNGw0NwCktzvOYKZ8dNP/b6vepEqwUd9FCEkMYxXa+vI/7VJ lofDRpJAlhsA72vfnozxiyGeTMDNRSQCgjNIxFAc54ToJW17SnxG78PPpY2t52cWy7hV 7nN5cYr850NoXKH1XeIWeRw0guvDfThtpxIUVdPNisYhgMx2ed4N5lCJ//9DnLyIP06i j6OyLGtybQvaBztRnQ49XA6MqfsoX9KGp2gWreWeYETtEVh2QnrCY/ofdm88aUujUA3k 5Etg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b="DvA6w6f/"; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id n17si9713726ejl.475.2021.09.18.06.31.56; Sat, 18 Sep 2021 06:32:20 -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; dkim=pass header.i=@gmail.com header.s=20210112 header.b="DvA6w6f/"; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234836AbhIRHEV (ORCPT + 99 others); Sat, 18 Sep 2021 03:04:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59912 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241829AbhIRHEN (ORCPT ); Sat, 18 Sep 2021 03:04:13 -0400 Received: from mail-lf1-x133.google.com (mail-lf1-x133.google.com [IPv6:2a00:1450:4864:20::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DF085C061574; Sat, 18 Sep 2021 00:02:49 -0700 (PDT) Received: by mail-lf1-x133.google.com with SMTP id c8so42280727lfi.3; Sat, 18 Sep 2021 00:02:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=/Iv66vXX7J5CxDss690/EZstKTh3xBr9NHityj90xHw=; b=DvA6w6f/ngKAS8/lng5G6iiaY41TCj/QH4ysOzsPjMx8I8Y5EpF8yBmvPCjwpwcwjP VquTGOAOA0ivCj5hZ+HvEHevLA37n0xdD8cOauCz8Gx4kyS00Q8GxflfhiwbiCf1S6JM TR+Su8r2MskO53P/Pfk7rnFHp6Tgf0p1tFSiYYsB4k/X7APh7qwETBCM0rKsy/X02mR3 SDT0Vyy9+yJM4lB2B9Aqul0C44scXIZOvB6Ciiq1BrfSBT52HrNQOr7JUxR3XbJ3DUtg rSxv4IhUsX3Dkaj5KrRk6iuVyuILg2Gh3A+LRnPI2F7Vrqr4VerBggEUAZK1WFHI4h7F i1qQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=/Iv66vXX7J5CxDss690/EZstKTh3xBr9NHityj90xHw=; b=3fpoLkQcW9lGBkGoO7fzJ9qyUS7NpN9mYQqvaeVnIgBTr16KXI7aZwUGNUn8wyp6h0 xm9P6MN6M9PvwRgfU+nlZqduqdWHFb9iscZRmc0C+JseT4I6Z49JhVbJDfhIjO9EzExU gawB2OOi4oxtaiA7EsTQRgGJZsstbAEaIbVFYX+S7bEPl6i/wipEDvTq1xH8AH4BA2L8 flvY8sXwRG95eBh0AYNsNTSFqXhg6cpd92+e4TS3cWxQY8f0GxoaVJsy31onavesfIdZ lbn9rIMr3NWUXvKs39tYLrFbIIGmKq9SAcDTHGcQPKaMi87LIOYaFtMfkgadZi+ycq+k 6t+Q== X-Gm-Message-State: AOAM532/MHvhQYuQGafwvFCFqgldLhunPkhY5NnNz9TaPg7COG4mYkzd OZRcBqQD/AWkKGzAXLsqneQ= X-Received: by 2002:a2e:99d3:: with SMTP id l19mr1362376ljj.184.1631948568300; Sat, 18 Sep 2021 00:02:48 -0700 (PDT) Received: from kari-VirtualBox (85-23-89-224.bb.dnainternet.fi. [85.23.89.224]) by smtp.gmail.com with ESMTPSA id bu8sm700713lfb.216.2021.09.18.00.02.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 18 Sep 2021 00:02:47 -0700 (PDT) Date: Sat, 18 Sep 2021 10:02:46 +0300 From: Kari Argillander To: Konstantin Komarov Cc: ntfs3@lists.linux.dev, linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org Subject: Re: [PATCH 1/3] fs/ntfs3: Fix insertion of attr in ni_ins_attr_ext Message-ID: <20210918070246.rhbbvjwnwfnd4f7u@kari-VirtualBox> References: <9fd8b3d5-2f1e-29c3-282a-d2276b5d0db9@paragon-software.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <9fd8b3d5-2f1e-29c3-282a-d2276b5d0db9@paragon-software.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Sep 13, 2021 at 06:12:58PM +0300, Konstantin Komarov wrote: > Do not try to insert attribute if there is no room in record. > > Signed-off-by: Konstantin Komarov Reviewed-by: Kari Argillander > --- > fs/ntfs3/frecord.c | 7 +++++++ > 1 file changed, 7 insertions(+) > > diff --git a/fs/ntfs3/frecord.c b/fs/ntfs3/frecord.c > index 938b12d56ca6..834cb361f61f 100644 > --- a/fs/ntfs3/frecord.c > +++ b/fs/ntfs3/frecord.c > @@ -956,6 +956,13 @@ static int ni_ins_attr_ext(struct ntfs_inode *ni, struct ATTR_LIST_ENTRY *le, > continue; > } > > + /* > + * Do not try to insert this attribute > + * if there is no room in record. > + */ > + if (le32_to_cpu(mi->mrec->used) + asize > sbi->record_size) > + continue; > + > /* Try to insert attribute into this subrecord. */ > attr = ni_ins_new_attr(ni, mi, le, type, name, name_len, asize, > name_off, svcn, ins_le); > -- > 2.33.0 > >