public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Oleg Drokin <green@linuxhacker.ru>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	linux-kernel@vger.kernel.org, devel@driverdev.osuosl.org
Cc: "John L. Hammond" <john.hammond@intel.com>,
	Oleg Drokin <oleg.drokin@intel.com>
Subject: [PATCH 05/10] staging/lustre/clio: reorder initialization in cl_req_alloc()
Date: Fri, 15 Aug 2014 12:48:10 -0400	[thread overview]
Message-ID: <1408121295-29115-6-git-send-email-green@linuxhacker.ru> (raw)
In-Reply-To: <1408121295-29115-1-git-send-email-green@linuxhacker.ru>

From: "John L. Hammond" <john.hammond@intel.com>

In cl_req_alloc() ensure that the list heads crq_pages and crq_layers
have been initialized before passing the request to
cl_req_completion(). This fixes an oops in the error path.

Signed-off-by: John L. Hammond <john.hammond@intel.com>
Reviewed-on: http://review.whamcloud.com/11009
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-5290
Reviewed-by: Bobi Jam <bobijam@gmail.com>
Reviewed-by: Jinshan Xiong <jinshan.xiong@intel.com>
Signed-off-by: Oleg Drokin <oleg.drokin@intel.com>
---
 drivers/staging/lustre/lustre/obdclass/cl_io.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/lustre/lustre/obdclass/cl_io.c b/drivers/staging/lustre/lustre/obdclass/cl_io.c
index 6870ee8..4265821 100644
--- a/drivers/staging/lustre/lustre/obdclass/cl_io.c
+++ b/drivers/staging/lustre/lustre/obdclass/cl_io.c
@@ -1452,12 +1452,13 @@ struct cl_req *cl_req_alloc(const struct lu_env *env, struct cl_page *page,
 	if (req != NULL) {
 		int result;
 
+		req->crq_type = crt;
+		INIT_LIST_HEAD(&req->crq_pages);
+		INIT_LIST_HEAD(&req->crq_layers);
+
 		OBD_ALLOC(req->crq_o, nr_objects * sizeof(req->crq_o[0]));
 		if (req->crq_o != NULL) {
 			req->crq_nrobjs = nr_objects;
-			req->crq_type = crt;
-			INIT_LIST_HEAD(&req->crq_pages);
-			INIT_LIST_HEAD(&req->crq_layers);
 			result = cl_req_init(env, req, page);
 		} else
 			result = -ENOMEM;
-- 
1.9.3


  parent reply	other threads:[~2014-08-15 16:49 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-15 16:48 [PATCH 00/10] Catchup lustre fixes Oleg Drokin
2014-08-15 16:48 ` [PATCH 01/10] staging/lustre/llite: check for integer overflow in hsm user request Oleg Drokin
2014-08-15 16:48 ` [PATCH 02/10] staging/lustre/mdc: cleanup intent if mdc_finish_enqueue() fails Oleg Drokin
2014-08-15 16:48 ` [PATCH 03/10] staging/lustre/llite: Make sure ft_flags is valid Oleg Drokin
2014-08-15 16:48 ` [PATCH 04/10] staging/lustre/ldlm: drop redundant ibits lock interoperability check Oleg Drokin
2014-08-15 16:48 ` Oleg Drokin [this message]
2014-08-15 16:48 ` [PATCH 06/10] staging/lustre/llite: hold inode mutex around ll_setattr_raw() Oleg Drokin
2014-08-15 16:48 ` [PATCH 07/10] staging/lustre/llite: optimize ll_fid2path() Oleg Drokin
2014-08-15 16:48 ` [PATCH 08/10] staging/lustre/llite: Fix integer overflow in ll_fid2path Oleg Drokin
2014-08-15 16:48 ` [PATCH 09/10] lustre: Add MAINTAINERS entry Oleg Drokin
2014-08-17 16:37   ` Greg Kroah-Hartman
2014-08-17 16:47     ` Oleg Drokin
2014-08-18 14:21       ` Dan Carpenter
2014-08-30 18:51       ` Greg Kroah-Hartman
2014-08-15 16:48 ` [PATCH 10/10] lustre: Add some basic documentation Oleg Drokin
2014-08-17 16:37   ` Greg Kroah-Hartman
2014-08-17 16:49     ` Oleg Drokin
2014-08-17 16:53       ` Greg Kroah-Hartman

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=1408121295-29115-6-git-send-email-green@linuxhacker.ru \
    --to=green@linuxhacker.ru \
    --cc=devel@driverdev.osuosl.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=john.hammond@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=oleg.drokin@intel.com \
    /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