Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp4454490rwb; Mon, 21 Nov 2022 07:48:14 -0800 (PST) X-Google-Smtp-Source: AA0mqf6uKMm9s3/rmEKXwM2nyhgq6ybvXTQ7hL2WMrUvLhFV9rb2CHv7T+WdwqbUsjtd4UEeKQxO X-Received: by 2002:a17:906:816:b0:7a4:c236:906 with SMTP id e22-20020a170906081600b007a4c2360906mr43797ejd.318.1669045694671; Mon, 21 Nov 2022 07:48:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669045694; cv=none; d=google.com; s=arc-20160816; b=GSnyYOtjC0wW1QK0zMjjc13aKRXOo5w4PJekaq4BcF9OrjDfzH9in46KsNhs+eKtp6 D3N3ITTz/bItSMaNhzM7x16FzWbWhA7ELAz+Opk03yU5iu7Tg1MurdmN5B8LpHgUALJh +/vw013b2hSIU2FTxHHE0ND5oYIBlr+ngAfsGTjF8k7W7hvuHOYub4Jcxi6l532Aqppx I53P3MxdIJxf2g/yRS9cpOaMv7fJukWjCmQRucuHAk+u4MiOTyl1aak+hQBpZz+WYKQb QAEmhtXtbVQmi7Adp9NbjqYxwyw7WFjokZZhUWcFmusTqVkDNkvEKOKgjNOK62cwJpMX LTqA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:references :in-reply-to:subject:cc:to:from:dkim-signature; bh=bEARu0JbQorKPvi4zAUJ1f0tT4f5K3ZqomAc0zTv4IU=; b=m5Ym5ew1VhMpGSFu8m7azt+20jMdVVrWHwf172jbk8Vf+NoLHGTdKQFkWV9O9yprX2 QDiqFp2UdX/LSu/jbGaFYqx7bDh1ghcxEU05Ne7wAoXGp5MdAO1ksQxMughqJ8GNX6d9 rcwwotB5uot4s5Zd6BBFO7BqHZPOzh81COdtqDrSetcDpPxS9eNvJ1TKCWI8OJ6UXaGX 4liIEkeZNZPD1iT0jFk2TMEjunj1jho4ltAy8FBdzVhbhH/NIY983HeMkzETFpf6zZCR PPCSDw9idg2bJa/LBXqO1Z2clJQ7VdrsKWmI3YPiYizDAG4S3ThNvnGok2ksRtOzxUlx E5SQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@cjr.nz header.s=dkim header.b=bUeIfrhi; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=cjr.nz Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id w13-20020a170906130d00b007ae664aa7dbsi8429229ejb.877.2022.11.21.07.47.44; Mon, 21 Nov 2022 07:48:14 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@cjr.nz header.s=dkim header.b=bUeIfrhi; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=cjr.nz Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231996AbiKUPGV (ORCPT + 91 others); Mon, 21 Nov 2022 10:06:21 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60928 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231956AbiKUPFu (ORCPT ); Mon, 21 Nov 2022 10:05:50 -0500 Received: from mx.cjr.nz (mx.cjr.nz [51.158.111.142]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8D1DCD9B8E; Mon, 21 Nov 2022 06:54:34 -0800 (PST) Received: from authenticated-user (mx.cjr.nz [51.158.111.142]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: pc) by mx.cjr.nz (Postfix) with ESMTPSA id 45B8B7FD25; Mon, 21 Nov 2022 14:40:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cjr.nz; s=dkim; t=1669041637; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=bEARu0JbQorKPvi4zAUJ1f0tT4f5K3ZqomAc0zTv4IU=; b=bUeIfrhiI1iRGk6aylBQTqyrT9PYNIYcVY0djJjxf6ssRl1nqqNJltP6/NdbjN6LDiPdOo bOYBdhhQLZtO27XSd7Oal3iLJIyDYc5KT68mYjzRw1JO4BKli3GTh+z8DNChXSjRI+Pn5D NOU0Un9UlJcI9rSRJUHPG80FG9dMY/CN4ou1YtcjVh202tI1/ATCRaN1AGXUI/QJF0D0Tk wbvyHuebllBcWXFOzFt5RadidQq+bVdMeGF3EPnmFFBYqn5f3sWGHD9MFUdIXE5Jla3Uz7 hfGrtR6LX5FCIBTF1tjoadg2/L2d5oCyNpVxWnM6MX8yB7kCoZFk6jT/+v4iUA== From: Paulo Alcantara To: ChenXiaoSong , sfrench@samba.org, dhowells@redhat.com Cc: linux-cifs@vger.kernel.org, samba-technical@lists.samba.org, linux-kernel@vger.kernel.org, chenxiaosong2@huawei.com, yi.zhang@huawei.com, zhangxiaoxu5@huawei.com, yanaijie@huawei.com Subject: Re: [PATCH] cifs: fix missing unlock in cifs_file_copychunk_range() In-Reply-To: <20221119045159.1400244-1-chenxiaosong2@huawei.com> References: <20221119045159.1400244-1-chenxiaosong2@huawei.com> Date: Mon, 21 Nov 2022 11:42:01 -0300 Message-ID: <871qpw1i9y.fsf@cjr.nz> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS autolearn=ham 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 ChenXiaoSong writes: > xfstests generic/013 and generic/476 reported WARNING as follows: > > WARNING: lock held when returning to user space! > 6.1.0-rc5+ #4 Not tainted > ------------------------------------------------ > fsstress/504233 is leaving the kernel with locks still held! > 2 locks held by fsstress/504233: > #0: ffff888054c38850 (&sb->s_type->i_mutex_key#21){+.+.}-{3:3}, at: > lock_two_nondirectories+0xcf/0xf0 > #1: ffff8880b8fec750 (&sb->s_type->i_mutex_key#21/4){+.+.}-{3:3}, at: > lock_two_nondirectories+0xb7/0xf0 > > This will lead to deadlock and hungtask. > > Fix this by releasing locks when failed to write out on a file range in > cifs_file_copychunk_range(). > > Fixes: 3e3761f1ec7d ("smb3: use filemap_write_and_wait_range instead of filemap_write_and_wait") > Signed-off-by: ChenXiaoSong > --- > fs/cifs/cifsfs.c | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) Reviewed-by: Paulo Alcantara (SUSE)