Received: by 2002:a05:7412:da14:b0:e2:908c:2ebd with SMTP id fe20csp779605rdb; Fri, 6 Oct 2023 21:33:45 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGE6jtGtYn5yiQ/VxAp8I6qwR0E3HDCizqphS/C2+PtHrWshtBKFQauYbv+U3Z2MyyMQ9+r X-Received: by 2002:a05:6a20:4418:b0:14d:16c:2d20 with SMTP id ce24-20020a056a20441800b0014d016c2d20mr12829590pzb.44.1696653225027; Fri, 06 Oct 2023 21:33:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696653225; cv=none; d=google.com; s=arc-20160816; b=oz2FxOkz70P4BEUFs4UumGasBFFEpHYXw99bPT2yQX6NeKgBRV5xLG4sDM72++h+tu LzkoJiRjMNzlzDRFobZbC7Vt4lctnIoAzO7gZqm0iCbXTKRUmUYxPhdo1u7LXixQavSK KBPklEQhQiTMRpv625dk3jpmJfHqViP7wfGuj/9OqJP3E0T6MysoHFVq8pNBJrOW2+kc 5netcBene8oMrunJdbIfIRJtak7rv7WTy4kJzgRy76Uor/ZLcCVEIDQp8JZHuFasTREn OlbAhDM5hb2R9tcSuZ+ahf78lb2qYSMm8hybXC2oaKS7GAAoZTfOotZs2iA+6GlOgTt2 05nQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:message-id:in-reply-to :subject:cc:to:from:date:dkim-signature; bh=CXf8U8C79vuohVnXvifYnSGTERWziOzTJ9tH/XzO64c=; fh=EQ6QaW1wnvIGrovZ3y401NSnXA6kK2JQF0UFG79Q16E=; b=Dca8zgbo8ZHf4VKy/6UG6vzKcQX4RpoByJv9V7juIUEH2ijiG1iUnOK4mvN0H0fr8J 1dIKs+UM1oVhAZ/epGqxsGC3OG760JxP0ZGq3W/cbaBW/alrfNIRjMw2EVl2faG3o6ai HpH7JuY5SaVAb7TWqqyrjxmpsIk368uMxpQUNyXZglZhLW7DizVSrxmuojWq78HUfNtM 7btrn4PXopb5dk26l4e9UrlOgU3gTidAPpIw5XF2YeANuS5aHugD124rg1CNcMn9Y0OL JeqCQoibButKhyI4+zUKT7cWeDJ0uOEk5r/0bWLL9j0ZB5oANfgViMVILQ4jZJGR7Xcr wK9w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=G2QmNI90; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from howler.vger.email (howler.vger.email. [2620:137:e000::3:4]) by mx.google.com with ESMTPS id k4-20020a170902d58400b001c60783985esi5223570plh.93.2023.10.06.21.33.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 06 Oct 2023 21:33:45 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) client-ip=2620:137:e000::3:4; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=G2QmNI90; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id B2881801B39F; Fri, 6 Oct 2023 21:33:37 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1343534AbjJGEdS (ORCPT + 99 others); Sat, 7 Oct 2023 00:33:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50980 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1343508AbjJGEdP (ORCPT ); Sat, 7 Oct 2023 00:33:15 -0400 Received: from mail-yw1-x1130.google.com (mail-yw1-x1130.google.com [IPv6:2607:f8b0:4864:20::1130]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AD90AC2 for ; Fri, 6 Oct 2023 21:33:11 -0700 (PDT) Received: by mail-yw1-x1130.google.com with SMTP id 00721157ae682-59f4f80d084so32547027b3.1 for ; Fri, 06 Oct 2023 21:33:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1696653191; x=1697257991; darn=vger.kernel.org; h=mime-version:references:message-id:in-reply-to:subject:cc:to:from :date:from:to:cc:subject:date:message-id:reply-to; bh=CXf8U8C79vuohVnXvifYnSGTERWziOzTJ9tH/XzO64c=; b=G2QmNI90irCvCjWIWnb1O8LJCTN2BOv7ERI/hBa0JI6wuHJTlShGtxUeitJ3doYBHL S0vbiyldUBj0D2oT30PloiF47sz3aWzd6RsODBaEo0D5/xXwzw7Fx5P3XLs4A7so1sYn qO6hlZdVEj6s8m5DRe/HElUXohTv4ltysDA+WD8oSZDNE5FabyPInoGNug9NecLS0kzn J91Gbjp4ylwuOe3L/1BRLFj+TG0j60JyFELC5WfAQuKw/3sdllANgDaKI9D3c1hyZmir I6HKWZE/+6fjdHhlcTo2O2HbQI24aZvPE78sd+58Wq5tmkBPhN5d7QzOhLHsfa7Uyi+w IpHw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696653191; x=1697257991; h=mime-version:references:message-id:in-reply-to:subject:cc:to:from :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=CXf8U8C79vuohVnXvifYnSGTERWziOzTJ9tH/XzO64c=; b=Ljd9ob8pPND7GMVfUGTZb9diLYXj/ZDqc/tr65pgIEGrBgDc978ze0Yg3tZACLXIYu PLryXL8xQhuO1KRYt2flF0oD5XElJPLNigJ5dFvXgRhZywEldBJi2dlgI3Tv8Z0Ei9iy mfSFyZBUjnVrMA0kAK0UrT8FRkYcv+dwFYau08cgd8NIPuxENihwKMAcCefVsFZEmbwP wtGJkKad1IHTeVfMCuzF2vn5tYANIp/M4DbKvg3YNZDl04VOmNfTk30bKSqAn7ZtvhOQ PGpbE5Y4+j3qKPHXQhm4oGSzK3lXlq9d3LkLhomWDQiOilIFziolln4XOCCDwz7ZPEDr 1xDQ== X-Gm-Message-State: AOJu0YzACeznaiKqMHlbO1/R3NdoQUhqaD9YG82Cre7A7MmMUeGPaKNq GNaNBTLRKQN3boQEGvf83UHOWA== X-Received: by 2002:a0d:d641:0:b0:59f:4ee0:26e8 with SMTP id y62-20020a0dd641000000b0059f4ee026e8mr10164738ywd.21.1696653190770; Fri, 06 Oct 2023 21:33:10 -0700 (PDT) Received: from ripple.attlocal.net (172-10-233-147.lightspeed.sntcca.sbcglobal.net. [172.10.233.147]) by smtp.gmail.com with ESMTPSA id n16-20020a819c50000000b0057a8de72338sm1770078ywa.68.2023.10.06.21.33.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 06 Oct 2023 21:33:09 -0700 (PDT) Date: Fri, 6 Oct 2023 21:32:59 -0700 (PDT) From: Hugh Dickins X-X-Sender: hugh@ripple.attlocal.net To: David Howells cc: Christian Brauner , Jens Axboe , Al Viro , 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 Subject: [PATCH next] iov_iter: fix copy_page_from_iter_atomic() In-Reply-To: <1809398.1696238751@warthog.procyon.org.uk> Message-ID: <356ef449-44bf-539f-76c0-7fe9c6e713bb@google.com> References: <20230925120309.1731676-9-dhowells@redhat.com> <20230925120309.1731676-1-dhowells@redhat.com> <1809398.1696238751@warthog.procyon.org.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-Spam-Status: No, score=-4.8 required=5.0 tests=DKIMWL_WL_MED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_SBL_CSS,SPF_HELO_NONE,SPF_PASS, USER_IN_DEF_DKIM_WL autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on howler.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Fri, 06 Oct 2023 21:33:37 -0700 (PDT) [PATCH next] iov_iter: fix copy_page_from_iter_atomic() Trying to test tmpfs on latest linux-next, copying and building kernel trees, huge pages, and swapping while swapping off involved: lots of cp: error writing '/tmp/2624/Documentation/fb/vesafb.txt': Bad address cp: error writing '/tmp/2624/arch/mips/math-emu/dp_fsp.c': Bad address etc. Bisection leads to next-20231006's 376fdc4552f1 ("iov_iter: Don't deal with iter->copy_mc in memcpy_from_iter_mc()") from vfs.git. The tweak below makes it healthy again: please feel free to fold in. Signed-off-by: Hugh Dickins --- a/lib/iov_iter.c +++ b/lib/iov_iter.c @@ -497,7 +497,7 @@ size_t copy_page_from_iter_atomic(struct } p = kmap_atomic(page) + offset; - __copy_from_iter(p, n, i); + n = __copy_from_iter(p, n, i); kunmap_atomic(p); copied += n; offset += n;