diff mbox

ceph: keep consistent semantic in fscache related option combination

Message ID 1517970426-39663-1-git-send-email-cgxu519@icloud.com (mailing list archive)
State New, archived
Headers show

Commit Message

Chengguang Xu Feb. 7, 2018, 2:27 a.m. UTC
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>
---
 fs/ceph/super.c | 4 ++++
 1 file changed, 4 insertions(+)

Comments

Yan, Zheng Feb. 7, 2018, 3:42 a.m. UTC | #1
> On 7 Feb 2018, at 10:27, Chengguang Xu <cgxu519@icloud.com> wrote:
> 
> 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>
> ---
> 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;
> — 

Applied, thanks

> 1.8.3.1
> 

--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

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;