From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from thorus.sichert.me ([78.47.115.25]:42248 "EHLO thorus.sichert.me" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750915AbdCYWKM (ORCPT ); Sat, 25 Mar 2017 18:10:12 -0400 Received: from [192.168.133.20] (host8-2.natpool.mwn.de [138.246.2.8]) by thorus.sichert.me (Postfix) with ESMTPSA id 0C948D8 for ; Sat, 25 Mar 2017 22:03:27 +0000 (UTC) To: linux-btrfs@vger.kernel.org From: Moritz Sichert Subject: Qgroups are not applied when snapshotting a subvol? Message-ID: <4428fdc3-157a-a98e-8ca3-e3701c6c1c80@sichert.me> Date: Sat, 25 Mar 2017 23:03:26 +0100 MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="------------AE8947224FE49117CA6EFAA0" Sender: linux-btrfs-owner@vger.kernel.org List-ID: This is a multi-part message in MIME format. --------------AE8947224FE49117CA6EFAA0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Hi, I tried to configure qgroups on a btrfs filesystem but was really surprised that when you snapshot a subvolume, the snapshot will not be assigned to the qgroup the subvolume was in. As an example consider the small terminal session in the attachment: I create a subvol A, assign it to qgroup 1/1 and set a limit of 5M on that qgroup. Then I write a file into A and eventually get "disk quota exceeded". Then I create a snapshot of A and call it B. B will not be assigned to 1/1 and writing a file into B confirms that no limits at all are imposed for B. I feel like I must be missing something here. Considering that creating a snapshot does not require root privileges this would mean that any user can just circumvent any quota and therefore make them useless. Is there a way to enforce quotas even when a user creates snapshots? Moritz --------------AE8947224FE49117CA6EFAA0 Content-Type: text/plain; charset=UTF-8; name="btrfs-qgroups.txt" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="btrfs-qgroups.txt" JCBidHJmcyBxdW90YSBlbmFibGUgLg0KJCBidHJmcyBzdWJ2b2x1bWUgY3JlYXRlIEENCkNy ZWF0ZSBzdWJ2b2x1bWUgJy4vQScNCiQgYnRyZnMgcWdyb3VwIG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LzI1OCAgICAgICAgIDguODlNaUIgICAgICA0LjAyTWlCIC0tLSAg ICAgDQoxLzEgICAgICAgICAgIDQuODlNaUIgICAgICA0Ljg5TWlCIC0tLQo= --------------AE8947224FE49117CA6EFAA0--