ceph: keep consistent semantic in fscache related option combination
authorChengguang Xu <cgxu519@icloud.com>
Wed, 7 Feb 2018 02:27:06 +0000 (10:27 +0800)
committerIlya Dryomov <idryomov@gmail.com>
Mon, 2 Apr 2018 08:12:45 +0000 (10:12 +0200)
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 <cgxu519@icloud.com>
Reviewed-by: "Yan, Zheng" <zyan@redhat.com>
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
fs/ceph/super.c

index fb32379cd42c037e891cfe45269ee0763d7124f0..ca8a830c07ad5bc30424e1f68038030bbba25de5 100644 (file)
@@ -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;