From patchwork Wed Feb 28 11:18:02 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Kara X-Patchwork-Id: 10247291 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 3D9DA60211 for ; Wed, 28 Feb 2018 11:19:18 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2E81F28BAD for ; Wed, 28 Feb 2018 11:19:18 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 21B6828CAA; Wed, 28 Feb 2018 11:19:18 +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=-1.9 required=2.0 tests=BAYES_00 autolearn=ham version=3.3.1 Received: from aserp2130.oracle.com (aserp2130.oracle.com [141.146.126.79]) (using TLSv1.2 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 88C9B28BAD for ; Wed, 28 Feb 2018 11:19:17 +0000 (UTC) Received: from pps.filterd (aserp2130.oracle.com [127.0.0.1]) by aserp2130.oracle.com (8.16.0.22/8.16.0.22) with SMTP id w1SBH9Qs031600; Wed, 28 Feb 2018 11:18:43 GMT Received: from aserv0021.oracle.com (aserv0021.oracle.com [141.146.126.233]) by aserp2130.oracle.com with ESMTP id 2gdqqxgyfv-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 28 Feb 2018 11:18:43 +0000 Received: from oss.oracle.com (oss-old-reserved.oracle.com [137.254.22.2]) by aserv0021.oracle.com (8.14.4/8.14.4) with ESMTP id w1SBIgmT023223 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 28 Feb 2018 11:18:42 GMT Received: from localhost ([127.0.0.1] helo=lb-oss.oracle.com) by oss.oracle.com with esmtp (Exim 4.63) (envelope-from ) id 1eqzkw-0000hi-BB; Wed, 28 Feb 2018 03:18:42 -0800 Received: from userv0021.oracle.com ([156.151.31.71]) by oss.oracle.com with esmtp (Exim 4.63) (envelope-from ) id 1eqzkV-0000dp-2r for ocfs2-devel@oss.oracle.com; Wed, 28 Feb 2018 03:18:15 -0800 Received: from userp2030.oracle.com (userp2030.oracle.com [156.151.31.89]) by userv0021.oracle.com (8.14.4/8.14.4) with ESMTP id w1SBIEG8031300 (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=FAIL) for ; Wed, 28 Feb 2018 11:18:14 GMT Received: from pps.filterd (userp2030.oracle.com [127.0.0.1]) by userp2030.oracle.com (8.16.0.22/8.16.0.22) with SMTP id w1SBHEZe001261 for ; Wed, 28 Feb 2018 11:18:14 GMT Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) by userp2030.oracle.com with ESMTP id 2gds59a6e4-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=OK) for ; Wed, 28 Feb 2018 11:18:14 +0000 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id C9E62ADB0; Wed, 28 Feb 2018 11:18:10 +0000 (UTC) Received: by quack2.suse.cz (Postfix, from userid 1000) id A26B21E0508; Wed, 28 Feb 2018 12:18:09 +0100 (CET) From: Jan Kara To: ocfs2-devel@oss.oracle.com Date: Wed, 28 Feb 2018 12:18:02 +0100 Message-Id: <20180228111802.23967-7-jack@suse.cz> X-Mailer: git-send-email 2.13.6 In-Reply-To: <20180228111802.23967-1-jack@suse.cz> References: <20180228111802.23967-1-jack@suse.cz> X-CLX-Shades: MLX X-CLX-Response: 1TFkXGxMZEQpMehccGhEKWU0XZ2ZyEQpZSRcacRoQGncGGx0ZcR8ZEBp3Bhg aBhoRClleF2hueREKSUYXRVhLSUZPdVpYRU5fSV5DRUQZdU9LEQpDThdobEZfUkxscGlYQWQecn xmZRh8SWxAb1hDaE0TaH1fRxEKWFwXHwQaBBsYHAdLSxgYHx5PGQUbGgQbGhoEHhIEGxAbHhofG hEKXlkXeFBueXgRCk1cFx4YExEKTFoXaGlCTV0RCk1OF2gRCkxGF2xraxEKQ1oXGxMfBBsZHwQY GBoEGx8RCkJeFxsRCkRJFx8RCkJGF2tyXE95T1t9XRhbEQpCXBcaEQpCRRdgAWF7W1p7QAFibRE KQk4XZRp4GwUFcHN7U1kRCkJMF21keGJ8T3thQ19fEQpCbBdpfhh8QF9IHE5rUhEKQkAXZHwTYl 1kTG9zTn0RCkJYF2J9b3kBTxgZcHB7EQpaWBcbEQpwaBd6Tm95HnIBXk54fRAaEQpwaBd6cxluZ 0hdaR4YeBAaEQpwaBdiU0lzAVJ9ZFJQbRAaEQpwaBdkcFJkcERiH3xtcxAaEQpwaBd6UkJDR3kF b01wRxAaEQpwbBdiQFptUEFDY3BfbRAZGhEKbX4XGhEKWE0XSxEg X-PDR: PASS X-Source-IP: 195.135.220.15 X-ServerName: mx2.suse.de X-Proofpoint-SPF-Result: pass X-Proofpoint-SPF-Record: v=spf1 ip4:137.65.0.0/16 ip4:151.155.28.0/17 ip4:149.44.0.0/16 ip4:147.2.0.0/16 ip4:164.99.0.0/16 ip4:130.57.0.0/16 ip4:192.31.114.0/24 ip4:195.135.221.0/24 ip4:195.135.220.0/24 ip4:69.7.179.0/24 ip4:150.215.214.0/24 include:mailcontrol.com ~all X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=8817 signatures=668681 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 priorityscore=60 malwarescore=0 suspectscore=1 phishscore=0 bulkscore=0 spamscore=0 clxscore=193 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=750 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1711220000 definitions=main-1802280137 X-Spam: Clean Cc: Jan Kara Subject: [Ocfs2-devel] [PATCH 6/6] ocfs2: Do not fail remount when mounted without heartbeat option X-BeenThere: ocfs2-devel@oss.oracle.com X-Mailman-Version: 2.1.9 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: ocfs2-devel-bounces@oss.oracle.com Errors-To: ocfs2-devel-bounces@oss.oracle.com X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=8817 signatures=668681 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=1 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1711220000 definitions=main-1802280137 X-Virus-Scanned: ClamAV using ClamSMTP When a filesystem is mounted without any options, the mount succeeds however remounting is later not possible as the kernel complains: (mount,568,0):ocfs2_remount:657 ERROR: Cannot change heartbeat mode on remount The problem is that in this case no heartbeat option got set and so remount with heartbeat=none as shown in /proc/mounts is considered to be a change of hearbeat mode. Fix the problem by defaulting heartbeat mode to 'none' and making sure it gets set when no mount options are specified. Signed-off-by: Jan Kara --- fs/ocfs2/super.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/fs/ocfs2/super.c b/fs/ocfs2/super.c index af4481b98c65..45d59766a357 100644 --- a/fs/ocfs2/super.c +++ b/fs/ocfs2/super.c @@ -1289,10 +1289,8 @@ static int ocfs2_parse_options(struct super_block *sb, mopt->resv_level = OCFS2_DEFAULT_RESV_LEVEL; mopt->dir_resv_level = -1; - if (!options) { - status = 1; - goto bail; - } + if (!options) + goto check_opts; while ((p = strsep(&options, ",")) != NULL) { if (!*p) @@ -1486,15 +1484,21 @@ static int ocfs2_parse_options(struct super_block *sb, } } +check_opts: if (user_stack == 0) { + int weight; + /* Ensure only one heartbeat mode */ tmp = mopt->mount_opt & (OCFS2_MOUNT_HB_LOCAL | OCFS2_MOUNT_HB_GLOBAL | OCFS2_MOUNT_HB_NONE); - if (hweight32(tmp) != 1) { + weight = hweight32(tmp); + if (weight > 1) { mlog(ML_ERROR, "Invalid heartbeat mount options\n"); status = 0; goto bail; + } else if (weight == 0) { + mopt->mount_opt |= OCFS2_MOUNT_HB_NONE; } }