Received: by 2002:a05:7412:cfc7:b0:fc:a2b0:25d7 with SMTP id by7csp1210829rdb; Mon, 19 Feb 2024 07:42:48 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXd5dUXjZ30oeTEw6ifaQ8u216VexImMggxLK/b3fVB5R67KOmUuVUtI90EQA15TC3hBk1BrVtsGpatEE2kr2D6ATAF6BurDQqXRNT7dQ== X-Google-Smtp-Source: AGHT+IE+PdZ4YqWqTCxBcm1I+J3h3HDaNx5hE8zxu457dTdt/c31G9L9NHkd8npWjHxAapqPFVNV X-Received: by 2002:aa7:c610:0:b0:564:5ed6:5ac2 with SMTP id h16-20020aa7c610000000b005645ed65ac2mr2853394edq.36.1708357368603; Mon, 19 Feb 2024 07:42:48 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708357368; cv=pass; d=google.com; s=arc-20160816; b=mhVoddHHNQJFuQuvcRpiugjWW13NuJm8p50rIM+8u93carInF8pOei4ptX5jwtIHmv G8ycraehaqNx44bLbF57pEkoAVPXxAJXl5x6iErm+Ssv6+7MRGCtw2nzixFajpaITQAt 6hj6EDk3kUHheWjm+p4PDUNKbYpiW8MUznmNEAue0sm6eHel7VTDAig+74mqczUlJ/a7 bziCh9UNbEYpEYRhIzhffHGQaAbtVhsyTzhLLb5kTK8aCB6GDOwsbvJjNSAJmt2w36jJ AF8EOIQ/uM2o6XKCINnw/Xr0IsF5bwNiE/WNP8Ve9aC8TECF139lYCDqDv3ESEzvO6ra t1xQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=message-id:date:content-transfer-encoding:content-id:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:subject:cc:to :references:in-reply-to:from:organization:dkim-signature; bh=gYi7OFizi+TSpI37jerYjh3Z/519CTMS/OFVVmKV/5k=; fh=qhHubXNcxuNchQ+QcrNckccrQ7w/b18N3gzlQ95tPfs=; b=Gvf6MhYisysRdP0AaO6CcQOQ0yQvqrTMsGACXvE9mDXrj6TJ7oJeH/lblmhHDyUm5E aGnDmyPw/iJGYjIh2P21iDUKF+56cJ5Yl4eCmB/B9vmKIb2UyQRLRZ990O6tENXLnQTi eDLZhGVMkYgTPdFjsjN4dqViNXOvH7wWIw7VKYGvwUYJKMrp9xJ87eqqziN2ZNts+5/o JS1xuF9+AWYAuG5Ufkf7xTSREXGeZaXK/baD5lXvldQqKtPRAYVtzsB7nZ8z9ZnzHNs+ h70psT4NZqNz6zhl/+3s3fn1K5085NfQykh2WUvOu1nTaTAvQLAGCsoAd3bAiAR2YZwT dNHg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=ff9ttbFa; arc=pass (i=1 spf=pass spfdomain=redhat.com dkim=pass dkdomain=redhat.com dmarc=pass fromdomain=redhat.com); spf=pass (google.com: domain of linux-kernel+bounces-71607-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-71607-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id v26-20020a50955a000000b0056480179295si771196eda.409.2024.02.19.07.42.48 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 19 Feb 2024 07:42:48 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-71607-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=ff9ttbFa; arc=pass (i=1 spf=pass spfdomain=redhat.com dkim=pass dkdomain=redhat.com dmarc=pass fromdomain=redhat.com); spf=pass (google.com: domain of linux-kernel+bounces-71607-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-71607-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 2DB8B1F23135 for ; Mon, 19 Feb 2024 15:42:48 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5A44F3C49C; Mon, 19 Feb 2024 15:42:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="ff9ttbFa" Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id EEEB53A287 for ; Mon, 19 Feb 2024 15:42:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.133.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708357344; cv=none; b=VhLub02a77ssLBBnKsGJopwB/qdWUJSnZ910eAui6B9hiNnC7Hht+bZ3Yw+YrHBF1GRx+S3DS1RNp70sZCa0EFDAcPRL2G2kERFC8ei3jgUI0t5hYTIFsnAggz0/XT2Li2308i6SOPj4bJp9nwyWCl6b4m1SpWI3LWR6HawyOFo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708357344; c=relaxed/simple; bh=NIFtUpFLsHivFguvB+ZvyrkpY/INW7ZD0v9T38aeM/k=; h=From:In-Reply-To:References:To:Cc:Subject:MIME-Version: Content-Type:Date:Message-ID; b=TJdE+Y6cE0Pw451AWB6dTXQ84OLOTIFeg7EB7gXHUDzIIaacdIfb+9Oub3MUKLsAgCQaBJyZf7zSt9UbsrFlG20aF4D4/iqmi+GW1Is0nup1IfjHONHzWXw6YtrtsOGHPIiTscM49uRLUnH2f10VxRL8AX+FABOjusav7U4lfMQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=ff9ttbFa; arc=none smtp.client-ip=170.10.133.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1708357341; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=gYi7OFizi+TSpI37jerYjh3Z/519CTMS/OFVVmKV/5k=; b=ff9ttbFaABc9sfvfG9s9reKZZ1nCAOrOlf4Tjj9J+SrK1r+thK8rom1LysXhe8tcOCDcRm 8j+Vfz9eogr1laT2SxD58VWOG/tgcyN1m9JA67QuiVFKn0XBWAvvu6uaou2ntDObkOMC7e SG5Hhc48evxEV+KCwCyhtmmFYwRADOI= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-634-78AazjT2NnWPZegN_d8_QQ-1; Mon, 19 Feb 2024 10:42:17 -0500 X-MC-Unique: 78AazjT2NnWPZegN_d8_QQ-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 6C10E85A588; Mon, 19 Feb 2024 15:42:16 +0000 (UTC) Received: from warthog.procyon.org.uk (unknown [10.42.28.15]) by smtp.corp.redhat.com (Postfix) with ESMTP id A3E7D1C060B3; Mon, 19 Feb 2024 15:42:14 +0000 (UTC) Organization: Red Hat UK Ltd. Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod Street, Windsor, Berkshire, SI4 1TE, United Kingdom. Registered in England and Wales under Company Registration No. 3798903 From: David Howells In-Reply-To: <187136.1708356611@warthog.procyon.org.uk> References: <187136.1708356611@warthog.procyon.org.uk> <20240205225726.3104808-1-dhowells@redhat.com> To: Steve French Cc: dhowells@redhat.com, Jeff Layton , Matthew Wilcox , Paulo Alcantara , Shyam Prasad N , Tom Talpey , Christian Brauner , netfs@lists.linux.dev, linux-cifs@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v5 00/12] netfs, cifs: Delegate high-level I/O to netfslib Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <187506.1708357334.1@warthog.procyon.org.uk> Content-Transfer-Encoding: quoted-printable Date: Mon, 19 Feb 2024 15:42:14 +0000 Message-ID: <187507.1708357334@warthog.procyon.org.uk> X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.7 David Howells wrote: > I don't suppose you can tell me what line smb2_readv_callback+0x50f/0x5b= 0 is? It's almost certainly the iov_iter_revert() here: switch (mid->mid_state) { case MID_RESPONSE_RECEIVED: credits.value =3D le16_to_cpu(shdr->CreditRequest); credits.instance =3D server->reconnect_instance; /* result already set, check signature */ if (server->sign && !mid->decrypted) { int rc; iov_iter_revert(&rqst.rq_iter, rdata->got_bytes); iov_iter_truncate(&rqst.rq_iter, rdata->got_bytes); The reason that the: [ 228.573737] kernel BUG at lib/iov_iter.c:582! happens is that we're trying to wind the iterator back before its start po= int. Now, the iterator is reinitialised at the beginning of the function: if (rdata->got_bytes) { rqst.rq_iter =3D rdata->subreq.io_iter; rqst.rq_iter_size =3D iov_iter_count(&rdata->subreq.io_iter); } so the reversion is probably unnecessary. Note that this can only happen if we're using signed messages: if (server->sign && !mid->decrypted) { as we wind back the iterator so that we can use it to feed the buffer to t= he hashing algorithm. David