svn commit: r324961 - head/sys/fs/ext2fs

Fedor Uporov fsu at FreeBSD.org
Tue Oct 24 19:14:34 UTC 2017


Author: fsu
Date: Tue Oct 24 19:14:33 2017
New Revision: 324961
URL: https://svnweb.freebsd.org/changeset/base/324961

Log:
  Do not free bufs in case of extents metadata blocks + remove unneeded asserts.
  
  Approved by:    pfg (mentor)
  MFC after:      6 months

Modified:
  head/sys/fs/ext2fs/ext2_extents.c

Modified: head/sys/fs/ext2fs/ext2_extents.c
==============================================================================
--- head/sys/fs/ext2fs/ext2_extents.c	Tue Oct 24 17:14:53 2017	(r324960)
+++ head/sys/fs/ext2fs/ext2_extents.c	Tue Oct 24 19:14:33 2017	(r324961)
@@ -420,7 +420,7 @@ ext4_ext_find_extent(struct inode *ip, daddr_t block,
 		}
 
 		ext4_ext_fill_path_bdata(&path[ppos], bp, blk);
-		brelse(bp);
+		bqrelse(bp);
 
 		eh = ext4_ext_block_header(path[ppos].ep_data);
 		error = ext4_ext_check_header(ip, eh);
@@ -1228,7 +1228,7 @@ ext4_ext_get_blocks(struct inode *ip, e4fs_daddr_t ibl
 	}
 
 	if ((ex = path[depth].ep_ext)) {
-	        uint64_t lblk = ex->e_blk;
+		uint64_t lblk = ex->e_blk;
 		uint16_t e_len  = ex->e_len;
 		e4fs_daddr_t e_start = ext4_ext_extent_pblock(ex);
 
@@ -1397,9 +1397,6 @@ ext4_ext_rm_leaf(struct inode *ip, struct ext4_extent_
 			/* Remove whole extent. */
 			block = ex_blk;
 			num = 0;
-			KASSERT(a == ex_blk, ("ext4_ext_rm_leaf: bad a"));
-			KASSERT(b != ex_blk + ex_len - 1,
-			    ("ext4_ext_rm_leaf: bad b"));
 		}
 
 		if (ex == EXT_FIRST_EXTENT(eh))
@@ -1508,7 +1505,7 @@ ext4_ext_remove_space(struct inode *ip, off_t length, 
 		return (error);
 
 	path = malloc(sizeof(struct ext4_extent_path) * (depth + 1),
-		      M_EXT2EXTENTS, M_WAITOK | M_ZERO);
+	    M_EXT2EXTENTS, M_WAITOK | M_ZERO);
 	if (!path)
 		return (ENOMEM);
 


More information about the svn-src-all mailing list