Displaying 5 results from an estimated 5 matches for "btrfs_submit_compressed_write".
2011 Feb 12
3
[PATCH] fix uncheck memory allocations
...s/btrfs/file.c | 8 ++++++--
fs/btrfs/inode.c | 5 +++++
4 files changed, 19 insertions(+), 2 deletions(-)
diff --git a/fs/btrfs/compression.c b/fs/btrfs/compression.c
index 4d2110e..f596554 100644
--- a/fs/btrfs/compression.c
+++ b/fs/btrfs/compression.c
@@ -340,6 +340,8 @@ int btrfs_submit_compressed_write(struct inode *inode, u64 start,
WARN_ON(start & ((u64)PAGE_CACHE_SIZE - 1));
cb = kmalloc(compressed_bio_size(root, compressed_len), GFP_NOFS);
+ if (!cb)
+ return -ENOMEM;
atomic_set(&cb->pending_bios, 0);
cb->errors = 0;
cb->inode = inode;
@@ -354,6 +356,10 @@ int bt...
2011 Feb 15
1
[PATCH] Btrfs: fix uncheck memory allocations
...++++
fs/btrfs/extent-tree.c | 4 ++++
fs/btrfs/inode.c | 2 ++
3 files changed, 12 insertions(+), 0 deletions(-)
diff --git a/fs/btrfs/compression.c b/fs/btrfs/compression.c
index 4d2110e..992a4b9 100644
--- a/fs/btrfs/compression.c
+++ b/fs/btrfs/compression.c
@@ -340,6 +340,8 @@ int btrfs_submit_compressed_write(struct inode *inode, u64 start,
WARN_ON(start & ((u64)PAGE_CACHE_SIZE - 1));
cb = kmalloc(compressed_bio_size(root, compressed_len), GFP_NOFS);
+ if (!cb)
+ return -ENOMEM;
atomic_set(&cb->pending_bios, 0);
cb->errors = 0;
cb->inode = inode;
@@ -354,6 +356,10 @@ int bt...
2010 Jul 29
1
[Bug] check return of kmalloc()
...__GFP_NOFAIL.
Also there are BUG_ON() after kmalloc()''s, if they could be changed not
to panic it would be great.
--- ./fs/btrfs/compression.c 2010-07-06 16:45:48.000000000 +0400
+++ /tmp/cocci-output-7773-0df3b6-compression.c 2010-07-28 18:43:07.000000000 +0400
@@ -350,7 +350,6 @@ int btrfs_submit_compressed_write(struct
int ret;
WARN_ON(start & ((u64)PAGE_CACHE_SIZE - 1));
- cb = kmalloc(compressed_bio_size(root, compressed_len), GFP_NOFS);
atomic_set(&cb->pending_bios, 0);
cb->errors = 0;
cb->inode = inode;
@@ -587,7 +586,6 @@ int btrfs_submit_compressed_read(struct
read_unlo...
2011 Aug 26
0
[PATCH] Btrfs: make some functions return void
...t;> PAGE_CACHE_SHIFT;
unsigned long end_index = (start + ram_size - 1) >> PAGE_CACHE_SHIFT;
@@ -252,7 +252,6 @@ static noinline int end_compressed_writeback(struct inode *inode, u64 start,
index += ret;
}
/* the inode may be gone now */
- return 0;
}
/*
@@ -434,9 +433,9 @@ int btrfs_submit_compressed_write(struct inode *inode, u64 start,
return 0;
}
-static noinline int add_ra_bio_pages(struct inode *inode,
- u64 compressed_end,
- struct compressed_bio *cb)
+static noinline void add_ra_bio_pages(struct inode *inode,
+ u64 compressed_end,
+ struct compressed_bio...
2010 Sep 03
0
[PATCH 1/2] btrfs: document where we use BUG_ON instead of error handling
...iling
+ * to correctly handle a recoverable error condition.
+ */
+#define btrfs_fixable_bug_on(_err) BUG_ON(_err)
+
#endif
diff --git a/fs/btrfs/compression.c b/fs/btrfs/compression.c
index 396039b..b06e1bf 100644
--- a/fs/btrfs/compression.c
+++ b/fs/btrfs/compression.c
@@ -394,13 +394,13 @@ int btrfs_submit_compressed_write(struct inode *inode, u64 start,
*/
atomic_inc(&cb->pending_bios);
ret = btrfs_bio_wq_end_io(root->fs_info, bio, 0);
- BUG_ON(ret);
+ btrfs_fixable_bug_on(ret);
ret = btrfs_csum_one_bio(root, inode, bio, start, 1);
- BUG_ON(ret);
+ btrfs_fixable_bug_on(ret);...