All of lore.kernel.org
 help / color / mirror / Atom feed
From: James Simmons <jsimmons@infradead.org>
To: lustre-devel@lists.lustre.org
Subject: [lustre-devel] [PATCH 25/30] lustre: llite: check the return value of cl_file_inode_init()
Date: Mon, 17 Sep 2018 13:30:35 -0400	[thread overview]
Message-ID: <1537205440-6656-26-git-send-email-jsimmons@infradead.org> (raw)
In-Reply-To: <1537205440-6656-1-git-send-email-jsimmons@infradead.org>

From: Bobi Jam <bobijam@hotmail.com>

ll_update_inode() does not check the return value of
cl_file_inode_init(), and it should check.

Signed-off-by: Bobi Jam <bobijam@hotmail.com>
WC-bug-id: https://jira.whamcloud.com/browse/LU-9485
Reviewed-on: https://review.whamcloud.com/27658
Reviewed-by: Fan Yong <fan.yong@intel.com>
Reviewed-by: Jinshan Xiong <jinshan.xiong@gmail.com>
Reviewed-by: James Simmons <uja.ornl@yahoo.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
Signed-off-by: James Simmons <jsimmons@infradead.org>
---
 drivers/staging/lustre/lustre/llite/llite_lib.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/lustre/lustre/llite/llite_lib.c b/drivers/staging/lustre/lustre/llite/llite_lib.c
index b5bafc4..99d0b72 100644
--- a/drivers/staging/lustre/lustre/llite/llite_lib.c
+++ b/drivers/staging/lustre/lustre/llite/llite_lib.c
@@ -1792,13 +1792,15 @@ int ll_update_inode(struct inode *inode, struct lustre_md *md)
 	struct ll_inode_info *lli = ll_i2info(inode);
 	struct mdt_body *body = md->body;
 	struct ll_sb_info *sbi = ll_i2sbi(inode);
+	int rc = 0;
 
