Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1544187

[PATCH] vfs: return EOPNOTSUPP when ioctl_fsthaw() is not supported

From Sami Kerola <kerolasa@iki.fi>
Newsgroups linux.kernel
Subject [PATCH] vfs: return EOPNOTSUPP when ioctl_fsthaw() is not supported
Date 2016-12-18 20:00 +0100
Message-ID <sPOQF-593-1@gated-at.bofh.it> (permalink)
Organization Cloudflare

Show all headers | View raw


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 <kerolasa@iki.fi>
---
 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);
-- 
2.11.0

Back to linux.kernel | Previous | NextNext in thread | Find similar | Unroll thread


Thread

[PATCH] vfs: return EOPNOTSUPP when ioctl_fsthaw() is not supported Sami Kerola <kerolasa@iki.fi> - 2016-12-18 20:00 +0100
  Re: [PATCH] vfs: return EOPNOTSUPP when ioctl_fsthaw() is not  supported Christoph Hellwig <hch@infradead.org> - 2016-12-19 11:30 +0100
    Re: [PATCH] vfs: return EOPNOTSUPP when ioctl_fsthaw() is not supported Sami Kerola <kerolasa@iki.fi> - 2016-12-19 23:40 +0100

csiph-web