Received: by 2002:a25:d7c1:0:0:0:0:0 with SMTP id o184csp4083086ybg; Fri, 25 Oct 2019 13:04:35 -0700 (PDT) X-Google-Smtp-Source: APXvYqxFUpxACPFztP0m8fvRMVdp1AbOliALZly9bx9rW8RWoz9m0/jY2YAe7/jVVwNHq3TpUIGS X-Received: by 2002:a17:906:9596:: with SMTP id r22mr5353488ejx.332.1572033875467; Fri, 25 Oct 2019 13:04:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1572033875; cv=none; d=google.com; s=arc-20160816; b=V5y72s0ZwiV/iYrT8oix18GDmtixQJvsTAy/2RUfM5vdw1/NyGcY6OuqbRck1vkDm5 Rq1FUUjFH8Pzb3utfYVO4+yYmKqh8mFIlwriWCLvEz1hFGOVg2oRCFiTY1TYRyIpV5wf bkddy7YLy8eFFrvIgJd1tPkuIW+N31Q0KJnlYlJAYmz/0AS63scjAJ84rhgJduVyyKsm NxglmwlWDedBMLzUEob7D0xQj2QrBQUD3KK2y4eVgzoZ6247zZ5mWNAZxUV6+qH3On3O t92mXg41Vce8pcFkaW2nhI1k36YxSCuPKjlZQOK1KLiu0Z/aVKu+/GySgSr7M81f6QtQ 5EXA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:autocrypt:openpgp:from:references:cc:to:subject :dkim-signature:dkim-signature; bh=7rNHykdDvNAsZM7vFWoKfOayb8bjnQpEdmSFw8XH7tM=; b=NaXg2FtkQFki29DYEzH0RhBONkyxEI6lzdpMhTtl2II7LGbG3M4A2aGWbR8AruildO DX0GwoQE8ExBmb3AZLo83Y//UTU9vDWnfLNyliKiQJd89O8aW8rDpeAqSXZ20F7bmQil opXMQUMsGxuAqccGUP+QQd0IsO45DiikL8QcYWsEDNBFfIkljsI+RgTLysaT5WLEi1sq hMT7IokQc8GWhdXaOFwZ+HkqySZwJbBTYK8twik5V2peXsb96KWrK46JDoJYHYXLHJ8g lEd7rR/Oc1qxJSBKe/VAj4ZY//uYm2XBq+T6btTcCLZoungtTLxZ2eNKpGAs7WK8m+oi 74rQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=temperror (dns failure for signature) header.i=@cobb.uk.net header.s=201703 header.b=itZaNIUo; dkim=temperror (dns failure for signature) header.i=@cobb.uk.net header.s=201703 header.b=HGzvs+Np; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=cobb.uk.net Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y56si1870768edd.275.2019.10.25.13.04.11; Fri, 25 Oct 2019 13:04:35 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=temperror (dns failure for signature) header.i=@cobb.uk.net header.s=201703 header.b=itZaNIUo; dkim=temperror (dns failure for signature) header.i=@cobb.uk.net header.s=201703 header.b=HGzvs+Np; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=cobb.uk.net Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2504244AbfJYMGK (ORCPT + 99 others); Fri, 25 Oct 2019 08:06:10 -0400 Received: from zaphod.cobb.me.uk ([213.138.97.131]:38554 "EHLO zaphod.cobb.me.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2504094AbfJYMGJ (ORCPT ); Fri, 25 Oct 2019 08:06:09 -0400 X-Greylist: delayed 330 seconds by postgrey-1.27 at vger.kernel.org; Fri, 25 Oct 2019 08:06:09 EDT Received: by zaphod.cobb.me.uk (Postfix, from userid 107) id D3C7E142BC7; Fri, 25 Oct 2019 13:00:38 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=cobb.uk.net; s=201703; t=1572004838; bh=z2R3/wIjiAroIpaPZgutujimo2VOUGI1UeGM8irz3r4=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From; b=itZaNIUoqPBmrxSnwJZzuFFOo/xNHr8vyEcQ13myAJUUEJiUq+hupVmACeQLCvUe0 dqdQr4uCGnvjWEpvNgL568fx/r6DbEDZQVyWHbru+Sh3OM4KXSP/xylqAAnjA84Ch5 4TpbusdpHH8MvYWha4Lq2QPozsZTt3Qit+1aeFPcARJ57HqMXyReHywlD/Nw1hGktK 6zfstxNgT32uCiVS/7H8T817Zw7kMHLsab7Tpmfk5wQMKt8ukZM9vNsFxzap+uFfOh e31r0w5fJrvYgK6l2XBHsvFa4X82l32JOI/3Sf7SzX+E7eNfx6S4qY2dODwcnLhezv l4VaPhnsw1Fxw== X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on zaphod.cobb.me.uk X-Spam-Status: No, score=-0.8 required=12.0 tests=ALL_TRUSTED,DKIM_INVALID, DKIM_SIGNED,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.2 X-Spam-Level: X-Spam-Bar: Received: from black.home.cobb.me.uk (unknown [192.168.0.205]) by zaphod.cobb.me.uk (Postfix) with ESMTP id 7C289142BC2; Fri, 25 Oct 2019 13:00:34 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=cobb.uk.net; s=201703; t=1572004834; bh=z2R3/wIjiAroIpaPZgutujimo2VOUGI1UeGM8irz3r4=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From; b=HGzvs+NpNISdIKghIq+lbOyvMUu0YxoxAVLNxpm3Q2LyBrA1I6eblDVSPfUYfz8Yw xyYVcuzrPu84uKTqlQKnrne3jJ8RXbkb8087XCq0uhy3nQRaYol/K5KICao+fy3N5Z T+17p8FCDbL9y056p+NCL4l/kutkgXgUsa96Dk3lMj2zzUZeOeo4wiMlSLG9aYuDhU AL1upwBfz5YYpkzf5t7Wf9AZIvue0zBJWD79RyZMc+SEX8gsXcL98F5wArtxJDqtah BiQTh4Y4rh6h2gVIguzlabMj2iZX0N3BhqMzNLMBfxjpXt9a+v3Go3SCkyYa1OuWjM 0PpA6+OPg0mAg== Received: from [192.168.0.211] (novatech.home.cobb.me.uk [192.168.0.211]) by black.home.cobb.me.uk (Postfix) with ESMTPS id 9A5CE5F45F; Fri, 25 Oct 2019 13:00:33 +0100 (BST) Subject: Re: [PATCH 5/5] btrfs: ioctl: Call btrfs_vol_uevent on subvolume deletion To: Marcos Paulo de Souza , linux-kernel@vger.kernel.org Cc: clm@fb.com, josef@toxicpanda.com, dsterba@suse.com, linux-btrfs@vger.kernel.org, mpdesouza@suse.com References: <20191024023636.21124-1-marcos.souza.org@gmail.com> <20191024023636.21124-6-marcos.souza.org@gmail.com> From: Graham Cobb Openpgp: preference=signencrypt Autocrypt: addr=g.btrfs@cobb.uk.net; prefer-encrypt=mutual; keydata= mQINBFaetnIBEAC5cHHbXztbmZhxDof6rYh/Dd5otxJXZ1p7cjE2GN9hCH7gQDOq5EJNqF9c VtD9rIywYT1i3qpHWyWo0BIwkWvr1TyFd3CioBe7qfo/8QoeA9nnXVZL2gcorI85a2GVRepb kbE22X059P1Z1Cy7c29dc8uDEzAucCILyfrNdZ/9jOTDN9wyyHo4GgPnf9lW3bKqF+t//TSh SOOis2+xt60y2In/ls29tD3G2ANcyoKF98JYsTypKJJiX07rK3yKTQbfqvKlc1CPWOuXE2x8 DdI3wiWlKKeOswdA2JFHJnkRjfrX9AKQm9Nk5JcX47rLxnWMEwlBJbu5NKIW5CUs/5UYqs5s 0c6UZ3lVwinFVDPC/RO8ixVwDBa+HspoSDz1nJyaRvTv6FBQeiMISeF/iRKnjSJGlx3AzyET ZP8bbLnSOiUbXP8q69i2epnhuap7jCcO38HA6qr+GSc7rpl042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i6/bSR6QGKPYYOOjbk+8Sfao0fmjQeOhj1tAHZuI4hoQbowR+ myxb Message-ID: Date: Fri, 25 Oct 2019 13:00:33 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.9.0 MIME-Version: 1.0 In-Reply-To: <20191024023636.21124-6-marcos.souza.org@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-GB Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 24/10/2019 03:36, Marcos Paulo de Souza wrote: > From: Marcos Paulo de Souza > > Since the function btrfs_ioctl_snap_destroy is used for deleting both > subvolumes and snapshots it was needed call btrfs_is_snapshot, > which checks a giver btrfs_root and returns true if it's a snapshot. > The current code is interested in subvolumes only. To me, as a user, a snapshot *is* a subvolume. I don't even know what "is a snapshot" means. Does it mean "was created using the btrfs subvolume snapshot command"? Does it matter whether the snapshot has been modified? Whether the originally snapshot subvolume still exists? Or what? I note that the man page for "btrfs subvolume" says "A snapshot is a subvolume like any other, with given initial content.". And I certainly have some subvolumes which are being used as normal parts of the filesystem, which were originally created as snapshots (for various reasons, including reverting changes and going back to an earlier snapshot, or an easy way to make sure that large common files are actually sharing blocks). I would expect this event would be generated for any subvolume deletion. If it is useful to distinguish subvolumes originally created as snapshots in some way then export another flag (named to make it clear what it really indicates, such as BTRFS_VOL_FROM_SNAPSHOT). I don't know your particular purpose, but my guess is that a more useful flag might actually be BTRFS_VOL_FROM_READONLY_SNAPSHOT. Graham