All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Btrfs: fix missing clear_extent_bit
@ 2011-09-28 10:00 Liu Bo
  2011-09-28 12:34 ` Josef Bacik
  0 siblings, 1 reply; 4+ messages in thread
From: Liu Bo @ 2011-09-28 10:00 UTC (permalink / raw)
  To: linux-btrfs; +Cc: josef, chris.mason

We forget to clear inode's dirty_bytes and EXTENT_DIRTY at the end of write.

Signed-off-by: Liu Bo <liubo2009@cn.fujitsu.com>
---
 fs/btrfs/file.c  |    1 -
 fs/btrfs/inode.c |    5 ++++-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/fs/btrfs/file.c b/fs/btrfs/file.c
index e7872e4..3f3b4a8 100644
--- a/fs/btrfs/file.c
+++ b/fs/btrfs/file.c
@@ -1150,7 +1150,6 @@ fail:
 		faili--;
 	}
 	return err;
-
 }
 
 static noinline ssize_t __btrfs_buffered_write(struct file *file,
diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c
index 0ccc743..d42bea4 100644
--- a/fs/btrfs/inode.c
+++ b/fs/btrfs/inode.c
@@ -882,7 +882,7 @@ static noinline int cow_file_range(struct inode *inode,
 		 */
 		op = unlock ? EXTENT_CLEAR_UNLOCK_PAGE : 0;
 		op |= EXTENT_CLEAR_UNLOCK | EXTENT_CLEAR_DELALLOC |
-			EXTENT_SET_PRIVATE2;
+		      EXTENT_SET_PRIVATE2;
 
 		extent_clear_unlock_delalloc(inode, &BTRFS_I(inode)->io_tree,
 					     start, start + ram_size - 1,
@@ -1778,6 +1778,9 @@ static int btrfs_finish_ordered_io(struct inode *inode, u64 start, u64 end)
 				   ordered_extent->len);
 		BUG_ON(ret);
 	}
+	clear_extent_bit(io_tree, ordered_extent->file_offset,
+			 ordered_extent->file_offset + ordered_extent->len - 1,
+			 EXTENT_DIRTY, 0, 0, &cached_state, GFP_NOFS);
 	unlock_extent_cached(io_tree, ordered_extent->file_offset,
 			     ordered_extent->file_offset +
 			     ordered_extent->len - 1, &cached_state, GFP_NOFS);
-- 
1.6.5.2


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2011-09-29  0:51 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-09-28 10:00 [PATCH] Btrfs: fix missing clear_extent_bit Liu Bo
2011-09-28 12:34 ` Josef Bacik
2011-09-28 13:44   ` Chris Mason
2011-09-29  0:51     ` Liu Bo

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.