Received: by 2002:a05:7412:b10a:b0:f3:1519:9f41 with SMTP id az10csp1253185rdb; Fri, 1 Dec 2023 10:46:24 -0800 (PST) X-Google-Smtp-Source: AGHT+IGH31lV+nnaLL8JT+f894IzJTnEWo8xED6Be7HhV226JJUr9s7bG2GjjGXQGzDH5HHboD7K X-Received: by 2002:a17:902:7209:b0:1cf:d650:380a with SMTP id ba9-20020a170902720900b001cfd650380amr14528067plb.13.1701456383572; Fri, 01 Dec 2023 10:46:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701456383; cv=none; d=google.com; s=arc-20160816; b=u40fNM+PYY8NmYBFELh4SC9iT2HIYmk1SypYQTlw8cWAaxpGhMhGAbJkjcNxLBnUMW MKoLN3v5yjZx84C7QpGuf6WVeLkU51bW0L4w0f6Xh/QxLVU9KkjCazGxDu3RitCLEBRY AY/ZK1CdRx/KCzuIQVNlUWge+zkcwEHX7/oNjzOvICIwe+mhz/EVf2rJ1/PzoQk7kh9W Nzuq0Nt0oZXRZW/kHsyQ29fwxbUCRoWR9B0JbVl52Qbf5KzE4sRRE7z0ac924CTIIzqH 03Xjfnedf29CSv9dR4Rh7jc7PG2WuoY4xO4mrJiVnybo8ps2+KInxfpNUFGffmNXDfkC 0cCA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=ehPF3PQOoozfZlnimBntfStR9Uo37yTTJuQcGJqsFug=; fh=B9v7qeW+IoG2WnAcLK2GodcYoHl2Wsu7H855JL20/HY=; b=iu6GO9u81nzmqQHBt0kkNlP+Xuo193kpMSfxvJ5AJ5gEL1UCfvyzStM7c8YN+/iFV7 /KjBiqg2vta0EHQQTvTucmXUJ1rC81uY221pWl61ByoqXmCpu1q9KG8QNjj5mSBu5czk Y3+Dho/EAtcZuDNBiJWKsXXJXxUBrTVvF3SVRE+VxB38MZXHIgtJnHuZ8dEDauiGqR4/ SKW4FVQ4fqkftdIK4h6IlUKwiiuE9rTWWmd8vCBgY4Dd963oGhG/nxJlOgYf9uNPGbWl qIuJOpl3W/iquTMnAY0sOJHb3nehM7RRGCVa69iju5p3Q/vIyCGqXNmZXJIJx92RzwSD LdiA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quora.org header.s=google header.b=k74UPw0g; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from fry.vger.email (fry.vger.email. [23.128.96.38]) by mx.google.com with ESMTPS id n5-20020a170902e54500b001c62b51ac0fsi615717plf.306.2023.12.01.10.46.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Dec 2023 10:46:23 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) client-ip=23.128.96.38; Authentication-Results: mx.google.com; dkim=pass header.i=@quora.org header.s=google header.b=k74UPw0g; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by fry.vger.email (Postfix) with ESMTP id 0C0B48250DD2; Fri, 1 Dec 2023 10:46:21 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1379396AbjLASpz (ORCPT + 99 others); Fri, 1 Dec 2023 13:45:55 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58668 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1379400AbjLASpx (ORCPT ); Fri, 1 Dec 2023 13:45:53 -0500 Received: from mail-lj1-x22d.google.com (mail-lj1-x22d.google.com [IPv6:2a00:1450:4864:20::22d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E19411719 for ; Fri, 1 Dec 2023 10:45:58 -0800 (PST) Received: by mail-lj1-x22d.google.com with SMTP id 38308e7fff4ca-2c9ea37ac87so2840501fa.3 for ; Fri, 01 Dec 2023 10:45:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quora.org; s=google; t=1701456357; x=1702061157; 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=ehPF3PQOoozfZlnimBntfStR9Uo37yTTJuQcGJqsFug=; b=k74UPw0gvygvuodz9qrWcR7HUx0dBMN4mF149dah9Uxyi9VWLTZ60NyEPAEAs/R4ub 5P9zzkzUxJPVEhx6wPJ2w4wKVJZZoCSTZf2NyddD/4zcsrulrVz4HmcKQbpAnA6Jxq9F B0mFDhbNST8NJrTmf+X4W53+RWTFFSVCJiRf0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701456357; x=1702061157; 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=ehPF3PQOoozfZlnimBntfStR9Uo37yTTJuQcGJqsFug=; b=HMvrgYvnBBqTJWDmB0mwfkNK6OSQZjYpNkkb2iy77yNUOB0wDRE2hwjmm1+w0ad4mA NzESp7As80985T/Nw/S4OAMOiOkSaxMnQZMB5s4roWDqVDGhc7sQApXouW8K+nYuwbmC YmdNXgZwrMC9776DX4fzCqKEPbJi6aF+2fMFrkvyjanu0HxbGBGYLx/F4rti5Jk9gtgb 7CT/6Pf2LxGKXdPr0q8h2qj8kE0axzEoYA0uq8ySVvTcnkRucu/rsTX/WGnKSEMSbHvA U37r4GYVts9KqlT4Y1yVpLvdCxXJhct1ytxtcmf8XaWiAQE2RQpY0HdGg7p3v0xk4g8Q 4ngw== X-Gm-Message-State: AOJu0YyYvtkZhHPo2S4m/pcT90Ug7bmXUPrLReHcvIuKx6p0WoWrkVPb XP4SCAh0LFePxns3lTWnMuJB2RT96uxCyHuuHkfYTg== X-Received: by 2002:a2e:9e8a:0:b0:2c9:c1f8:fa29 with SMTP id f10-20020a2e9e8a000000b002c9c1f8fa29mr873997ljk.33.1701456356945; Fri, 01 Dec 2023 10:45:56 -0800 (PST) MIME-Version: 1.0 References: <20231201032548.5y3lafkwamlhruqs@moria.home.lan> <20231201052701.jrxwpjte4htzn6wo@moria.home.lan> In-Reply-To: <20231201052701.jrxwpjte4htzn6wo@moria.home.lan> From: Daniel J Blueman Date: Fri, 1 Dec 2023 13:45:45 -0500 Message-ID: Subject: Re: bcachefs page fault oops after device evacuate/remove and unmount To: Kent Overstreet Cc: linux-bcachefs@vger.kernel.org, Linux Kernel Content-Type: text/plain; charset="UTF-8" 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 fry.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 (fry.vger.email [0.0.0.0]); Fri, 01 Dec 2023 10:46:21 -0800 (PST) On Fri, 1 Dec 2023 at 00:27, Kent Overstreet wrote: > 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 :) Fine work Kent! The fix is good from further testing here. Tested-by: Daniel J Blueman Thanks again, Dan -- Daniel J Blueman