From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 72A20EEB589 for ; Sat, 9 Sep 2023 11:22:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1694258521; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=DOnhbdcxxqWjF/gC9YFbAdy8hTazzKOUOq31gvhfIUs=; b=dX0C66SJLkKfkK6DukR+i7ylHTeC0FicXpCJaYjqwByLonhigvBsCbFG1wgYxaC+hbbscC bGyzXJlOvCWeJotSgXUT1P1cLXdF4xpHL7KCYgPhv8UT0Yl/3wjkNcrCOxCdKX9CR1mlzB dw8uXXU6wLZcRGb9AR6/drVssW0+Mzg= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-633-q8sJVBEuOFCSYfbhj4c2nw-1; Sat, 09 Sep 2023 07:21:59 -0400 X-MC-Unique: q8sJVBEuOFCSYfbhj4c2nw-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 8300D101A529; Sat, 9 Sep 2023 11:21:57 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 197AF412F2D1; Sat, 9 Sep 2023 11:21:57 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id DD99F1946588; Sat, 9 Sep 2023 11:21:56 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id E79761946586 for ; Sat, 9 Sep 2023 11:21:55 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id A03F0142B960; Sat, 9 Sep 2023 11:21:55 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast08.extmail.prod.ext.rdu2.redhat.com [10.11.55.24]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 9940B140E967 for ; Sat, 9 Sep 2023 11:21:55 +0000 (UTC) Received: from us-smtp-inbound-delivery-1.mimecast.com (us-smtp-1.mimecast.com [207.211.31.81]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 6355B3806713 for ; Sat, 9 Sep 2023 11:21:55 +0000 (UTC) Received: from verein.lst.de (verein.lst.de [213.95.11.211]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-283-9gI4LMxoPqSBVBqoBm-EEQ-1; Sat, 09 Sep 2023 07:21:51 -0400 X-MC-Unique: 9gI4LMxoPqSBVBqoBm-EEQ-1 Received: by verein.lst.de (Postfix, from userid 2407) id 601F26732D; Sat, 9 Sep 2023 13:21:47 +0200 (CEST) Date: Sat, 9 Sep 2023 13:21:47 +0200 From: Christoph Hellwig To: Jan Kara Message-ID: <20230909112147.GA12000@lst.de> References: <20230906-aufheben-hagel-9925501b7822@brauner> <60f244be-803b-fa70-665e-b5cba15212e@redhat.com> <20230906-aufkam-bareinlage-6e7d06d58e90@brauner> <818a3cc0-c17b-22c0-4413-252dfb579cca@redhat.com> <20230907094457.vcvmixi23dk3pzqe@quack3> <20230907-abgrenzen-achtung-b17e9a1ad136@brauner> <513f337e-d254-2454-6197-82df564ed5fc@redhat.com> <20230908073244.wyriwwxahd3im2rw@quack3> <86235d7a-a7ea-49da-968e-c5810cbf4a7b@redhat.com> <20230908102014.xgtcf5wth2l2cwup@quack3> MIME-Version: 1.0 In-Reply-To: <20230908102014.xgtcf5wth2l2cwup@quack3> User-Agent: Mutt/1.5.17 (2007-11-01) X-Mimecast-Impersonation-Protect: Policy=CLT - Impersonation Protection Definition; Similar Internal Domain=false; Similar Monitored External Domain=false; Custom External Domain=false; Mimecast External Domain=false; Newly Observed Domain=false; Internal User Name=false; Custom Display Name List=false; Reply-to Address Mismatch=false; Targeted Threat Dictionary=false; Mimecast Threat Dictionary=false; Custom Threat Dictionary=false X-Scanned-By: MIMEDefang 3.1 on 10.11.54.7 Subject: Re: [dm-devel] [PATCH] fix writing to the filesystem after unmount X-BeenThere: dm-devel@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: device-mapper development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Christian Brauner , "Darrick J. Wong" , linux-kernel@vger.kernel.org, dm-devel@redhat.com, Mikulas Patocka , Alexander Viro , Zdenek Kabelac , linux-fsdevel@vger.kernel.org, Christoph Hellwig Errors-To: dm-devel-bounces@redhat.com Sender: "dm-devel" X-Scanned-By: MIMEDefang 3.1 on 10.11.54.2 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: lst.de Content-Disposition: inline Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit On Fri, Sep 08, 2023 at 12:20:14PM +0200, Jan Kara wrote: > Well, currently you click some "Eject / safely remove / whatever" button > and then you get a "wait" dialog until everything is done after which > you're told the stick is safe to remove. What I imagine is that the "wait" > dialog needs to be there while there are any (or exclusive at minimum) openers > of the device. Not until umount(2) syscall has returned. And yes, the > kernel doesn't quite make that easy - the best you can currently probably > do is to try opening the device with O_EXCL and if that fails, you know > there's some other exclusive open. ... and the simple answer to the problem is to have an event notification for when the super_block has finally been destroyed. That way the application gets this notification directly instead of having to make a process synchronous that fundamentally isn't as explained in this thread. -- dm-devel mailing list dm-devel@redhat.com https://listman.redhat.com/mailman/listinfo/dm-devel From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7E18CEEB589 for ; Sat, 9 Sep 2023 11:21:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344931AbjIILVz (ORCPT ); Sat, 9 Sep 2023 07:21:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57700 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231315AbjIILVy (ORCPT ); Sat, 9 Sep 2023 07:21:54 -0400 Received: from verein.lst.de (verein.lst.de [213.95.11.211]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0A044CF2; Sat, 9 Sep 2023 04:21:51 -0700 (PDT) Received: by verein.lst.de (Postfix, from userid 2407) id 601F26732D; Sat, 9 Sep 2023 13:21:47 +0200 (CEST) Date: Sat, 9 Sep 2023 13:21:47 +0200 From: Christoph Hellwig To: Jan Kara Cc: Zdenek Kabelac , Mikulas Patocka , Christian Brauner , Alexander Viro , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, dm-devel@redhat.com, Christoph Hellwig , "Darrick J. Wong" Subject: Re: [PATCH] fix writing to the filesystem after unmount Message-ID: <20230909112147.GA12000@lst.de> References: <20230906-aufheben-hagel-9925501b7822@brauner> <60f244be-803b-fa70-665e-b5cba15212e@redhat.com> <20230906-aufkam-bareinlage-6e7d06d58e90@brauner> <818a3cc0-c17b-22c0-4413-252dfb579cca@redhat.com> <20230907094457.vcvmixi23dk3pzqe@quack3> <20230907-abgrenzen-achtung-b17e9a1ad136@brauner> <513f337e-d254-2454-6197-82df564ed5fc@redhat.com> <20230908073244.wyriwwxahd3im2rw@quack3> <86235d7a-a7ea-49da-968e-c5810cbf4a7b@redhat.com> <20230908102014.xgtcf5wth2l2cwup@quack3> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230908102014.xgtcf5wth2l2cwup@quack3> User-Agent: Mutt/1.5.17 (2007-11-01) Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org On Fri, Sep 08, 2023 at 12:20:14PM +0200, Jan Kara wrote: > Well, currently you click some "Eject / safely remove / whatever" button > and then you get a "wait" dialog until everything is done after which > you're told the stick is safe to remove. What I imagine is that the "wait" > dialog needs to be there while there are any (or exclusive at minimum) openers > of the device. Not until umount(2) syscall has returned. And yes, the > kernel doesn't quite make that easy - the best you can currently probably > do is to try opening the device with O_EXCL and if that fails, you know > there's some other exclusive open. ... and the simple answer to the problem is to have an event notification for when the super_block has finally been destroyed. That way the application gets this notification directly instead of having to make a process synchronous that fundamentally isn't as explained in this thread.