Received: by 2002:a5d:9c59:0:0:0:0:0 with SMTP id 25csp2169917iof; Tue, 7 Jun 2022 22:03:50 -0700 (PDT) X-Google-Smtp-Source: ABdhPJziKZmFcnLRt9JXoSDL69N5LKLS+D1nJz4LAmgIzU5Auc/vBvPGGYoB+KZlhAGLuACW5EQF X-Received: by 2002:a65:6d0d:0:b0:3fb:1477:5191 with SMTP id bf13-20020a656d0d000000b003fb14775191mr28584848pgb.541.1654664630153; Tue, 07 Jun 2022 22:03:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654664630; cv=none; d=google.com; s=arc-20160816; b=OkyEfvDJGvd7Nl0eFqQNt53UAQY0vlgKmzamg7ssyU5eufd6d67OrVDEvFPT7CQO4g TNW93EBP6A8pLjThJetk0ZYCqVE9Vnmpa/b6XYlSy0gXuKa+KeU3ct5KOXgfSt8L8oY6 AqNFq1mVAduF3cFqRq1mGTMOFBUbHj4IBnhHkqfPmshWaDHp4KNQ79Bl+ArpCU42038x F5+lxijcmZrLVhgaHIe96dQcuWbwTM5pM1JUTZNFvTGR1tk1omCUk3lw6Q0FduZUP323 vZat+Fsu/GdNeFiX9RoJJ530n+2nnjbDFC5vxkANBCMDmWLuFCbUhgZoTc9ttheegpoB 8l3A== 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=px3wfzJEBuyrZvvjAFqXkm7mIJ8eJvFRVXTq4z3EHWk=; b=zoPyLL72WOOAXfxX66+tpoSTXBiMEYLUK669xDX1hz/ejhE74ZN4O9tCqOaQakH2iQ hvBlaycQmxVL8qBQG42XaMbfyqynucKR3Fm1YMBuIGgGfIlANsaGkbkOy3wxBCLyifnx CEUKgnMU4qFTH6Vq8oeVnxt6Gcs9ZkGJbaaX9iwcTRLM0khsc36mKn0+pRyqx03mWguG gFxtPRFXwYhs6zqi9lFQwp9elkv7CXU8IAABL91nOV3iYTIBUS05sVNBEH4A5teeL++w IB207/cnHrRt+rdE/bQ7n0WJ55eIU36huPAtmHYDYHaVSkrAF9p5lGtlyKmDI5pCVTEN I7gw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=zT7z9D53; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 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. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id l21-20020a056a0016d500b0050d6182e323si29407045pfc.146.2022.06.07.22.03.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Jun 2022 22:03:50 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=zT7z9D53; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 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 8259B45D338; Tue, 7 Jun 2022 21:31:29 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1358200AbiFGUTb (ORCPT + 99 others); Tue, 7 Jun 2022 16:19:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50912 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1356872AbiFGT2S (ORCPT ); Tue, 7 Jun 2022 15:28:18 -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 6D8401A1970; Tue, 7 Jun 2022 11:11:18 -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 078E1617B3; Tue, 7 Jun 2022 18:11:18 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 157A0C385A2; Tue, 7 Jun 2022 18:11:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1654625477; bh=Lavhzrq0jsCEomc5dXZME1+q67KFdyojZYlnsdCrLH8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=zT7z9D53SzTiKSUu0IXWI8+MxbeKM5RIBHDDQrdMDW6Gv0XxO6jpzP8YhIBLdckTX rsNUvqAnalYijUknYHkpN+ybkpgHPdLu4OCKg+l/xvbsHPf0L/b+wbQY4lMaP/VEbt hUygvtVD6Ng4Gm8PjdU3d30Zir+MaKUSNfjzAmkg= 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.17 031/772] cifs: when extending a file with falloc we should make files not-sparse Date: Tue, 7 Jun 2022 18:53:43 +0200 Message-Id: <20220607164949.937017659@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220607164948.980838585@linuxfoundation.org> References: <20220607164948.980838585@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 @@ -3808,7 +3808,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);