-	if (body->mbo_valid & OBD_MD_FLEASIZE)
-		cl_file_inode_init(inode, md);
+	if (body->mbo_valid & OBD_MD_FLEASIZE) {
+		rc = cl_file_inode_init(inode, md);
+		if (rc)
+			return rc;
+	}
 
 	if (S_ISDIR(inode->i_mode)) {
-		int rc;
-
 		rc = ll_update_lsm_md(inode, md);
 		if (rc)
 			return rc;
-- 
1.8.3.1

  parent reply	other threads:[~2018-09-17 17:30 UTC|newest]

Thread overview: 46+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-17 17:30 [lustre-devel] [PATCH 00/30] lustre: first batch of fixes from lustre 2.10 James Simmons
2018-09-17 17:30 ` [lustre-devel] [PATCH 01/30] lustre: lnd: resolve IP query code in LND drivers James Simmons
2018-09-24  3:20   ` NeilBrown
2018-09-17 17:30 ` [lustre-devel] [PATCH 02/30] lustre: uapi: add documentation about FIDs James Simmons
2018-09-17 17:30 ` [lustre-devel] [PATCH 03/30] lustre: osc: fix for cl_env_get in low memory James Simmons
2018-09-17 17:30 ` [lustre-devel] [PATCH 04/30] lustre: ptlrpc: fix wrong error handlers James Simmons
2018-09-17 17:30 ` [lustre-devel] [PATCH 05/30] lustre: osc: GPF while doing ELC with no_wait_policy James Simmons
2018-09-17 17:30 ` [lustre-devel] [PATCH 06/30] lustre: ptlrpc: Prevent possible dereference of NULL pointers James Simmons
2018-09-17 17:30 ` [lustre-devel] [PATCH 07/30] lustre: llog: update llog print format to use FIDs James Simmons
2018-09-17 17:30 ` [lustre-devel] [PATCH 08/30] lustre: mgc: Remove unnecessary checks for config_log_put() James Simmons
2018-09-24  3:35   ` NeilBrown
2018-09-29 21:18     ` James Simmons
2018-09-17 17:30 ` [lustre-devel] [PATCH 09/30] lustre: obd: remove obsolete OBD_FL_LOCAL_MASK James Simmons
2018-09-17 17:30 ` [lustre-devel] [PATCH 10/30] lustre: ptlrpc: set rq_sent when send fails due to -ENOMEM James Simmons
2018-09-17 17:30 ` [lustre-devel] [PATCH 11/30] lustre: mdc: allow setting readdir RPC size parameter James Simmons
2018-09-18 13:14   ` NeilBrown
2018-09-20  5:42     ` Andreas Dilger
2018-09-24  3:50       ` NeilBrown
2018-09-29 21:11       ` James Simmons
2018-09-17 17:30 ` [lustre-devel] [PATCH 12/30] lustre: kuc: initialize kkuc_groups at module init time James Simmons
2018-09-24  3:58   ` NeilBrown
2018-09-17 17:30 ` [lustre-devel] [PATCH 13/30] lustre: ldlm: GPF in _ldlm_lock_debug() James Simmons
2018-09-17 17:30 ` [lustre-devel] [PATCH 14/30] lustre: ldlm: cond_resched in ldlm_bl_thread_main James Simmons
2018-09-17 17:30 ` [lustre-devel] [PATCH 15/30] lustre: ptlrpc: drain "ptlrpc_request_buffer_desc" objects James Simmons
2018-09-17 17:30 ` [lustre-devel] [PATCH 16/30] lustre: lnet: Change sock_create() to sock_create_kern() James Simmons
2018-09-17 17:30 ` [lustre-devel] [PATCH 17/30] lustre: llite: protect ll_dentry_data modification James Simmons
2018-09-24  4:09   ` NeilBrown
2018-09-29 21:30     ` James Simmons
2018-09-17 17:30 ` [lustre-devel] [PATCH 18/30] lustre: llite: llite.stat_blocksize param for fixed st_blksize James Simmons
2018-09-24  4:11   ` NeilBrown
2018-09-17 17:30 ` [lustre-devel] [PATCH 19/30] lustre: llite: set sec ctx on client's inode at create time James Simmons
2018-09-17 17:30 ` [lustre-devel] [PATCH 20/30] lustre: osc: osc page lru list race James Simmons
2018-09-17 17:30 ` [lustre-devel] [PATCH 21/30] lustre: ldlm: use static initializer macros where possible James Simmons
2018-09-24  4:17   ` NeilBrown
2018-09-17 17:30 ` [lustre-devel] [PATCH 22/30] lustre: osc: update timestamps on write only James Simmons
2018-09-17 17:30 ` [lustre-devel] [PATCH 23/30] lustre: osc: adds radix_tree_preload James Simmons
2018-09-17 17:30 ` [lustre-devel] [PATCH 24/30] lustre: llite: rcu-walk check should not depend on statahead James Simmons
2018-09-24  4:22   ` NeilBrown
2018-09-29 21:33     ` James Simmons
2018-10-02  4:35       ` NeilBrown
2018-09-17 17:30 ` James Simmons [this message]
2018-09-17 17:30 ` [lustre-devel] [PATCH 26/30] lustre: ptlrpc: add replay request into unreplied list James Simmons
2018-09-17 17:30 ` [lustre-devel] [PATCH 27/30] lustre: ptlrpc: increase sleep time in ptlrpc_request_bufs_pack() James Simmons
2018-09-17 17:30 ` [lustre-devel] [PATCH 28/30] lustre: ptlrpc: free reply buffer earlier for open RPC James Simmons
2018-09-17 17:30 ` [lustre-devel] [PATCH 29/30] lustre: libcfs: use save_stack_trace for stack dump James Simmons
2018-09-17 17:30 ` [lustre-devel] [PATCH 30/30] lustre: clio: fix spare bit handling James Simmons

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=1537205440-6656-26-git-send-email-jsimmons@infradead.org \
    --to=jsimmons@infradead.org \
    --cc=lustre-devel@lists.lustre.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.