Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp3507946pxv; Mon, 26 Jul 2021 05:50:33 -0700 (PDT) X-Google-Smtp-Source: ABdhPJypCDKf1q5NEMymftHGaa4J5iCRffe35hBZGMLWHBdSJ4a+I86VsmDgl3hw13/rok9ThdUM X-Received: by 2002:a17:906:1fd3:: with SMTP id e19mr9985464ejt.421.1627303833016; Mon, 26 Jul 2021 05:50:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627303833; cv=none; d=google.com; s=arc-20160816; b=Xs5sdOTHaCRuSZyYTAIhe4yAK+vI3D/XD3lcPIYQV6ApHCu83zGx4xIvMml55SMOrb n4REf5jOeRAFi8mlI1Bk/MrbwPFvaaodjRPg7yZzxPT4OJxZNyhiFKfZLp8KHpHVAD4l X5wMlIEpBHIg0uApmb5Wpju+wj3LFCPnAYpa9EyFXGxDTkAUe9dHO5kQXmDoXbVvTelA ArfAkgvcPD6cBoTUT2nBGgBr4YyZDyBV4vYI4/5C7GUikGm8Ke785zgE90+GIS/a1iv7 VFkgw1x4bJyrCyPzyJDIkjPLX2gF1aMraGbMq5sAU8ExIj6IQTs7nELxTADfwA8OVtRo mWPQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=YnYb8vRrXr3FxlNbM7BmLabWx+TSAadNbGAbdiZoOjA=; b=XAEdriWh643eJgBjQg0lkrOCsiQhzhgcEr1WieYnaOmA2Imlp35kqH9Ubqzi/i5VqK whLYfGvRVF/uLijvFvNFw9b8CoQJ33iNG1gZ7Gvw/PxATxvJmFSV61naEPYC66fhdI0U aEhfqmVicCmInMqdU6bZ68pBt1bc7t35briuD6jWAOfBCD+gcLvsa7/Xr3n9dy7afu7H 6pOaiYMPpCTk5CdQth7EOtjts9YOtFEivinQUacxe6bPRr12YuDeBvhaKq1wDhQ0Aumx tiLKF/mUJinzkTsZcbPrV6vMeh5F+ZOnAowDCX40U+Sz7Ghy7Xrkq6VfKfHjB7k7MgWB BeQA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=A1iU3Vbo; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id aq11si3987194ejc.550.2021.07.26.05.50.09; Mon, 26 Jul 2021 05:50:33 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=A1iU3Vbo; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234193AbhGZMHA (ORCPT + 99 others); Mon, 26 Jul 2021 08:07:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33786 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234260AbhGZMGj (ORCPT ); Mon, 26 Jul 2021 08:06:39 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B097FC0617A1 for ; Mon, 26 Jul 2021 05:46:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=YnYb8vRrXr3FxlNbM7BmLabWx+TSAadNbGAbdiZoOjA=; b=A1iU3VboJ6FOB2nV65zruUFHye 3IRBDvTt4YJWQRJtChVduRiQcjsa78Imto78cOV/HAQpQ9WrfndEQE71hjNiA6Tf/jh0LJvQtF3Ea MoO4djcVS2Szb1lVU7k7IKpyO+iJZ4oWfses1AZ05UJQJy68+i9bWCVytGOBFh/iIeJg+bSZ+jHyk 5LiAGbsilJ1P2D8TfSsB03woWu3EH2ljle5uOT7EAwF1U6xR6URAygQscUZ2Q0K3YbQ99jAv53m8n RH+tJ6dsxe50F/w9HiNZraSfBIzZ9jUiaxh6QZNSxpTJUBgF9TTAzNmCUm0i+fOSentrW5Jvh7mxH VduRG/7Q==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1m7zzI-00DxU2-AC; Mon, 26 Jul 2021 12:46:06 +0000 Date: Mon, 26 Jul 2021 13:45:40 +0100 From: Matthew Wilcox To: Andrew Morton Cc: syzbot , linux-kernel@vger.kernel.org, linux-mm@kvack.org, syzkaller-bugs@googlegroups.com Subject: Re: [syzbot] BUG: sleeping function called from invalid context in folio_copy Message-ID: References: <000000000000f84cad05c7ee4778@google.com> <20210725221834.35e077daff0005f3d78d08d7@linux-foundation.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210725221834.35e077daff0005f3d78d08d7@linux-foundation.org> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Jul 25, 2021 at 10:18:34PM -0700, Andrew Morton wrote: > (Cc Matthew) > > (It might not be a folio thing at all - I haven't checked yet) Already fixed, thanks. folio_copy() had a cond_resched() in it, even if it was only copying a single page. Now it only calls cond_resched() if it's copying more than one page. We discussed this in the folio call on Friday, because we're leaving a bit of a landmine here for whoever tries to make multi-page folios work with buffer_heads. There's not much we can do about it for now; it'll just be one of the many problems to be dealt with. Hopefully filesystems will convert to iomap instead of trying to make buffer_heads support multiple pages.