From patchwork Wed Feb 7 02:27:06 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chengguang Xu X-Patchwork-Id: 10204543 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 1E96560327 for ; Wed, 7 Feb 2018 02:27:45 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0C19C237A5 for ; Wed, 7 Feb 2018 02:27:45 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id F30092883D; Wed, 7 Feb 2018 02:27:44 +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 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 D603E237A5 for ; Wed, 7 Feb 2018 02:27:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752688AbeBGC1l (ORCPT ); Tue, 6 Feb 2018 21:27:41 -0500 Received: from mr11p00im-asmtp004.me.com ([17.110.69.135]:34075 "EHLO mr11p00im-asmtp004.me.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752537AbeBGC1k (ORCPT ); Tue, 6 Feb 2018 21:27:40 -0500 Received: from process-dkim-sign-daemon.mr11p00im-asmtp004.me.com by mr11p00im-asmtp004.me.com (Oracle Communications Messaging Server 8.0.1.2.20170607 64bit (built Jun 7 2017)) id <0P3R00100BY2TG00@mr11p00im-asmtp004.me.com> for ceph-devel@vger.kernel.org; Wed, 07 Feb 2018 02:27:33 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=icloud.com; s=04042017; t=1517970453; bh=nPOfgE9nFNA/ECm4J6E4zTzsRmi/Y9dffCp8fWTqdLw=; h=From:To:Subject:Date:Message-id; b=B0E0fyvmmkeYvWtMEgTV99T5OsAgNb2KfX02qquOrFPaRI92KmFnshEkrBYcC/C3u 5Xjb2+E/goOUlSBNxllQcysFLe3lfGhzcNr//D7Z5PY16f4OYu67N/4IG6PG1Va7Bm FAHIA+oeU3KNBsFyjZrMxUMYuYu+WVKHv7Y+U/gn8D6pFAl+qWA3CTmFzD+b4MgDwY N1dqKsB41yWTOGqhJq19wsydlE/UtXaBdXVfTsoc/nG19vXHoYnT8+wB4A5jrNWRM7 urUD1HRVVNNXnAV2Y9LXKEY59ph3fN7SN+xk6eQkQE+QaDU8rM5O9k1xNB6UIekFF8 q3vBE5hbjPg/w== Received: from icloud.com ([127.0.0.1]) by mr11p00im-asmtp004.me.com (Oracle Communications Messaging Server 8.0.1.2.20170607 64bit (built Jun 7 2017)) with ESMTPSA id <0P3R005QNDHQIG20@mr11p00im-asmtp004.me.com>; Wed, 07 Feb 2018 02:27:30 +0000 (GMT) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2018-02-07_01:,, signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 clxscore=1015 suspectscore=1 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1707230000 definitions=main-1802070024 From: Chengguang Xu To: ceph-devel@vger.kernel.org Cc: zyan@redhat.com, idryomov@gmail.com, Chengguang Xu Subject: [PATCH] ceph: keep consistent semantic in fscache related option combination Date: Wed, 07 Feb 2018 10:27:06 +0800 Message-id: <1517970426-39663-1-git-send-email-cgxu519@icloud.com> X-Mailer: git-send-email 1.8.3.1 Sender: ceph-devel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: ceph-devel@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP When specifying multiple fscache related options, the result isn't always the same as option order, this fix will keep strict consistent meaning by order. Signed-off-by: Chengguang Xu --- fs/ceph/super.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/fs/ceph/super.c b/fs/ceph/super.c index 7f1e212..e654005 100644 --- a/fs/ceph/super.c +++ b/fs/ceph/super.c @@ -314,9 +314,13 @@ static int parse_fsopt_token(char *c, void *private) break; case Opt_fscache: fsopt->flags |= CEPH_MOUNT_OPT_FSCACHE; + kfree(fsopt->fscache_uniq); + fsopt->fscache_uniq = NULL; break; case Opt_nofscache: fsopt->flags &= ~CEPH_MOUNT_OPT_FSCACHE; + kfree(fsopt->fscache_uniq); + fsopt->fscache_uniq = NULL; break; case Opt_poolperm: fsopt->flags &= ~CEPH_MOUNT_OPT_NOPOOLPERM;