linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Theodore Ts'o <tytso@mit.edu>
To: Ext4 Developers List <linux-ext4@vger.kernel.org>
Cc: Theodore Ts'o <tytso@mit.edu>
Subject: [PATCH 05/10] libquota: add error checking to quota_write_inode()
Date: Tue,  7 Jan 2014 09:53:09 -0500	[thread overview]
Message-ID: <1389106394-31898-5-git-send-email-tytso@mit.edu> (raw)
In-Reply-To: <1389106394-31898-1-git-send-email-tytso@mit.edu>

Addresses-Coverity-Id: #709476

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
---
 lib/quota/mkquota.c | 15 ++++++++++++---
 1 file changed, 12 insertions(+), 3 deletions(-)

diff --git a/lib/quota/mkquota.c b/lib/quota/mkquota.c
index 3aa8100..b920f27 100644
--- a/lib/quota/mkquota.c
+++ b/lib/quota/mkquota.c
@@ -133,11 +133,16 @@ errcode_t quota_write_inode(quota_ctx_t qctx, int qtype)
 	fs = qctx->fs;
 	retval = ext2fs_get_mem(sizeof(struct quota_handle), &h);
 	if (retval) {
-		log_err("Unable to allocate quota handle");
+		log_err("Unable to allocate quota handle: %s",
+			error_message(retval));
 		goto out;
 	}
 
-	ext2fs_read_bitmaps(fs);
+	retval = ext2fs_read_bitmaps(fs);
+	if (retval) {
+		log_err("Couldn't read bitmaps: %s", error_message(retval));
+		goto out;
+	}
 
 	for (i = 0; i < MAXQUOTAS; i++) {
 		if ((qtype != -1) && (i != qtype))
@@ -171,7 +176,11 @@ errcode_t quota_write_inode(quota_ctx_t qctx, int qtype)
 		fs->flags &= ~EXT2_FLAG_SUPER_ONLY;
 	}
 
-	ext2fs_write_bitmaps(fs);
+	retval = ext2fs_write_bitmaps(fs);
+	if (retval) {
+		log_err("Couldn't write bitmaps: %s", error_message(retval));
+		goto out;
+	}
 out:
 	if (h)
 		ext2fs_free_mem(&h);
-- 
1.8.5.rc3.362.gdf10213


  parent reply	other threads:[~2014-01-07 14:53 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-07 14:53 [PATCH 01/10] e2fsck: release allocated memory on error or abort in e2fsck_pass1() Theodore Ts'o
2014-01-07 14:53 ` [PATCH 02/10] libext2fs: make ext2fs_group_desc_csum return 0 if meta_csum not enabled Theodore Ts'o
2014-01-07 14:53 ` [PATCH 03/10] e2fsck: fix memory leak on error path in read_bad_blocks_files() Theodore Ts'o
2014-01-07 14:53 ` [PATCH 04/10] libext2fs: remove redundant code in rb_print_stats() Theodore Ts'o
2014-01-07 14:53 ` Theodore Ts'o [this message]
2014-01-07 14:53 ` [PATCH 06/10] libquota: add error checking to quota_remove_inode Theodore Ts'o
2014-01-07 14:53 ` [PATCH 07/10] libext2fs: fix memory leaks on error paths in ext2fs_create_icount_tdb Theodore Ts'o
2014-01-07 14:53 ` [PATCH 08/10] debugfs: remove dead code Theodore Ts'o
2014-01-07 17:14   ` Eric Sandeen
2014-01-07 17:25     ` Theodore Ts'o
2014-01-07 18:58       ` Darrick J. Wong
2014-01-07 14:53 ` [PATCH 09/10] badblocks: print warning if set_o_direct() fails Theodore Ts'o
2014-01-07 14:53 ` [PATCH 10/10] libss: fix memory leak if realloc() fails in ss_parse() Theodore Ts'o

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=1389106394-31898-5-git-send-email-tytso@mit.edu \
    --to=tytso@mit.edu \
    --cc=linux-ext4@vger.kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).