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 56A84C433EF for ; Tue, 7 Jun 2022 21:04:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1378944AbiFGVEG (ORCPT ); Tue, 7 Jun 2022 17:04:06 -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 Precedence: bulk List-ID: X-Mailing-List: stable@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);