search for: unlock_extent

Displaying 15 results from an estimated 15 matches for "unlock_extent".

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 callers - Push up non-looped btrfs_transaction_start errors to callers Changes since version 1: - Changed BUG_ON(ret) to BUG_ON(ret < 0) in set_extent_bit push up patch - Added missing chunk to set_exte...
2010 Jul 26
6
[PATCH] Btrfs: compressed file size ioctl
...64 to return the result - replaced the loop while (1) { struct btrfs_ordered_extent *ordered; lock_extent(&BTRFS_I(inode)->io_tree, 0, len, GFP_NOFS); ordered = btrfs_lookup_first_ordered_extent(inode, len); if (BTRFS_I(inode)->delalloc_bytes == 0 && !ordered) break; unlock_extent(&BTRFS_I(inode)->io_tree, 0, len, GFP_NOFS); if (ordered) btrfs_put_ordered_extent(ordered); btrfs_wait_ordered_range(inode, 0, len); } with btrfs_wait_ordered_range(inode, 0, (u64)-1); - return the uncompressed size on disk for uncompressed filesystems instead of EINVAL Minima...
2013 Aug 06
6
[PATCH 0/4] btrfs: out-of-band (aka offline) dedupe v4
Hi, The following series of patches implements in btrfs an ioctl to do out-of-band deduplication of file extents. To be clear, this means that the file system is mounted and running, but the dedupe is not done during file writes, but after the fact when some userspace software initiates a dedupe. The primary patch is loosely based off of one sent by Josef Bacik back in January, 2011.
2010 Mar 22
0
[PATCH] Btrfs: change direct I/O read to not use i_mutex.
...nsure the whole compressed extent is valid on each loop + * 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; + +...
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
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
2009 Nov 02
0
[PATCH 7/8] Make fallocate(2) more ENOSPC friendly
...ns = btrfs_start_transaction(BTRFS_I(inode)->root, 1); - if (!trans) { - ret = -EIO; - goto out_free; - } - /* the extent lock is ordered inside the running * transaction */ @@ -5691,8 +5745,6 @@ static long btrfs_fallocate(struct inode btrfs_put_ordered_extent(ordered); unlock_extent(&BTRFS_I(inode)->io_tree, alloc_start, locked_end, GFP_NOFS); - btrfs_end_transaction(trans, BTRFS_I(inode)->root); - /* * we can''t wait on the range with the transaction * running or with the extent lock held @@ -5713,9 +5765,12 @@ static long btrfs_fa...
2013 Oct 09
2
[PATCH] Btrfs: add tests for find_lock_delalloc_range
...&start, + &end, max_bytes); + if (!found) { + test_msg("Should have found at least one delalloc\n"); + goto out_bits; + } + if (start != 0 || end != 4095) { + test_msg("Expected start 0 end 4095, got start %Lu end %Lu\n", + start, end); + goto out_bits; + } + unlock_extent(&tmp, start, end); + unlock_page(locked_page); + page_cache_release(locked_page); + + /* + * Test this scenario + * + * |--- delalloc ---| + * |--- search ---| + */ + test_start = 64 * 1024 * 1024; + locked_page = find_lock_page(inode->i_mapping, + test_start >>...
2008 Apr 10
1
fsfuzz testing: some results
...0000172 027f9000 00000000 00000000 f7945d10 f8b9a246 027f9000 00000000 00000003 00000000 00000671 Call Trace: [<c041fec6>] ? hrtick_set+0xcf/0xd7 [<f8b9a246>] ? cow_file_range+0x15f/0x243 [btrfs] [<f8b9a89f>] ? run_delalloc_range+0x294/0x2b5 [btrfs] [<f8ba622b>] ? unlock_extent+0x17/0x19 [btrfs] [<f8ba69ed>] ? __extent_writepage+0x1a0/0x62d [btrfs] [<c0456f41>] ? write_cache_pages+0x180/0x287 [<f8ba684d>] ? __extent_writepage+0x0/0x62d [btrfs] [<f8b9b079>] ? btrfs_writepages+0x0/0x1d [btrfs] [<f8ba53c6>] ? extent_writepages+0x29/0x44 [bt...
2010 Apr 26
0
[PATCH V2 11/12] Btrfs: Pre-allocate space for data relocation
...t;boundary[nr + 1] - 1 - offset; + else + end = cluster->end - offset; + + lock_extent(&BTRFS_I(inode)->io_tree, start, end, GFP_NOFS); + num_bytes = end + 1 - start; + ret = btrfs_prealloc_file_range(inode, 0, start, + num_bytes, num_bytes, + end + 1, &alloc_hint); + unlock_extent(&BTRFS_I(inode)->io_tree, start, end, GFP_NOFS); + if (ret) + break; + nr++; + } + btrfs_free_reserved_data_space(inode, cluster->end + + 1 - cluster->start); +out: + mutex_unlock(&inode->i_mutex); + return ret; +} + +static noinline_for_stack int setup_extent_map...
2010 May 07
6
[PATCH 1/5] fs: allow short direct-io reads to be completed via buffered IO V2
V1->V2: Check to see if our current ppos is >= i_size after a short DIO read, just in case it was actually a short read and we need to just return. This is similar to what already happens in the write case. If we have a short read while doing O_DIRECT, instead of just returning, fallthrough and try to read the rest via buffered IO. BTRFS needs this because if we encounter a compressed or
2012 Jan 30
3
[PATCH] Btrfs: allow cloning ranges within the same file
...;'t overlap + */ + if (src == inode && !(off + len <= destoff || destoff + len <= off)) + goto out_unlock; + if (destoff > inode->i_size) { ret = btrfs_cont_expand(inode, inode->i_size, destoff); if (ret) @@ -2543,8 +2548,12 @@ out: btrfs_release_path(path); unlock_extent(&BTRFS_I(src)->io_tree, off, off+len, GFP_NOFS); out_unlock: - mutex_unlock(&src->i_mutex); - mutex_unlock(&inode->i_mutex); + if (src != inode) { + mutex_unlock(&src->i_mutex); + mutex_unlock(&inode->i_mutex); + } else { + mutex_unlock(&inode->i_mutex)...
2009 Nov 12
0
[PATCH 03/12] Btrfs: Rewrite btrfs_drop_extents
...next_slot; + } + + ret = btrfs_del_items(trans, root, path, del_slot, + del_nr); + BUG_ON(ret); + + del_nr = 0; + del_slot = 0; + + btrfs_release_path(root, path); + continue; } + + BUG_ON(1); } -out: - btrfs_free_path(path); - if (locked_end > orig_locked_end) { - unlock_extent(&BTRFS_I(inode)->io_tree, orig_locked_end, - locked_end - 1, GFP_NOFS); + + if (del_nr > 0) { + ret = btrfs_del_items(trans, root, path, del_slot, del_nr); + BUG_ON(ret); } + + btrfs_free_path(path); return ret; } @@ -620,23 +548,23 @@ static int extent_mergeable(struct e...
2011 Jan 05
52
Offline Deduplication for Btrfs
Here are patches to do offline deduplication for Btrfs. It works well for the cases it''s expected to, I''m looking for feedback on the ioctl interface and such, I''m well aware there are missing features for the userspace app (like being able to set a different blocksize). If this interface is acceptable I will flesh out the userspace app a little more, but I believe the
2013 Mar 18
27
corruption of active mmapped files in btrfs snapshots
For quite a while, I''ve experienced oddities with snapshotted Firefox _CACHE_00?_ files, whose checksums (and contents) would change after the btrfs snapshot was taken, and would even change depending on how the file was brought to memory (e.g., rsyncing it to backup storage vs checking its md5sum before or after the rsync). This only affected these cache files, so I didn''t give