From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6BBDEC433EF for ; Tue, 7 Jun 2022 20:19:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1358602AbiFGUTc (ORCPT ); Tue, 7 Jun 2022 16:19:32 -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 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);