[RFC][PATCH 9/10] Fix bugs in multi-block allocation and locality-group

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

 



- Move lg_list to s_locality_dirty in ext4_lg_sync_single_group()
  to flush all of dirty inodes.
- Fix ext4_mb_new_blocks() to return err value when defrag failed.

Signed-off-by: Takashi Sato <t-sato@xxxxxxxxxxxxx>
Signed-off-by: Akira Fujita <a-fujita@xxxxxxxxxxxxx>
---
diff -X Online-Defrag_linux-2.6.19-rc6-git/Documentation/dontdiff -upNr linux-2.6.19-rc6-test3/fs/ext4/lg.c Online-Defrag_linux-2.6.19-rc6-git/fs/ext4/lg.c
--- linux-2.6.19-rc6-test3/fs/ext4/lg.c	2007-06-20 16:56:16.000000000 +0900
+++ Online-Defrag_linux-2.6.19-rc6-git/fs/ext4/lg.c	2007-06-18 14:21:54.000000000 +0900
@@ -389,6 +389,10 @@ int ext4_lg_sync_single_group(struct sup
 		cond_resched();
 		spin_lock(&inode_lock);
 		if (wbc->nr_to_write <= 0) {
+			if (!list_empty(&lg->lg_io)) {
+				set_bit(EXT4_LG_DIRTY, &lg->lg_flags);
+				list_move(&lg->lg_list, &sbi->s_locality_dirty);
+			}
 			rc = EXT4_STOP_WRITEBACK;
 			code = 6;
 			break;
diff -X Online-Defrag_linux-2.6.19-rc6-git/Documentation/dontdiff -upNr linux-2.6.19-rc6-test3/fs/ext4/mballoc.c Online-Defrag_linux-2.6.19-rc6-git/fs/ext4/mballoc.c
--- linux-2.6.19-rc6-test3/fs/ext4/mballoc.c	2007-06-20 16:58:22.000000000 +0900
+++ Online-Defrag_linux-2.6.19-rc6-git/fs/ext4/mballoc.c	2007-06-18 14:21:54.000000000 +0900
@@ -3732,8 +3732,10 @@ ext4_fsblk_t ext4_mb_new_blocks(handle_t
 		!(EXT4_I(ar->inode)->i_state & EXT4_STATE_BLOCKS_RESERVED)) {
 		reserved = ar->len;
 		err = ext4_reserve_blocks(sb, reserved);
-		if (err)
+		if (err) {
+			*errp = err;
 			return err;
+		}
 	}
 
 	if (!ext4_mb_use_preallocated(&ac)) {
-
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]
  Powered by Linux