linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/3] ext4: Fix error handling in ext4_ext_shift_extents
@ 2014-04-13 15:35 Dmitry Monakhov
  2014-04-13 15:36 ` [PATCH 2/3] ext4: always check ext4_ext_find_extent result Dmitry Monakhov
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Dmitry Monakhov @ 2014-04-13 15:35 UTC (permalink / raw)
  To: linux-ext4; +Cc: tytso, Dmitry Monakhov


Signed-off-by: Dmitry Monakhov <dmonakhov@openvz.org>
---
 fs/ext4/extents.c |   11 +++++++++--
 1 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/fs/ext4/extents.c b/fs/ext4/extents.c
index 96e0a4b..38be063 100644
--- a/fs/ext4/extents.c
+++ b/fs/ext4/extents.c
@@ -5314,11 +5314,18 @@ ext4_ext_shift_extents(struct inode *inode, handle_t *handle,
 	 * enough to accomodate the shift.
 	 */
 	path = ext4_ext_find_extent(inode, start - 1, NULL, 0);
+	if (IS_ERR(path))
+		return PTR_ERR(path);
 	depth = path->p_depth;
 	extent =  path[depth].p_ext;
-	ex_start = le32_to_cpu(extent->ee_block);
-	ex_end = le32_to_cpu(extent->ee_block) +
+	if (extent) {
+		ex_start = le32_to_cpu(extent->ee_block);
+		ex_end = le32_to_cpu(extent->ee_block) +
 			ext4_ext_get_actual_len(extent);
+	} else {
+		ex_start = 0;
+		ex_end = 0;
+	}
 	ext4_ext_drop_refs(path);
 	kfree(path);
 
-- 
1.7.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2014-04-13 22:13 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-04-13 15:35 [PATCH 1/3] ext4: Fix error handling in ext4_ext_shift_extents Dmitry Monakhov
2014-04-13 15:36 ` [PATCH 2/3] ext4: always check ext4_ext_find_extent result Dmitry Monakhov
2014-04-13 22:06   ` Theodore Ts'o
2014-04-13 15:36 ` [PATCH 3/3] ext4: remove obsoleted check Dmitry Monakhov
2014-04-13 22:13   ` Theodore Ts'o
2014-04-13 19:10 ` [PATCH 1/3] ext4: Fix error handling in ext4_ext_shift_extents Theodore Ts'o

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).