patch-2.1.129 linux/fs/hfs/extent.c

Next file: linux/fs/hfs/file_hdr.c
Previous file: linux/fs/hfs/btree.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.1.128/linux/fs/hfs/extent.c linux/fs/hfs/extent.c
@@ -487,6 +487,7 @@
 
 	if ((count = next + 1 - ablocks) > 0) {
 		for (i=2; (i>=0) && !ext->length[i]; --i) {};
+		lock_bitmap(mdb);
 		while (count && (ext->length[i] <= count)) {
 			ext->end -= ext->length[i];
 			count -= ext->length[i];
@@ -509,6 +510,7 @@
 				       "blocks.\n", error);
 			}
 		}
+		unlock_bitmap(mdb);
 		update_ext(fork, ext);
 	}
 
@@ -612,7 +614,9 @@
 		} else {
 			if (!(ext = new_extent(fork, ext, blocks/ablksz,
 					       start, len, ablksz))) {
+				lock_bitmap(mdb);
 				hfs_clear_vbm_bits(mdb, start, len);
+				unlock_bitmap(mdb);
 				return;
 			}
 		}

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov