Received: by 2002:a5d:9c59:0:0:0:0:0 with SMTP id 25csp2182763iof; Tue, 7 Jun 2022 22:26:46 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz2DWa/AWgQ8+eqY53MjAVvwskxT3azB2tG12eEdnQ76k6bvFFafP93fL/+Gn8jRGZ/lswZ X-Received: by 2002:a05:6a00:1c4e:b0:51b:ebf1:53c4 with SMTP id s14-20020a056a001c4e00b0051bebf153c4mr23766922pfw.49.1654666006293; Tue, 07 Jun 2022 22:26:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654666006; cv=none; d=google.com; s=arc-20160816; b=bl9pAgLbUappjNeJG++QXoGVPcGVA6dptba0hzA2fOOLRpjXDEXAE+ttOYCgHR01fN bb0jsC6UQOoOUUJd3hG2Lmg0wCr1nE26QGErEpyvhGgUey8DqtO5z3hhlBTTj3nJBPDC 8unmPIG/PXmSRGxQJw9kLODeWGGKpaGt1gUXM63+QWXBAePF43zOi52d7HH/q5xDLORt /y2rg9foSUQc4C4vTt3wICR/VWH0XaBrhEvMMYdrvDQduWZS5lUhUXN1ipsNOXNwhX1N qZIhIGEjQ59iPQY2gfICWX7Ur+7X2PngAltIVjaI9NtTRwqqzpwwJWEJC4TI/ghzLgTu HJrg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=pkTlXPI88wiS3jZFIUTuDDdIw7Mck+otuKF/DyfPgmE=; b=Mk7LJFg+PC3E9EkOq/nJMs3uamLnR4zrZdOdTtk6+2ep7k3NuPxK4fiwoZOf8X4pUB xOR6qqj4fRy1h2gFTO51JqBTQ1YhWjgibPmeUEwAJQ2wixRe2o9F2IRBr2W553vJdCMv v74mB+1jyCZJ1I6EH8jgmtlWDEvvCC3CVdCBamYBfF2TT954cK2fI9UJsR4b/MyROAQ1 HJ3LCc5I1Ieg8r6yhuHym8J4MFnegeYsElk4AmifWQ5BP4TfFMXvEaPiGDUYr/7ZCvOp VtCLN7Z0K29UTn+6McTo3Jf4RxPHrzpqL0of9lP10GfhVhibLLiVZl7jj10z317WSVur j+Tw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=DpL2iP7x; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id d63-20020a636842000000b003fdf4a109f2si2356863pgc.260.2022.06.07.22.26.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Jun 2022 22:26:46 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=DpL2iP7x; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 11982479768; Tue, 7 Jun 2022 21:53:34 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1382976AbiFGWAg (ORCPT + 99 others); Tue, 7 Jun 2022 18:00:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40164 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1379226AbiFGVCN (ORCPT ); Tue, 7 Jun 2022 17:02:13 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B3C3A614C; Tue, 7 Jun 2022 11:46:59 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 4F0E96156D; Tue, 7 Jun 2022 18:46:59 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5FAE6C385A5; Tue, 7 Jun 2022 18:46:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1654627618; bh=mLvHhE7q4dlXMPcB+5rAF8lzM5mQNsQtmSS0dFF7Lj0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=DpL2iP7xAbuyw+JZ077nHh2PoxGWn60EeXIYLyiIjPwKY82j9fjuyJnDjaj7ovXqx gcqTKuE3JLMrU/xrF0xmL+hkhSjUgcvzrg9eMrGCLgQ7VR/kz09qIChWKNGlZPltxm 8KFiQCp/vqTYoImJVJ13/tcDVZvKD9Ftj+bzemD0= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Ronnie Sahlberg , Steve French Subject: [PATCH 5.18 033/879] cifs: when extending a file with falloc we should make files not-sparse Date: Tue, 7 Jun 2022 18:52:31 +0200 Message-Id: <20220607165003.637742817@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220607165002.659942637@linuxfoundation.org> References: <20220607165002.659942637@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-3.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Ronnie Sahlberg commit f66f8b94e7f2f4ac9fffe710be231ca8f25c5057 upstream. as this is the only way to make sure the region is allocated. Fix the conditional that was wrong and only tried to make already non-sparse files non-sparse. Cc: stable@vger.kernel.org Signed-off-by: Ronnie Sahlberg Signed-off-by: Steve French Signed-off-by: Greg Kroah-Hartman --- fs/cifs/smb2ops.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/fs/cifs/smb2ops.c +++ b/fs/cifs/smb2ops.c @@ -3837,7 +3837,7 @@ static long smb3_simple_falloc(struct fi if (rc) goto out; - if ((cifsi->cifsAttrs & FILE_ATTRIBUTE_SPARSE_FILE) == 0) + if (cifsi->cifsAttrs & FILE_ATTRIBUTE_SPARSE_FILE) smb2_set_sparse(xid, tcon, cfile, inode, false); eof = cpu_to_le64(off + len);