From: Ritesh Harjani <riteshh@linux.ibm.com>
To: linux-fsdevel@vger.kernel.org
Cc: linux-kernel@vger.kernel.org,
Alexander Viro <viro@zeniv.linux.org.uk>,
Miklos Szeredi <mszeredi@redhat.com>,
Ritesh Harjani <riteshh@linux.ibm.com>
Subject: [PATCH] bad_inode: add missing i_op initializers for fileattr_get/_set
Date: Wed, 12 Jan 2022 21:20:16 +0530 [thread overview]
Message-ID: <4bdc14fd6bf5cbe17bebeea2165840a2af6c4cf8.1642002262.git.riteshh@linux.ibm.com> (raw)
Let's bring inode_operations in sync for bad_inode_ops.
Some of the reasons are listed here [1]. But mostly it is
just for completeness sake I think.
This patch also removes some of the whitespaces at the end of line
which is due to my editor config settings for kernel work.
[1]: https://lore.kernel.org/lkml/1473708559-12714-2-git-send-email-mszeredi@redhat.com/
Signed-off-by: Ritesh Harjani <riteshh@linux.ibm.com>
---
fs/bad_inode.c | 30 +++++++++++++++++++++---------
1 file changed, 21 insertions(+), 9 deletions(-)
diff --git a/fs/bad_inode.c b/fs/bad_inode.c
index 12b8fdcc445b..08d5e44316cc 100644
--- a/fs/bad_inode.c
+++ b/fs/bad_inode.c
@@ -160,6 +160,17 @@ static int bad_inode_set_acl(struct user_namespace *mnt_userns,
return -EIO;
}
+static int bad_inode_fileattr_set(struct user_namespace *mnt_userns,
+ struct dentry *dentry, struct fileattr *fa)
+{
+ return -EIO;
+}
+
+static int bad_inode_fileattr_get(struct dentry *dentry, struct fileattr *fa)
+{
+ return -EIO;
+}
+
static const struct inode_operations bad_inode_ops =
{
.create = bad_inode_create,
@@ -183,18 +194,19 @@ static const struct inode_operations bad_inode_ops =
.atomic_open = bad_inode_atomic_open,
.tmpfile = bad_inode_tmpfile,
.set_acl = bad_inode_set_acl,
+ .fileattr_set = bad_inode_fileattr_set,
+ .fileattr_get = bad_inode_fileattr_get,
};
-
/*
* When a filesystem is unable to read an inode due to an I/O error in
* its read_inode() function, it can call make_bad_inode() to return a
- * set of stubs which will return EIO errors as required.
+ * set of stubs which will return EIO errors as required.
*
* We only need to do limited initialisation: all other fields are
* preinitialised to zero automatically.
*/
-
+
/**
* make_bad_inode - mark an inode bad due to an I/O error
* @inode: Inode to mark bad
@@ -203,7 +215,7 @@ static const struct inode_operations bad_inode_ops =
* failure this function makes the inode "bad" and causes I/O operations
* on it to fail from this point on.
*/
-
+
void make_bad_inode(struct inode *inode)
{
remove_inode_hash(inode);
@@ -211,9 +223,9 @@ void make_bad_inode(struct inode *inode)
inode->i_mode = S_IFREG;
inode->i_atime = inode->i_mtime = inode->i_ctime =
current_time(inode);
- inode->i_op = &bad_inode_ops;
+ inode->i_op = &bad_inode_ops;
inode->i_opflags &= ~IOP_XATTR;
- inode->i_fop = &bad_file_ops;
+ inode->i_fop = &bad_file_ops;
}
EXPORT_SYMBOL(make_bad_inode);
@@ -222,17 +234,17 @@ EXPORT_SYMBOL(make_bad_inode);
* &bad_inode_ops to cover the case of invalidated inodes as well as
* those created by make_bad_inode() above.
*/
-
+
/**
* is_bad_inode - is an inode errored
* @inode: inode to test
*
* Returns true if the inode in question has been marked as bad.
*/
-
+
bool is_bad_inode(struct inode *inode)
{
- return (inode->i_op == &bad_inode_ops);
+ return (inode->i_op == &bad_inode_ops);
}
EXPORT_SYMBOL(is_bad_inode);
--
2.31.1
next reply other threads:[~2022-01-12 15:50 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-01-12 15:50 Ritesh Harjani [this message]
2022-01-25 16:48 ` Ritesh Harjani
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4bdc14fd6bf5cbe17bebeea2165840a2af6c4cf8.1642002262.git.riteshh@linux.ibm.com \
--to=riteshh@linux.ibm.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mszeredi@redhat.com \
--cc=viro@zeniv.linux.org.uk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®