linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Btrfs: check return value of btrfs_set_extent_delalloc()
@ 2012-06-26  3:22 Tsutomu Itoh
  2012-06-26 13:26 ` David Sterba
  0 siblings, 1 reply; 3+ messages in thread
From: Tsutomu Itoh @ 2012-06-26  3:22 UTC (permalink / raw)
  To: chris.mason; +Cc: linux-btrfs

btrfs_set_extent_delalloc() has the possibility of returning the error.
So I add the code in which the return value of btrfs_set_extent_delalloc()
is checked.

Signed-off-by: Tsutomu Itoh <t-itoh@jp.fujitsu.com>
---
 fs/btrfs/ioctl.c |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c
index 0e92e57..95e27d6 100644
--- a/fs/btrfs/ioctl.c
+++ b/fs/btrfs/ioctl.c
@@ -1016,13 +1016,16 @@ again:
 	}
 
 
-	btrfs_set_extent_delalloc(inode, page_start, page_end - 1,
-				  &cached_state);
+	ret = btrfs_set_extent_delalloc(inode, page_start, page_end - 1,
+					&cached_state);
 
 	unlock_extent_cached(&BTRFS_I(inode)->io_tree,
 			     page_start, page_end - 1, &cached_state,
 			     GFP_NOFS);
 
+	if (ret)
+		goto out;
+
 	for (i = 0; i < i_done; i++) {
 		clear_page_dirty_for_io(pages[i]);
 		ClearPageChecked(pages[i]);


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

end of thread, other threads:[~2012-06-26 13:42 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-06-26  3:22 [PATCH] Btrfs: check return value of btrfs_set_extent_delalloc() Tsutomu Itoh
2012-06-26 13:26 ` David Sterba
2012-06-26 13:42   ` Josef Bacik

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).