Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp662169ybi; Wed, 19 Jun 2019 05:55:40 -0700 (PDT) X-Google-Smtp-Source: APXvYqwpRXqu9v9riW66lpZb08xEE0OvZ/KLUZWzSrJ/VRXeBsJRNYEsan7lqkBtzd4naAV3h4pH X-Received: by 2002:a63:2ad5:: with SMTP id q204mr2703434pgq.140.1560948940254; Wed, 19 Jun 2019 05:55:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560948940; cv=none; d=google.com; s=arc-20160816; b=kWXn+2E+0PGCPf3jQJI6JOmTCZu1HUO0hG623zfXmRleLBeX66qcJFsQd8+ymgpS/r 6DEI/Ga/NBIjSqGz0TjXgxGBjGzIWEAGwaxVJ1WC9HQvgaDdOXb1G9Ig0qRYa5Wnkspj VhIO0UO56Bba0k01MRToPKcSod4uZec19HLFx8oHZLejc0lNNOmt8QNQN0j9pbooQN45 D6jkUu5zBs5OqlXSHSTFxqXiFLQAOtO7XCC6j41Ui4AWFT0Ja4cKWuQHrAUYwrotWO6W qBWndo1h+Afd7FKaZO5oyxey1paimXoh8a5rFYqszV0aHPAnOWBXCZyXOn003sXkCa9s Kksg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=oUKHb/HhBZ0gnG9oANdx2Pjudz3ATWiOMMw4XgDgVpU=; b=qayTWenwzxsLzgmtva2b3FKSA6kUpvzJwgkcIJ3DsUGTX/NTrSRTO4xAZvakzCe/v2 lAEK4UaUKzdijAA5HfQAiAe5PgfE70Pg7qfAydjeXQ20Du/2c2cGjYGq4VZUOP1QOcCg fNz4mm6wnxmB8de5CjApSblhpIRp5sIey3W4uDDbk2ReRDDOV3fgbCISKMoThNZYagHh OxWdrgLq//A3kMmXivZ6Wp9Hv3R42GrJwFVss9yydbof0CD3KlIUm+kj3GsFQZUnLUHf Yp8ReRS44cy3y80hywU0NmYo20LDKQR1CYwKeH9ndPGzENNmyw09g49iPFBkJfK6ctbf iHUA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i11si17436110plb.20.2019.06.19.05.55.25; Wed, 19 Jun 2019 05:55:40 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731702AbfFSMzB (ORCPT + 99 others); Wed, 19 Jun 2019 08:55:01 -0400 Received: from mail-wm1-f68.google.com ([209.85.128.68]:35556 "EHLO mail-wm1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727129AbfFSMzA (ORCPT ); Wed, 19 Jun 2019 08:55:00 -0400 Received: by mail-wm1-f68.google.com with SMTP id c6so1743173wml.0 for ; Wed, 19 Jun 2019 05:54:58 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=oUKHb/HhBZ0gnG9oANdx2Pjudz3ATWiOMMw4XgDgVpU=; b=JvQfrphQXkVWSfIagw/eBDh5vH/gwWNHVDnQS2v6akb5SoGE2fQ3UVb1sSazTnndY/ qrtwpDkv/FLSG44A3/cs9jCzlsHNg0JBCziwhiOvgKyma0R6ELEDp2I2yHAtsfC4Y2oT SQxGvvHcpD0hhJ1SMYbeorXpO/aF2caQ+EVnVuXGCpoDF7Ghyk/YvdL3QuCtCAx4GC7Z BGPvdbSRwAIaMujOlZppnbxlUkDX851Wqou/2VKpwzHhK5sHq013fnBa0Qdjg2LnDI7j PLynTKeGEzs+ptB4IuVLPW7eZpy0bx6ek7fWT+m9UFMSIlZ7LlAC25bPdICzqa8BkG/6 NSHg== X-Gm-Message-State: APjAAAWWig+5G2fleSxo856a3ZHU7JcB8sPKBqqEmXLRGmu2NN9qW4Y4 0hdbbPNB3OfDDV018bmxrulS3Q== X-Received: by 2002:a1c:4956:: with SMTP id w83mr8147505wma.67.1560948898067; Wed, 19 Jun 2019 05:54:58 -0700 (PDT) Received: from miu.piliscsaba.redhat.com (catv-212-96-48-140.catv.broadband.hu. [212.96.48.140]) by smtp.gmail.com with ESMTPSA id l12sm42800918wrb.81.2019.06.19.05.54.56 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Wed, 19 Jun 2019 05:54:57 -0700 (PDT) From: Miklos Szeredi To: David Howells Cc: Al Viro , Ian Kent , linux-api@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 05/13] vfs: don't parse "silent" option Date: Wed, 19 Jun 2019 14:54:52 +0200 Message-Id: <20190619125452.28303-1-mszeredi@redhat.com> X-Mailer: git-send-email 2.21.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org While this is a standard option as documented in mount(8), it is ignored by most filesystems. So reject, unless filesystem explicitly wants to handle it. The exception is unconverted filesystems, where it is unknown if the filesystem handles this or not. Any implementation, such as mount(8) that needs to parse this option without failing should simply ignore the return value from fsconfig(). Signed-off-by: Miklos Szeredi --- Changes: - v1 didn't return on matching option in legacy_parse_param() fs/fs_context.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/fs/fs_context.c b/fs/fs_context.c index 49636e541293..bd8f8ab8358b 100644 --- a/fs/fs_context.c +++ b/fs/fs_context.c @@ -51,7 +51,6 @@ static const struct constant_table common_clear_sb_flag[] = { { "nolazytime", SB_LAZYTIME }, { "nomand", SB_MANDLOCK }, { "rw", SB_RDONLY }, - { "silent", SB_SILENT }, }; /* @@ -535,6 +534,15 @@ static int legacy_parse_param(struct fs_context *fc, struct fs_parameter *param) if (ret != -ENOPARAM) return ret; + if (strcmp(param->key, "silent") == 0) { + if (param->type != fs_value_is_flag) + return invalf(fc, "%s: Unexpected value for '%s'", + fc->fs_type->name, param->key); + + fc->sb_flags |= SB_SILENT; + return 0; + } + if (strcmp(param->key, "source") == 0) { if (param->type != fs_value_is_string) return invalf(fc, "VFS: Legacy: Non-string source"); -- 2.21.0