search for: gfp_nofs

Displaying 20 results from an estimated 173 matches for "gfp_nofs".

2011 Aug 15
9
[patch v2 0/9] btrfs: More error handling patches
Hi all - The following 9 patches add more error handling to the btrfs code: - Add btrfs_panic - Catch locking failures in {set,clear}_extent_bit - Push up set_extent_bit errors to callers - Push up lock_extent errors to callers - Push up clear_extent_bit errors to callers - Push up unlock_extent errors to callers - Make pin_down_extent return void - Push up btrfs_pin_extent errors to
2011 Feb 12
3
[PATCH] fix uncheck memory allocations
.../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 btrfs_submit_compressed_write(struct inode *inode, u64 start, bdev = BTRFS_I(inode)->root->fs_info->fs_devices->latest_bdev; bio = compr...
2011 Oct 04
68
[patch 00/65] Error handling patchset v3
Hi all - Here''s my current error handling patchset, against 3.1-rc8. Almost all of this patchset is preparing for actual error handling. Before we start in on that work, I''m trying to reduce the surface we need to worry about. It turns out that there is a ton of code that returns an error code but never actually reports an error. The patchset has grown to 65 patches. 46 of them
2010 Jul 29
1
[Bug] check return of kmalloc()
...0-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_unlock(&em_tree->lock); compressed_len = em->block_len; - cb = kmalloc(compressed_bio_size(root, compressed_len), GFP_NOFS); a...
2013 Nov 19
6
[PATCH] Btrfs: fix very slow inode eviction and fs unmount
...>lock); + + lock_extent_bits(io_tree, state->start, state->end, + 0, &cached_state); + clear_extent_bit(io_tree, state->start, state->end, + EXTENT_LOCKED | EXTENT_DIRTY | + EXTENT_DELALLOC | EXTENT_DO_ACCOUNTING | + EXTENT_DEFRAG, 1, 1, + &cached_state, GFP_NOFS); + free_extent_state(state); + + spin_lock(&io_tree->lock); + } + spin_unlock(&io_tree->lock); +} + void btrfs_evict_inode(struct inode *inode) { struct btrfs_trans_handle *trans; @@ -4498,7 +4554,8 @@ void btrfs_evict_inode(struct inode *inode) trace_btrfs_inode_evict(inod...
2013 Mar 10
1
[PATCH] fs: fs2fs: Replaced calls to kmalloc and memcpy with kmemdup
...2/localalloc.c index aebeacd..839183f 100644 --- a/fs/ocfs2/localalloc.c +++ b/fs/ocfs2/localalloc.c @@ -434,12 +434,11 @@ void ocfs2_shutdown_local_alloc(struct ocfs2_super *osb) bh = osb->local_alloc_bh; alloc = (struct ocfs2_dinode *) bh->b_data; - alloc_copy = kmalloc(bh->b_size, GFP_NOFS); + alloc_copy = kmemdup(alloc, bh->b_size, GFP_NOFS); if (!alloc_copy) { status = -ENOMEM; goto out_commit; } - memcpy(alloc_copy, alloc, bh->b_size); status = ocfs2_journal_access_di(handle, INODE_CACHE(local_alloc_inode), bh, OCFS2_JOURNAL_ACCESS_WRITE); @@ -1244,13 +1...
2011 Feb 15
1
[PATCH] Btrfs: fix uncheck memory allocations
.../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 btrfs_submit_compressed_write(struct inode *inode, u64 start, bdev = BTRFS_I(inode)->root->fs_info->fs_devices->latest_bdev; bio = compr...
2001 Jul 03
1
GFP_BUFFER change to GFP_NOFS is not nice to symlinks
Hello Andrew, I fetched (CVS) ext3 latest changes (3 July 2001) which include changing GFP_BUFFER to GFP_NOFS and now have random troubles with symlink files on ext3 filesystems. >From my experience over the last days with Linus's changes I find that GFP_NOIO worked perfectly. Below is Linus's response about bounce buffer change. I am late to work, but this evening will try to substitute _NOF...
2011 Nov 09
6
[PATCH 0/5] Btrfs: mount error handling fixes
A bunch of fixes (memory leaks, NULL pointer dereferences and devices hanging in busy state) to sanitize error handling during mount sequence. This is on top of for-linus + slyfox''s double-free fix. Thanks, Ilya Ilya Dryomov (5): Btrfs: fix memory leak in btrfs_parse_early_options() Btrfs: fix subvol_name leak on error in btrfs_mount() Btrfs: avoid null dereference and leaks
2013 May 07
2
[PATCH] Btrfs: fix passing wrong arg gfp_t to decide the correct allocation mode
...b, slot, op, GFP_ATOMIC); tree_mod_log_write_unlock(fs_info); return ret; @@ -608,7 +608,7 @@ static noinline int tree_mod_log_insert_key(struct btrfs_fs_info *fs_info, struct extent_buffer *eb, int slot, enum mod_log_op op) { - return tree_mod_log_insert_key_mask(fs_info, eb, slot, op, GFP_NOFS); + return tree_mod_log_insert_key_mask(fs_info, eb, slot, op); } static noinline int @@ -616,13 +616,13 @@ tree_mod_log_insert_key_locked(struct btrfs_fs_info *fs_info, struct extent_buffer *eb, int slot, enum mod_log_op op) { - return __tree_mod_log_insert_key(fs_info, eb,...
2012 Jan 26
1
[PATCH] btrfs: mask out gfp flasg in releasepage
...ey may end up in kmem_cache_alloc called from alloc_extent_state, slab allocator will BUG_ON when there is HIGHMEM or DMA32 flag set. This may happen when btrfs is mounted from a loop device, which masks out __GFP_IO flag. The check in try_release_extent_state 3399 if ((mask & GFP_NOFS) == GFP_NOFS) 3400 mask = GFP_NOFS; will not work and passes unfiltered flags further resulting in crash at mm/slab.c:2963 [<000000000024ae4c>] cache_alloc_refill+0x3b4/0x5c8 [<000000000024c810>] kmem_cache_alloc+0x204/0x294 [<00000000001fd3c2>] mempoo...
2010 Mar 22
0
[PATCH] Btrfs: change direct I/O read to not use i_mutex.
...p + * as we don''t know the final extent size until we look it up + */ + if (test_bit(EXTENT_FLAG_COMPRESSED, &em->flags) && + (diocb->lockstart > em->start || *lockend <= em->start + em->len)) { + unlock_extent(io_tree, diocb->lockstart, *lockend, GFP_NOFS); + diocb->lockstart = em->start; + *lockend = min(*lockend, em->start + em->len - 1); + *safe_to_read = 0; + return; + } + + /* one test on first loop covers all extents if no concurrent writes */ + if (*safe_to_read) + return; + + ordered = btrfs_lookup_first_ordered_extent(diocb...
2011 Jan 06
3
Offline Deduplication for Btrfs V2
Just a quick update, I''ve dropped the hashing stuff in favor of doing a memcmp in the kernel to make sure the data is still the same. The thing that takes a while is reading the data up from disk, so doing a memcmp of the entire buffer isn''t that big of a deal, not to mention there''s a possiblity for malicious users if there is a problem with the hashing algorithms we
2012 Sep 17
13
[PATCH 1/2 v3] Btrfs: use flag EXTENT_DEFRAG for snapshot-aware defrag
...fs/btrfs/file.c index 5caf285..226690a 100644 --- a/fs/btrfs/file.c +++ b/fs/btrfs/file.c @@ -1173,8 +1173,8 @@ again: clear_extent_bit(&BTRFS_I(inode)->io_tree, start_pos, last_pos - 1, EXTENT_DIRTY | EXTENT_DELALLOC | - EXTENT_DO_ACCOUNTING, 0, 0, &cached_state, - GFP_NOFS); + EXTENT_DO_ACCOUNTING | EXTENT_DEFRAG, + 0, 0, &cached_state, GFP_NOFS); unlock_extent_cached(&BTRFS_I(inode)->io_tree, start_pos, last_pos - 1, &cached_state, GFP_NOFS); diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c index b2c3514..55857eb 10064...
2010 Jan 19
1
static analysis tool cppcheck meets the btrfs code - four issues
...I agree with cppcheck. Suggest delete the if test. 2. [./btrfs/free-space-cache.c:906]: (style) Redundant condition. It is safe to deallocate a NULL pointer Duplicate. 3. [./btrfs/relocation.c:3278]: (error) Memory leak: cluster The source code is         cluster = kzalloc(sizeof(*cluster), GFP_NOFS);         if (!cluster)                 return -ENOMEM;         path = btrfs_alloc_path();         if (!path)                 return -ENOMEM; Suggest new code         cluster = kzalloc(sizeof(*cluster), GFP_NOFS);         if (!cluster)                 return -ENOMEM;         path = btrfs_alloc_...
2012 Dec 18
0
[PATCH] [RFC] Btrfs: Subpagesize blocksize (WIP).
...t); + blocksize_bits = inode->vfs_inode.i_sb->s_blocksize_bits; + + /* Calculate extent buffer dimensions. */ + start = page->index << PAGE_CACHE_SHIFT; + len = inode->root->leafsize; + + /* Allocate the head extent buffer. */ + eb_head = __alloc_extent_buffer(tree, start, len, GFP_NOFS); + if (!eb_head) { + WARN_ON(1); + return NULL; + } + start += len; + eb_head->pages[0] = page; + eb_cur = eb_head; + + /* Allocate the other extent buffers. */ + for (i = 1; i < (PAGE_CACHE_SIZE >> blocksize_bits); i++) { + eb_cur->next = __alloc_extent_buffer(tree, start, len,...
2011 Mar 23
0
[PATCH] Btrfs: cleanup some BUG_ON()
...s_insert_empty_item(trans, fs_info->extent_root, path, @@ -6438,10 +6439,14 @@ int btrfs_drop_subtree(struct btrfs_tran BUG_ON(root->root_key.objectid != BTRFS_TREE_RELOC_OBJECTID); path = btrfs_alloc_path(); - BUG_ON(!path); + if (!path) + return -ENOMEM; wc = kzalloc(sizeof(*wc), GFP_NOFS); - BUG_ON(!wc); + if (!wc) { + btrfs_free_path(path); + return -ENOMEM; + } btrfs_assert_tree_locked(parent); parent_level = btrfs_header_level(parent); @@ -6899,7 +6904,11 @@ static noinline int get_new_locations(st } path = btrfs_alloc_path(); - BUG_ON(!path); + if (!path) { + if...
2012 May 03
1
[PATCH] Btrfs: fix crash in scrub repair code when device is missing
...agev + page_index; page->logical = logical; page->physical = bbio->stripes[mirror_index].physical; + /* for missing devices, bdev is NULL */ page->bdev = bbio->stripes[mirror_index].dev->bdev; page->mirror_num = mirror_index + 1; page->page = alloc_page(GFP_NOFS); @@ -1042,6 +1043,12 @@ static int scrub_recheck_block(struct btrfs_fs_info *fs_info, struct scrub_page *page = sblock->pagev + page_num; DECLARE_COMPLETION_ONSTACK(complete); + if (page->bdev == NULL) { + page->io_error = 1; + sblock->no_io_error_seen = 0; + continue; +...
2013 Feb 15
1
[PATCH] btrfs: use kmalloc for lzo de/compress buffer
...head *lzo_alloc_workspace(void) if (!workspace) return ERR_PTR(-ENOMEM); - workspace->mem = vmalloc(LZO1X_MEM_COMPRESS); - workspace->buf = vmalloc(PAGE_CACHE_SIZE); - workspace->cbuf = vmalloc(lzo1x_worst_compress(PAGE_CACHE_SIZE)); + workspace->mem = kmalloc(LZO1X_MEM_COMPRESS, GFP_NOFS); + workspace->buf = kmalloc(PAGE_CACHE_SIZE, GFP_NOFS); + workspace->cbuf = kmalloc(lzo1x_worst_compress(PAGE_CACHE_SIZE), + GFP_NOFS); if (!workspace->mem || !workspace->buf || !workspace->cbuf) goto fail; -- 1.8.0.3
2013 Oct 09
2
[PATCH] Btrfs: add tests for find_lock_delalloc_range
...o through and create and mark all of our pages dirty, we pin + * everything to make sure our pages don''t get evicted and screw up our + * test. + */ + for (index = 0; index < (total_dirty >> PAGE_CACHE_SHIFT); index++) { + page = find_or_create_page(inode->i_mapping, index, GFP_NOFS); + if (!page) { + test_msg("Failed to allocate test page\n"); + ret = -ENOMEM; + goto out; + } + SetPageDirty(page); + if (index) { + unlock_page(page); + } else { + page_cache_get(page); + locked_page = page; + } + } + + /* Test this scenario + * |--- delalloc ---| +...