Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e1f041e1 authored by Liu Bo's avatar Liu Bo Committed by Chris Mason
Browse files

Btrfs: update to the right index of defragment



When we use autodefrag, we forget to update the index which indicates
the last page we've dirty.  And we'll set dirty flags on a same set of
pages again and again.

Signed-off-by: default avatarLiu Bo <liubo2009@cn.fujitsu.com>
Signed-off-by: default avatarChris Mason <chris.mason@oracle.com>
parent 66c26892
Loading
Loading
Loading
Loading
+3 −0
Original line number Original line Diff line number Diff line
@@ -1186,6 +1186,9 @@ int btrfs_defrag_file(struct inode *inode, struct file *file,
			if (newer_off == (u64)-1)
			if (newer_off == (u64)-1)
				break;
				break;


			if (ret > 0)
				i += ret;

			newer_off = max(newer_off + 1,
			newer_off = max(newer_off + 1,
					(u64)i << PAGE_CACHE_SHIFT);
					(u64)i << PAGE_CACHE_SHIFT);