From patchwork Sun Dec 18 18:57:27 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sami Kerola X-Patchwork-Id: 9479369 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 2A47360237 for ; Sun, 18 Dec 2016 18:58:12 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1425B28402 for ; Sun, 18 Dec 2016 18:58:12 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id EA6BB28462; Sun, 18 Dec 2016 18:58:11 +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.3 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM, 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 777E228402 for ; Sun, 18 Dec 2016 18:58:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753554AbcLRS5d (ORCPT ); Sun, 18 Dec 2016 13:57:33 -0500 Received: from mail-wm0-f66.google.com ([74.125.82.66]:33579 "EHLO mail-wm0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752934AbcLRS5c (ORCPT ); Sun, 18 Dec 2016 13:57:32 -0500 Received: by mail-wm0-f66.google.com with SMTP id u144so14927176wmu.0; Sun, 18 Dec 2016 10:57:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:organization; bh=q1SCXWMBVpcjkQYNwfw2XVbkrBpAAEtpoUt+W6tgF0Y=; b=niBwma5OwJdqX8sWCfju89vg29icx56lqum60lXhZ1eWme3REv3kcilaZbLsTMiM3Y x40j0iC1fHcl+gKMak6SUYlrfau8DR5ztcGbTR6zCqNKBnVCw5HP09F+o1V1TnOkQ+UZ VgelDFFdRD5SxWpvoABV5oW5Ic9ni9TFA9hWymiFNF9oVvdr9Lhyo4Y/OApTpMvTqrRs PFqtLiqitQZVQYbYQwdmiZ2Rct4iGCu8thXHACJ6DCQN56fV+ANUDZwlDNvsMsd7CDeJ 8EpZehEHeqbOE8xlTFU82kZzKx+ujQi/YS+G8HNZvAghTyZmOL+Ybf7bR42/GdnTCq/1 vmqA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :organization; bh=q1SCXWMBVpcjkQYNwfw2XVbkrBpAAEtpoUt+W6tgF0Y=; b=BYMCgQ4Ry5dvhNQaRZn0LurPmpb/dleHZctKNssCmlnCFUNhMql+6ow0lkKRQ7BsSm 9yxj1sG2pNsIy46RgX8Odky0k6qV0hJle2CPGCF0/UlzenQ3HTFKOrKPK0wTmh0TSMLb LwGBBTV8/SJQBm5Pu/kke7l7CZG/7pEC7YzZHwrXMFQXs1zJuw6+HD7iwMQyTWRSviFz cjQxIJql5rLNxN7RUvackyfSSCvaQsozQCWkZxtbjhyDGWkosvZAwHBPjIom1/8cB9R7 MWo3ejImIeGHJrys8mP0jswr+UWlTZmOByz1dSPsQ4m7K2AsRsPRz8da4A+XrwZzGPHp 2MmQ== X-Gm-Message-State: AIkVDXKPi5UXtKnpaan5nXg4w80oxC4WTUNTXvkptHNE/oShGAUCRpMxLFmFcPNUQb5N4g== X-Received: by 10.28.133.144 with SMTP id h138mr11704327wmd.12.1482087450594; Sun, 18 Dec 2016 10:57:30 -0800 (PST) Received: from localhost (82-71-26-41.dsl.in-addr.zen.co.uk. [82.71.26.41]) by smtp.gmail.com with ESMTPSA id u81sm13714979wmu.10.2016.12.18.10.57.29 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 18 Dec 2016 10:57:30 -0800 (PST) From: Sami Kerola To: Al Viro , linux-fsdevel@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Sami Kerola Subject: [PATCH] vfs: return EOPNOTSUPP when ioctl_fsthaw() is not supported Date: Sun, 18 Dec 2016 18:57:27 +0000 Message-Id: <20161218185727.2209-1-kerolasa@iki.fi> X-Mailer: git-send-email 2.11.0 Organization: Cloudflare Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP An attempt to freeze a filesystem that does not support such operation is reported as EOPNOTSUPP to user. Running unfreeze to the same filesystem returns EINVAL. Later is a little misleading, users can mix that message with return value from unfreezing when filesystem is not frozen. Signed-off-by: Sami Kerola --- fs/ioctl.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/fs/ioctl.c b/fs/ioctl.c index cb9b02940805..1d6372ef4008 100644 --- a/fs/ioctl.c +++ b/fs/ioctl.c @@ -566,6 +566,10 @@ static int ioctl_fsthaw(struct file *filp) if (!capable(CAP_SYS_ADMIN)) return -EPERM; + /* If filesystem doesn't support thaw feature, return. */ + if (!sb->s_op->unfreeze_fs) + return -EOPNOTSUPP; + /* Thaw */ if (sb->s_op->thaw_super) return sb->s_op->thaw_super(sb);