[PATCH 3/3] reiser4: discard: handle incomplete erase units at the end of a partition.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Signed-off-by: Ivan Shapovalov <intelfx100@xxxxxxxxx>
---
 fs/reiser4/discard.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/fs/reiser4/discard.c b/fs/reiser4/discard.c
index 10c1707..6163ea2 100644
--- a/fs/reiser4/discard.c
+++ b/fs/reiser4/discard.c
@@ -542,7 +542,8 @@ static int discard_precise_extents(struct list_head *head)
 					last_padding_end = end;
 					last_padding_clean = 1;
 
-				} else if (try_allocate_blocks(end, tailp)) {
+				} else if (end + tailp <= reiser4_block_count(sb) &&
+					   try_allocate_blocks(end, tailp)) {
 					/*
 					 * tail padding is clean,
 					 * pad the tail
-- 
2.3.0

--
To unsubscribe from this list: send the line "unsubscribe reiserfs-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux File System Development]     [Linux BTRFS]     [Linux NFS]     [Linux Filesystems]     [Ext4 Filesystem]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite Forum]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Device Mapper]     [Linux Resources]

  Powered by Linux