Skip to content

Commit e1cbbf4

Browse files
committed
Merge tag 'for-linus-4.20-ofs1' of git://git.kernel.org/pub/scm/linux/kernel/git/hubcap/linux
Pull orangefs updates from Mike Marshall: "Fixes and a cleanup. Fixes: - fix superfluous service_operation return code check in orangefs_lookup - fix some error code paths that missed kmem_cache_free - don't let orangefs_iget return NULL - don't let orangefs_new_inode return NULL - cache NULL when both default_acl and acl are NULL Cleanup: - rate limit the client not running info message" * tag 'for-linus-4.20-ofs1' of git://git.kernel.org/pub/scm/linux/kernel/git/hubcap/linux: orangefs: no need to check for service_operation returns > 0 orangefs: some error code paths missed kmem_cache_free orangefs: don't let orangefs_iget return NULL. orangefs: don't let orangefs_new_inode return NULL orangefs: rate limit the client not running info message orangefs: cache NULL when both default_acl and acl are NULL
2 parents 6b609e3 + 22fc9db commit e1cbbf4

File tree

4 files changed

+15
-7
lines changed

4 files changed

+15
-7
lines changed

fs/orangefs/acl.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,12 +167,16 @@ int orangefs_init_acl(struct inode *inode, struct inode *dir)
167167
error = __orangefs_set_acl(inode, default_acl,
168168
ACL_TYPE_DEFAULT);
169169
posix_acl_release(default_acl);
170+
} else {
171+
inode->i_default_acl = NULL;
170172
}
171173

172174
if (acl) {
173175
if (!error)
174176
error = __orangefs_set_acl(inode, acl, ACL_TYPE_ACCESS);
175177
posix_acl_release(acl);
178+
} else {
179+
inode->i_acl = NULL;
176180
}
177181

178182
/* If mode of the inode was changed, then do a forcible ->setattr */

fs/orangefs/inode.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -405,7 +405,11 @@ struct inode *orangefs_iget(struct super_block *sb,
405405
orangefs_test_inode,
406406
orangefs_set_inode,
407407
ref);
408-
if (!inode || !(inode->i_state & I_NEW))
408+
409+
if (!inode)
410+
return ERR_PTR(-ENOMEM);
411+
412+
if (!(inode->i_state & I_NEW))
409413
return inode;
410414

411415
error = orangefs_inode_getattr(inode, 1, 1, STATX_ALL);
@@ -448,7 +452,7 @@ struct inode *orangefs_new_inode(struct super_block *sb, struct inode *dir,
448452

449453
inode = new_inode(sb);
450454
if (!inode)
451-
return NULL;
455+
return ERR_PTR(-ENOMEM);
452456

453457
orangefs_set_inode(inode, ref);
454458
inode->i_ino = hash; /* needed for stat etc */

fs/orangefs/namei.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,6 @@ static int orangefs_create(struct inode *dir,
5858
goto out;
5959

6060
ref = new_op->downcall.resp.create.refn;
61-
op_release(new_op);
6261

6362
inode = orangefs_new_inode(dir->i_sb, dir, S_IFREG | mode, 0, &ref);
6463
if (IS_ERR(inode)) {
@@ -92,6 +91,7 @@ static int orangefs_create(struct inode *dir,
9291
mark_inode_dirty_sync(dir);
9392
ret = 0;
9493
out:
94+
op_release(new_op);
9595
gossip_debug(GOSSIP_NAME_DEBUG,
9696
"%s: %pd: returning %d\n",
9797
__func__,
@@ -157,7 +157,7 @@ static struct dentry *orangefs_lookup(struct inode *dir, struct dentry *dentry,
157157
new_op->downcall.resp.lookup.refn.fs_id,
158158
ret);
159159

160-
if (ret >= 0) {
160+
if (ret == 0) {
161161
orangefs_set_timeout(dentry);
162162
inode = orangefs_iget(dir->i_sb, &new_op->downcall.resp.lookup.refn);
163163
} else if (ret == -ENOENT) {
@@ -269,7 +269,6 @@ static int orangefs_symlink(struct inode *dir,
269269
}
270270

271271
ref = new_op->downcall.resp.sym.refn;
272-
op_release(new_op);
273272

274273
inode = orangefs_new_inode(dir->i_sb, dir, S_IFLNK | mode, 0, &ref);
275274
if (IS_ERR(inode)) {
@@ -307,6 +306,7 @@ static int orangefs_symlink(struct inode *dir,
307306
mark_inode_dirty_sync(dir);
308307
ret = 0;
309308
out:
309+
op_release(new_op);
310310
return ret;
311311
}
312312

@@ -346,7 +346,6 @@ static int orangefs_mkdir(struct inode *dir, struct dentry *dentry, umode_t mode
346346
}
347347

348348
ref = new_op->downcall.resp.mkdir.refn;
349-
op_release(new_op);
350349

351350
inode = orangefs_new_inode(dir->i_sb, dir, S_IFDIR | mode, 0, &ref);
352351
if (IS_ERR(inode)) {
@@ -379,6 +378,7 @@ static int orangefs_mkdir(struct inode *dir, struct dentry *dentry, umode_t mode
379378
orangefs_inode_setattr(dir, &iattr);
380379
mark_inode_dirty_sync(dir);
381380
out:
381+
op_release(new_op);
382382
return ret;
383383
}
384384

fs/orangefs/orangefs-sysfs.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -323,7 +323,7 @@ static ssize_t sysfs_service_op_show(struct kobject *kobj,
323323
/* Can't do a service_operation if the client is not running... */
324324
rc = is_daemon_in_service();
325325
if (rc) {
326-
pr_info("%s: Client not running :%d:\n",
326+
pr_info_ratelimited("%s: Client not running :%d:\n",
327327
__func__,
328328
is_daemon_in_service());
329329
goto out;

0 commit comments

Comments
 (0)