Received: by 2002:ab2:3141:0:b0:1ed:23cc:44d1 with SMTP id i1csp675579lqg; Fri, 1 Mar 2024 19:01:51 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCV8KyVDlIe6mQY5VNDepgqbMwSTv2SOZQoPxy3uPtdXqKC7ib0YAzt3Ct7JHYun0uxXi3WRNQUgv95P+7pz4iXK5Gd9gO1NudEm2U+TpA== X-Google-Smtp-Source: AGHT+IHoyc0Ba/UNvSITSTMl2Wiky6HjMAIdj734yrEH4Ur+iokxGhIYtdU9K1c8Gnc3Ok3ftMlo X-Received: by 2002:a05:6a21:78a7:b0:1a1:3fd9:e531 with SMTP id bf39-20020a056a2178a700b001a13fd9e531mr2541789pzc.4.1709348511095; Fri, 01 Mar 2024 19:01:51 -0800 (PST) Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id q89-20020a17090a756200b002991fd04889si6725735pjk.95.2024.03.01.19.01.50 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Mar 2024 19:01:51 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-89317-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linux-foundation.org header.s=google header.b=PiUIIedC; arc=fail (body hash mismatch); spf=pass (google.com: domain of linux-kernel+bounces-89317-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-89317-linux.lists.archive=gmail.com@vger.kernel.org" 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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 2ADE7B248EC for ; Sat, 2 Mar 2024 03:00:15 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 3BB1510A12; Sat, 2 Mar 2024 02:59:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=linux-foundation.org header.i=@linux-foundation.org header.b="PiUIIedC" Received: from mail-ed1-f53.google.com (mail-ed1-f53.google.com [209.85.208.53]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id EA2356AD6 for ; Sat, 2 Mar 2024 02:59:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.53 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709348392; cv=none; b=og2HFesfl+NXHkeOegj0D9iU0NtRM/bFRc5xPgqChgnXMU2l9zbFpmiB/lRjO0MUyuTQb5fhPz1GmmqAu+qWHWoqjuv/i4gtct9pEgFQkgJptGf1K19W5f/pdcjdyuwoSL7O2bEAn0HO5QR61OvcFoG5/XUt5rTy4LK85hjMhlg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709348392; c=relaxed/simple; bh=wcNPoo7bbe8Q2KGr6zjYKhQPrtkysYbLY4IjeJ9sPR4=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=eh1rBE5sZjrFjBLXLfyxwprFM/5cwL+LXtRZbkUFm2DnUREM1scLhCtWngxNlg9F1a5yYhlJ0redBvMpQigG378+XMbuYjvwmcy27b9y6FRyFwzXXVcEgpSBcc6Hsx1s7sy/gqVJeH4ensYcOkxpbIRYOoAleM2Gqxp2SIIOTlY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=linux-foundation.org; spf=pass smtp.mailfrom=linuxfoundation.org; dkim=pass (1024-bit key) header.d=linux-foundation.org header.i=@linux-foundation.org header.b=PiUIIedC; arc=none smtp.client-ip=209.85.208.53 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=linux-foundation.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linuxfoundation.org Received: by mail-ed1-f53.google.com with SMTP id 4fb4d7f45d1cf-56648955ac5so3875047a12.3 for ; Fri, 01 Mar 2024 18:59:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=google; t=1709348389; x=1709953189; darn=vger.kernel.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=Z172ARkWy4CrNdjX0Z199syeSzJdWbGHBapXPagpL/g=; b=PiUIIedCtA2Y4JQnyWQVOP6JRhU7IAEWDP+qZ6HvMlSbT4GBpThwHgJyHH9OHtGifk G6DKZ6/WEotxIWBBRS37YHxecKD7W+ldHgbPA+jYbF75RRCB9ZE4mVRkKvkscs7H+5c+ gUsUyaTDiN+INbBCwDVkPpOP/D6R6Mkat1+iE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709348389; x=1709953189; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=Z172ARkWy4CrNdjX0Z199syeSzJdWbGHBapXPagpL/g=; b=EBfiVLpCXcSC9dP2P5x0htnGL/QToGJRH0mF/H4qYEfgZc64WWM4SzZeV/cqPRy45g 9eg2BllzJ+zAfw7XHz9Ju9yyMzi2a8nBJxTknm1Nnm12fOMGuSBAHJ/Nv/eVLZYFj0Fh An5rSie2NukPrTJbKo78tm5A9ty/V4o95M2EJwFeuzb5SGdwq8ZikeevNk9nND/1Vn6S oJfokmTQoDqcO+hrWUJ2lqubhuP4RvCXsZx0YlQUIC6Leq1SFMiuMk6pPR62reSFfSM2 ekeM2GsGHxOlVUAMl+djDCoi3ZIvApYHUO7HTXKmj13DRUi6sk5tqOP3by3xzi8QpWKH AZRg== X-Forwarded-Encrypted: i=1; AJvYcCUl0UDCqBWyHtZ2Wvme2CM/KEFEN5GP23ljti8TT2MtPwmAFZXNsM0Ip1zHq4NcsuFgCFBuulquDpiRxPZeOZ2v9sspf4U2kQliI56Q X-Gm-Message-State: AOJu0YzIOgJJrDcFjUKDoOaeClF1zwlnxAheUqPeNtlzhzWbQcoMRscn sfk/czhBfwL0JXcVea8ZQDlYe0Eg4RzaNKRFYX8o53BqfOYe4voVz9hK7racwMnXtRX/tL2dxUj TJmaS7A== X-Received: by 2002:a50:cbc8:0:b0:563:ccd1:26bd with SMTP id l8-20020a50cbc8000000b00563ccd126bdmr2689599edi.2.1709348389177; Fri, 01 Mar 2024 18:59:49 -0800 (PST) Received: from mail-ej1-f51.google.com (mail-ej1-f51.google.com. [209.85.218.51]) by smtp.gmail.com with ESMTPSA id n24-20020a05640204d800b00566f92f1facsm424086edw.36.2024.03.01.18.59.46 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 01 Mar 2024 18:59:46 -0800 (PST) Received: by mail-ej1-f51.google.com with SMTP id a640c23a62f3a-a44d4519e7eso19109766b.3 for ; Fri, 01 Mar 2024 18:59:46 -0800 (PST) X-Forwarded-Encrypted: i=1; AJvYcCUHFRK6DMJfEO2+Voz1TzWZuiMjOV7G8ZPeShQ/xbd+D1+/fEy3Nr7CtPWopS584qsFwd/xy4X1qeQurEYxmXK3IEwXe+L9XnkD9eEI X-Received: by 2002:a17:906:f989:b0:a44:27e8:f514 with SMTP id li9-20020a170906f98900b00a4427e8f514mr2273960ejb.38.1709348385722; Fri, 01 Mar 2024 18:59:45 -0800 (PST) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20230925120309.1731676-1-dhowells@redhat.com> <20230925120309.1731676-8-dhowells@redhat.com> <4e80924d-9c85-f13a-722a-6a5d2b1c225a@huawei.com> In-Reply-To: From: Linus Torvalds Date: Fri, 1 Mar 2024 18:59:28 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [bug report] dead loop in generic_perform_write() //Re: [PATCH v7 07/12] iov_iter: Convert iterate*() to inline funcs To: Tong Tiangen , Al Viro Cc: David Howells , Jens Axboe , Christoph Hellwig , Christian Brauner , David Laight , Matthew Wilcox , Jeff Layton , linux-fsdevel@vger.kernel.org, linux-block@vger.kernel.org, linux-mm@kvack.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Kefeng Wang Content-Type: multipart/mixed; boundary="0000000000005434e50612a4af27" --0000000000005434e50612a4af27 Content-Type: text/plain; charset="UTF-8" On Thu, 29 Feb 2024 at 09:32, Linus Torvalds wrote: > > One option might be to make a failed memcpy_from_iter_mc() set another > flag in the iter, and then make fault_in_iov_iter_readable() test that > flag and return 'len' if that flag is set. > > Something like that (wild handwaving) should get the right error handling. > > The simpler alternative is maybe something like the attached. > COMPLETELY UNTESTED. Maybe I've confused myself with all the different > indiraction mazes in the iov_iter code. Actually, I think the right model is to get rid of that horrendous copy_mc field entirely. We only have one single place that uses it - that nasty core dumping code. And that code is *not* performance critical. And not only isn't it performance-critical, it already does all the core dumping one page at a time because it doesn't want to write pages that were never mapped into user space. So what we can do is (a) make the core dumping code *copy* the page to a good location with copy_mc_to_kernel() first (b) remove this horrendous .copy_mc crap entirely from iov_iter This is slightly complicated by the fact that copy_mc_to_kernel() may not even exist, and architectures that don't have it don't want the silly extra copy. So we need to abstract the "copy to temporary page" code a bit. But that's probably a good thing anyway in that it forces us to have nice interfaces. End result: something like the attached. AGAIN: THIS IS ENTIRELY UNTESTED. But hey, so was clearly all the .copy_mc code too that this removes, so... Linus --0000000000005434e50612a4af27 Content-Type: text/x-patch; charset="US-ASCII"; name="patch.diff" Content-Disposition: attachment; filename="patch.diff" Content-Transfer-Encoding: base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