summaryrefslogtreecommitdiffstats
path: root/fs/bad_inode.c
diff options
context:
space:
mode:
authorMiklos Szeredi <mszeredi@redhat.com>2016-12-09 05:57:43 -0500
committerMiklos Szeredi <mszeredi@redhat.com>2016-12-09 05:57:43 -0500
commit3f9ca75516a7e581ff803f751a869c1da5ae5fa5 (patch)
tree14538f685941bef33a3c02814b7f693fe184591d /fs/bad_inode.c
parent3e5de27e940d00d8d504dfb96625fb654f641509 (diff)
bad_inode: add missing i_op initializers
New inode operations were forgotten to be added to bad_inode. Most of the time the op is checked for NULL before being called but marking the inode bad and the check can race (very unlikely). However in case of ->get_link() only DCACHE_SYMLINK_TYPE is checked before calling the op, so there's no race and will definitely oops when trying to follow links on such a beast. Also remove comments about extinct ops. Signed-off-by: Miklos Szeredi <mszeredi@redhat.com> Cc: <stable@vger.kernel.org>
Diffstat (limited to 'fs/bad_inode.c')
-rw-r--r--fs/bad_inode.c55
1 files changed, 51 insertions, 4 deletions
diff --git a/fs/bad_inode.c b/fs/bad_inode.c
index 8712062275b8..5f685c819298 100644
--- a/fs/bad_inode.c
+++ b/fs/bad_inode.c
@@ -106,6 +106,50 @@ static ssize_t bad_inode_listxattr(struct dentry *dentry, char *buffer,
106 return -EIO; 106 return -EIO;
107} 107}
108 108
109static const char *bad_inode_get_link(struct dentry *dentry,
110 struct inode *inode,
111 struct delayed_call *done)
112{
113 return ERR_PTR(-EIO);
114}
115
116static struct posix_acl *bad_inode_get_acl(struct inode *inode, int type)
117{
118 return ERR_PTR(-EIO);
119}
120
121static int bad_inode_fiemap(struct inode *inode,
122 struct fiemap_extent_info *fieinfo, u64 start,
123 u64 len)
124{
125 return -EIO;
126}
127
128static int bad_inode_update_time(struct inode *inode, struct timespec *time,
129 int flags)
130{
131 return -EIO;
132}
133
134static int bad_inode_atomic_open(struct inode *inode, struct dentry *dentry,
135 struct file *file, unsigned int open_flag,
136 umode_t create_mode, int *opened)
137{
138 return -EIO;
139}
140
141static int bad_inode_tmpfile(struct inode *inode, struct dentry *dentry,
142 umode_t mode)
143{
144 return -EIO;
145}
146
147static int bad_inode_set_acl(struct inode *inode, struct posix_acl *acl,
148 int type)
149{
150 return -EIO;
151}
152
109static const struct inode_operations bad_inode_ops = 153static const struct inode_operations bad_inode_ops =
110{ 154{
111 .create = bad_inode_create, 155 .create = bad_inode_create,
@@ -118,14 +162,17 @@ static const struct inode_operations bad_inode_ops =
118 .mknod = bad_inode_mknod, 162 .mknod = bad_inode_mknod,
119 .rename = bad_inode_rename2, 163 .rename = bad_inode_rename2,
120 .readlink = bad_inode_readlink, 164 .readlink = bad_inode_readlink,
121 /* follow_link must be no-op, otherwise unmounting this inode
122 won't work */
123 /* put_link returns void */
124 /* truncate returns void */
125 .permission = bad_inode_permission, 165 .permission = bad_inode_permission,
126 .getattr = bad_inode_getattr, 166 .getattr = bad_inode_getattr,
127 .setattr = bad_inode_setattr, 167 .setattr = bad_inode_setattr,
128 .listxattr = bad_inode_listxattr, 168 .listxattr = bad_inode_listxattr,
169 .get_link = bad_inode_get_link,
170 .get_acl = bad_inode_get_acl,
171 .fiemap = bad_inode_fiemap,
172 .update_time = bad_inode_update_time,
173 .atomic_open = bad_inode_atomic_open,
174 .tmpfile = bad_inode_tmpfile,
175 .set_acl = bad_inode_set_acl,
129}; 176};
130 177
131 178