From patchwork Mon Jan 8 08:04:21 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anand Jain X-Patchwork-Id: 10149155 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 7A9EB6056F for ; Mon, 8 Jan 2018 08:03:41 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6EA37288DE for ; Mon, 8 Jan 2018 08:03:41 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5864F288F4; Mon, 8 Jan 2018 08:03:41 +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=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI, T_DKIM_INVALID, UNPARSEABLE_RELAY 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 4D61E288DE for ; Mon, 8 Jan 2018 08:03:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755919AbeAHIDi (ORCPT ); Mon, 8 Jan 2018 03:03:38 -0500 Received: from userp2120.oracle.com ([156.151.31.85]:57964 "EHLO userp2120.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755916AbeAHIDg (ORCPT ); Mon, 8 Jan 2018 03:03:36 -0500 Received: from pps.filterd (userp2120.oracle.com [127.0.0.1]) by userp2120.oracle.com (8.16.0.22/8.16.0.22) with SMTP id w0882U2x030734; Mon, 8 Jan 2018 08:03:33 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references; s=corp-2017-10-26; bh=AQ44rGDpliYrbOUWYNzSKo4Hc2Ksx/5OrFJXTIV+L/4=; b=ldOxkujLw6naVMsb1BF6p8bWb6vlrokni7GX4bHOnzMh4+KHTFlLFFkAuam8mJVygXsb NzwdVLP2gkZkdXFAaLMKj9bUeqkWvfKMoJEnJ+26043d51GdQxUoC0uAWXokAjINVGt3 8QlSNdg4t/w3pn+R05/3VTleIPelj7jg7a3JzzveXmJQ6EpiRtkc8dnbXGoC1IBLSckT o1GHTkdEmRDCQ2MT7JPcYM44gFfP3J9Ja8N377KaeULiYb+06PqkND+Wwjpq7rlRO5tq F9obrpscOYxuQZ8CrjJZNJ/jvWjLxeiDTQy7gSQ04Xy9qp96IBQ/ONtAaLxwOviUXiVy 3Q== Received: from userv0022.oracle.com (userv0022.oracle.com [156.151.31.74]) by userp2120.oracle.com with ESMTP id 2fc3xng53n-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 08 Jan 2018 08:03:33 +0000 Received: from userv0122.oracle.com (userv0122.oracle.com [156.151.31.75]) by userv0022.oracle.com (8.14.4/8.14.4) with ESMTP id w0883Wl9014127 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Mon, 8 Jan 2018 08:03:33 GMT Received: from abhmp0004.oracle.com (abhmp0004.oracle.com [141.146.116.10]) by userv0122.oracle.com (8.14.4/8.14.4) with ESMTP id w0883Wl7000347; Mon, 8 Jan 2018 08:03:32 GMT Received: from tp.sg.oracle.com (/10.186.49.52) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Mon, 08 Jan 2018 00:03:32 -0800 From: Anand Jain To: linux-btrfs@vger.kernel.org Cc: wqu@suse.com Subject: [PATCH 3/3] btrfs: add support for SUPER_FLAG_CHANGING_FSID in btrfs.ko Date: Mon, 8 Jan 2018 16:04:21 +0800 Message-Id: <20180108080421.17668-4-anand.jain@oracle.com> X-Mailer: git-send-email 2.15.0 In-Reply-To: <20180108080421.17668-1-anand.jain@oracle.com> References: <20180108080421.17668-1-anand.jain@oracle.com> X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=8767 signatures=668652 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=3 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=828 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1711220000 definitions=main-1801080118 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 Userland sets SUPER_FLAG_CHANGING_FSID and resets it only when changing fsid is complete. Its not a good idea to mount the device anything in between, so this patch fails the mount if SB SUPER_FLAG_CHANGING_FSID is set. As we don't add SUPER_FLAG_CHANGING_FSID into BTRFS_SUPER_FLAG_SUPP list, so mount will fail if SUPER_FLAG_CHANGING_FSID is set in the user land. Signed-off-by: Anand Jain cc: wqu@suse.com Reviewed-by: Qu Wenruo --- include/uapi/linux/btrfs_tree.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/uapi/linux/btrfs_tree.h b/include/uapi/linux/btrfs_tree.h index 38ab0e06259a..aff1356c2bb8 100644 --- a/include/uapi/linux/btrfs_tree.h +++ b/include/uapi/linux/btrfs_tree.h @@ -457,6 +457,7 @@ struct btrfs_free_space_header { #define BTRFS_SUPER_FLAG_SEEDING (1ULL << 32) #define BTRFS_SUPER_FLAG_METADUMP (1ULL << 33) #define BTRFS_SUPER_FLAG_METADUMP_V2 (1ULL << 34) +#define BTRFS_SUPER_FLAG_CHANGING_FSID (1ULL << 35) /*