From patchwork Fri Sep 7 10:27:42 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Qu Wenruo X-Patchwork-Id: 10592015 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 58D4B13AC for ; Fri, 7 Sep 2018 10:27:53 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 43D572860C for ; Fri, 7 Sep 2018 10:27:53 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 341F82AD99; Fri, 7 Sep 2018 10:27:53 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C423B2AD4E for ; Fri, 7 Sep 2018 10:27:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727972AbeIGPIJ (ORCPT ); Fri, 7 Sep 2018 11:08:09 -0400 Received: from mx2.suse.de ([195.135.220.15]:34234 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725987AbeIGPIJ (ORCPT ); Fri, 7 Sep 2018 11:08:09 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay1.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 2B516AE06 for ; Fri, 7 Sep 2018 10:27:50 +0000 (UTC) From: Qu Wenruo To: linux-btrfs@vger.kernel.org Subject: [PATCH v2 0/3] btrfs: qgroup: Prepare to deprecate unused features for btrfs_qgroup_inherit() Date: Fri, 7 Sep 2018 18:27:42 +0800 Message-Id: <20180907102745.10387-1-wqu@suse.com> X-Mailer: git-send-email 2.18.0 Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This patchset can be fetched from github: https://github.com/adam900710/linux/tree/qgroup_inherit_check Which is based on v4.19-rc1 tag. This patchset will firstly set btrfs_qgroup_inherit structure size limit from PAGE_SIZE to fixed SZ_4K. I understand this normally will cause compatibility problem, but considering how minor this feature is and no sane guy should use it for over 100 qgroups, it should be fine in real world. The theoretical difference can be found in the commit message of the 1st patch. The 2nd patch introduce check function for btrfs_qgroup_inherit structure and deprecates the following features: 1) flags No unsupported flags should sneak in. 2) num_qgroups limit It should not exceed the maximum size of btrfs_qgroup_inherit nor the size passed from btrfs_ioctl_vol_args_v2. 3) qgroupid No valid qgroupid should be 0/0. The 3rd patch prepare to deprecate the following features: 1) flags 2) num_excl|ref_copies 3) btrfs_qgroup_inherit::lim Details can be found in the 3rd patch. changelog: v2: Show more details in the 1st patch about the incompatibility for 64K page size arch. Don't deprecate unused features right now, only mark then deprecated and output warning message for now. Better split validation check and deprecation patches. Qu Wenruo (3): btrfs: Set qgroup inherit size limit to SZ_4K instead of page size btrfs: qgroup: Validate btrfs_qgroup_inherit structure before passing it to qgroup btrfs: qgroup: Prepare to deprecate some btrfs_qgroup_inherit features fs/btrfs/ioctl.c | 7 +++++- fs/btrfs/qgroup.c | 44 ++++++++++++++++++++++++++++++++++++++ fs/btrfs/qgroup.h | 3 +++ include/uapi/linux/btrfs.h | 17 +++++++-------- 4 files changed, 61 insertions(+), 10 deletions(-)