Received: by 2002:a05:7412:b10a:b0:f3:1519:9f41 with SMTP id az10csp770244rdb; Thu, 30 Nov 2023 19:26:48 -0800 (PST) X-Google-Smtp-Source: AGHT+IEEAbPeVDTWiUuYicsVzz0njL/soLyDRCSkXNqbdXj/HaaAULagPr3Mc3XM/QSAre8S0CTx X-Received: by 2002:a05:6a00:3a20:b0:693:3c11:4293 with SMTP id fj32-20020a056a003a2000b006933c114293mr26934234pfb.14.1701401208187; Thu, 30 Nov 2023 19:26:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701401208; cv=none; d=google.com; s=arc-20160816; b=iqXu9hS1udEnK/JONvcygo7zMmAV9No3c3Od6oKaZE14P9VdUxjZ9CDd6BMAdp3jum MmYSZ1sX3uXFllSjWGg8nlQcynyrhT7a/ZrLQ6/wx6jM/EmEocijQYRDoBh7BcPevbvQ e0USEFXemJbylI+OtFz2VShZ7v305uMIkedi/s5UhavYzi+CO1fmfqlOx5654PdP+Ht6 oEw681c3rgBZ6GZ4e+eo2xudYts+tUSdoRm99H4bvyogiKAJETA5lD5w0zR2ceNtqpmR BewdbDjw2MuEWhazv3SNTG/ReR7FRp6o5KMLfaTYB9yLh93wOGzu9F7IvB2Ax9h0p6ao Sb0A== 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=KcIwmkVle1BFRdCzB9OoiEvV9FDIuec9CunjLP5dT+o=; fh=u/tTS80f3gOJQw/A02dawJRYUplI+QlmBwtclso3hIU=; b=pHr8oWO+Azy/w0mESFi5XCe1j5DBxZVjzzhELnI5imhjc96RkyDlrzzG/skjQNVBwq M852tYQrS26Uc0/i+VR0a3KpAS55KHzFnsKuXzw5qAcvKHJndqjQ5UPkt2684jGkCMCw qho6O7tMHSJrXWP851fRfZIEhRNSwzZjv34SM2rhSt7XHQrguoBeg+cjuG6ThddTrFWZ 5sTtW5nzGGDW49zaG/rXLBIN30AQDM2qOqUQKC/xWd9ib8CO3z6Hz038DB3eeayDHvQz 5L7ukXyWjuaBeVbQUi0GItRy4wwm7fPbcbpqYohqZfi5pfKizmCKepCmK0+ZSYbTAqOk HUKQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=Fk9NRrHv; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 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 morse.vger.email (morse.vger.email. [2620:137:e000::3:1]) by mx.google.com with ESMTPS id o5-20020a056a0015c500b006ce010d03d3si194018pfu.303.2023.11.30.19.26.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Nov 2023 19:26:48 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) client-ip=2620:137:e000::3:1; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=Fk9NRrHv; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 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 morse.vger.email (Postfix) with ESMTP id 0270D8099279; Thu, 30 Nov 2023 19:26:11 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1377108AbjLADZw (ORCPT + 99 others); Thu, 30 Nov 2023 22:25:52 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54258 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1377156AbjLADZu (ORCPT ); Thu, 30 Nov 2023 22:25:50 -0500 Received: from out-180.mta1.migadu.com (out-180.mta1.migadu.com [95.215.58.180]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D5BED1725 for ; Thu, 30 Nov 2023 19:25:53 -0800 (PST) Date: Thu, 30 Nov 2023 22:25:48 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1701401151; 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=KcIwmkVle1BFRdCzB9OoiEvV9FDIuec9CunjLP5dT+o=; b=Fk9NRrHvrUoGYVDw0vsv12xG82JcG4RVI/3dbYPYq9ZNJU7XdTKRlxZsSbjCIHmpNB9127 O4KfQbXt+9EQrwPAPoEO3UTpxiwqucXTqzpdzWd1XSmd6mjQ4HRYptyVOHgwUNrUum76Vs rcFxZgEGLyNZDRiSQMJa9BO6UbzhSMs= 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: <20231201032548.5y3lafkwamlhruqs@moria.home.lan> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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 morse.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 (morse.vger.email [0.0.0.0]); Thu, 30 Nov 2023 19:26:11 -0800 (PST) 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. Is there a typo there?