Received: by 2002:a05:7412:b10a:b0:f3:1519:9f41 with SMTP id az10csp808969rdb; Thu, 30 Nov 2023 21:27:29 -0800 (PST) X-Google-Smtp-Source: AGHT+IEOlDh401EUfRQ7AUkR/LgAoFh3AV0eRteiPGzmkFB1nTkahHtA7DcEFzAtP/yAViHiH4bh X-Received: by 2002:a05:6a20:6a1c:b0:18a:f317:1ee8 with SMTP id p28-20020a056a206a1c00b0018af3171ee8mr33600779pzk.16.1701408448965; Thu, 30 Nov 2023 21:27:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701408448; cv=none; d=google.com; s=arc-20160816; b=hYCQCJyOljjmusWUgUR+tuv4cNOjw60AppXrLdMrgowyOFK4Ao4JAgmp9ERY6w27kS fu5Qk6O1ov0W3Hu/wYJixtAzxTn8h+HLaV4GSpMGkqH5g6NFlzU9oX8+iOI1kLVsvmnx NpZwET3BKbA4+42IjCdZi9gWcvu+ddSDI4cC3c8DrjFQqEnEPsJRfvfHoMROe0gF1XS1 5xxj+AKtPw79nC4SgvXzdjkCGNz5/m7D2d1dkbIVSiy5mnBfdGNSLDXmjRtOUgGtvgo0 B/T/KpauL0Ltb+qmS7sMbW0jOmICCcVbqID0xLQkcxNTL3A+fNd3PgxVH8+g1Nh+I3Hb dmTQ== 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:dkim-signature:date; bh=xIA8KPNVXbCu0ZyJqk42JwtW3XZ71pnbV5diGZ+c2Fs=; fh=u/tTS80f3gOJQw/A02dawJRYUplI+QlmBwtclso3hIU=; b=kM8dgoZGjPQqCQ4RGCLCGh8F6gZaUcIhQkkyt868SvrQSNx746Nq/qE4ej/9/91nKH 0hqRI+zPeUubO0R1MWyhC7WDjaDvzhSNe5JqN72zQPtH+azk+3LZsTd2cJe1gpFwT9WO v2aUCOmS3dNwliEoN2rolOFiAloY4PXl0mdBTkWxRR4rWl2Gvz+ah065dV1Z7e9kPH6m 0R7LSSOa3lLby7l+BVSF+4k9sbmAU/2ZmKBfqJr/Fa5mpBG1a76YuXy9TPM8ehSWbiyZ RBe16l73A0G6/VohyMHJLvgRImDma/63T8yiP8ah9Z+UMYB+I6j7KYOt8uBe9B22Sfli NrUw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=KyAwaXG0; 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=NONE sp=NONE dis=NONE) header.from=linux.dev Return-Path: Received: from howler.vger.email (howler.vger.email. [2620:137:e000::3:4]) by mx.google.com with ESMTPS id i14-20020a17090332ce00b001cfec9dcd7fsi2588892plr.408.2023.11.30.21.27.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Nov 2023 21:27:28 -0800 (PST) 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=@linux.dev header.s=key1 header.b=KyAwaXG0; 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=NONE sp=NONE dis=NONE) header.from=linux.dev Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id C83B18725CD0; Thu, 30 Nov 2023 21:27:22 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231319AbjLAF1E (ORCPT + 99 others); Fri, 1 Dec 2023 00:27:04 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37696 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229505AbjLAF1D (ORCPT ); Fri, 1 Dec 2023 00:27:03 -0500 Received: from out-180.mta1.migadu.com (out-180.mta1.migadu.com [IPv6:2001:41d0:203:375::b4]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8436310F9 for ; Thu, 30 Nov 2023 21:27:08 -0800 (PST) Date: Fri, 1 Dec 2023 00:27:01 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1701408426; 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=xIA8KPNVXbCu0ZyJqk42JwtW3XZ71pnbV5diGZ+c2Fs=; b=KyAwaXG0KgzEwxfvzmEvbM2dfa1Mgz9mOcsqpNKtTp9BED0daThuXIbd9zDI29YPIpEK50 2kVnk+iZCo0gJb/hEsnyS0ROB6UqfIM5VXrtSMPI0uuhJzqK85lkp0D+V7DicClMwR0L02 Pnzay/naMpTr0OEwbZm55rhb+NeAjVU= X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Kent Overstreet To: Daniel J Blueman Cc: Linux Kernel , linux-bcachefs@vger.kernel.org Subject: Re: bcachefs page fault oops after device evacuate/remove and unmount Message-ID: <20231201052701.jrxwpjte4htzn6wo@moria.home.lan> References: <20231201032548.5y3lafkwamlhruqs@moria.home.lan> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231201032548.5y3lafkwamlhruqs@moria.home.lan> X-Migadu-Flow: FLOW_OUT X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable 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]); Thu, 30 Nov 2023 21:27:23 -0800 (PST) On Thu, Nov 30, 2023 at 10:25:48PM -0500, Kent Overstreet wrote: > On Thu, Nov 30, 2023 at 08:47:33PM -0500, Daniel J Blueman wrote: > > Hi Kent et al, > > > > On upstream bcachefs (master @ evilpiepirate.org/git/bcachefs.git) SHA > > f8a1ba26, I was able to develop a minimal reproducer [1] for a page > > not present oops I can provoke [2]. It appears we need further > > synchronisation during unmount. > > > > Let me know when there is a patch I can test, or for debug. > > > > Thanks, > > Dan > > > > -- [1] > > > > modprobe brd rd_size=536870912 rd_nr=2 > > bcachefs format -f /dev/ram0 /dev/ram1 > > mount -t bcachefs /dev/ram0:/dev/ram1 /mnt > > fio --group_reporting --ioengine=io_uring --directory=/mnt --size=16m > > --time_based --runtime=60s --iodepth=256 --verify_async=8 --bs=4k-64k > > --norandommap --random_distribution=zipf:0.5 --numjobs=16 --rw=randrw > > --name=A --direct=1 --name=B --direct=0 >/dev/null & > > bcachefs device evacuate /dev/ram0 > > bcachefs device remove --force --force-metadata /dev/ram1 > > bcachefs device remove --force --force-metadata /dev/ram1 > > kill %1 > > wait > > umount /mnt > > The remove fails for me with DEVICE_SET_STATE_NOT_ALLOWED - evacuate set > ram0 to ro, we can't remove our last rw dev. Got it to repro, just had to ignore those errors - there's now a ktest test for it, and the fix is in master :)