search for: btrfs_wait_ordered_range

Displaying 20 results from an estimated 22 matches for "btrfs_wait_ordered_range".

2013 Oct 25
0
[PATCH] Btrfs: return an error from btrfs_wait_ordered_range
I noticed that if the free space cache has an error writing out it''s data it won''t actually error out, it will just carry on. This is because it doesn''t check the return value of btrfs_wait_ordered_range, which didn''t actually return anything. So fix this in order to keep us from making free space cache look valid when it really isnt. Thanks, Signed-off-by: Josef Bacik <jbacik@fusionio.com> --- fs/btrfs/file.c | 66 ++++++++++++++++++++++++++------------------- fs/btr...
2011 Aug 09
2
[PATCH] Btrfs: truncate pages from clone ioctl target range
...octl.c | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-) diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c index a3c4751..cac9491 100644 --- a/fs/btrfs/ioctl.c +++ b/fs/btrfs/ioctl.c @@ -2243,6 +2243,10 @@ static noinline long btrfs_ioctl_clone(struct file *file, unsigned long srcfd, btrfs_wait_ordered_range(src, off, len); } + /* truncate page cache pages from target inode range */ + truncate_inode_pages_range(&inode->i_data, off, + ((off+len+PAGE_CACHE_SIZE-1)&PAGE_CACHE_MASK)-1); + /* clone data */ key.objectid = btrfs_ino(src); key.type = BTRFS_EXTENT_DATA_KEY; -- 1.7....
2010 Jul 26
6
[PATCH] Btrfs: compressed file size ioctl
..._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 Minimal example: #include <sys/ioctl.h> #include <fcntl.h> #include <stdint.h> #include <stdio.h> #define BT...
2013 Oct 28
0
[PATCH] Btrfs: make sure the delalloc workers actually flush compressed writes
...trfs/inode.c @@ -8181,18 +8181,24 @@ out_notrans: static void btrfs_run_delalloc_work(struct btrfs_work *work) { struct btrfs_delalloc_work *delalloc_work; + struct inode *inode; delalloc_work = container_of(work, struct btrfs_delalloc_work, work); - if (delalloc_work->wait) - btrfs_wait_ordered_range(delalloc_work->inode, 0, (u64)-1); - else - filemap_flush(delalloc_work->inode->i_mapping); + inode = delalloc_work->inode; + if (delalloc_work->wait) { + btrfs_wait_ordered_range(inode, 0, (u64)-1); + } else { + filemap_flush(inode->i_mapping); + if (test_bit(BTRFS_INODE_HAS_...
2012 Jan 05
4
[RFC][PATCH 3/3] Btrfs: improve truncation of btrfs
...from); unlock_extent_cached(io_tree, page_start, page_end, &cached_state, GFP_NOFS); @@ -3459,7 +3465,9 @@ static int btrfs_setsize(struct inode *inode, loff_t newsize) ret = btrfs_update_inode(trans, root, inode); btrfs_end_transaction_throttle(trans, root); } else { - + btrfs_wait_ordered_range(inode, + newsize & ~(root->sectorsize - 1), + (u64)-1); /* * We''re truncating a file that used to have good data down to * zero. Make sure it gets into the ordered flush list so that @@ -3469,8 +3477,8 @@ static int btrfs_setsize(struct inode *inode, loff_t news...
2009 Jun 08
1
[PATCH] Btrfs: fdatasync should skip metadata writeout
...up linux-2.6.30-rc8.org/fs/btrfs/file.c linux-2.6.30-rc8.btrfs/fs/btrfs/file.c --- linux-2.6.30-rc8.org/fs/btrfs/file.c 2009-06-04 16:26:25.000000000 +0900 +++ linux-2.6.30-rc8.btrfs/fs/btrfs/file.c 2009-06-08 10:48:13.000000000 +0900 @@ -1189,6 +1189,8 @@ int btrfs_sync_file(struct file *file, s btrfs_wait_ordered_range(inode, 0, (u64)-1); root->log_batch++; + if (datasync && !(inode->i_state & I_DIRTY_PAGES)) + goto out; /* * ok we haven''t committed the transaction yet, lets do a commit */ -- To unsubscribe from this list: send the line "unsubscribe linux-btrfs"...
2012 Sep 17
2
'umount' of multi-device volume hangs until the device is physically un-plugged
...t;] __wait_on_bit+0x60/0x90 [ 469.037845] [<ffffffff8112a970>] wait_on_page_bit+0x80/0x90 [ 469.037851] [<ffffffff8107f660>] ? autoremove_wake_function+0x50/0x50 [ 469.037858] [<ffffffff8112af21>] filemap_fdatawait_range+0x101/0x190 [ 469.037889] [<ffffffffa057e4d8>] btrfs_wait_ordered_range+0x68/0x120 [btrfs] [ 469.037919] [<ffffffffa059f412>] __btrfs_write_out_cache+0x772/0x990 [btrfs] [ 469.037942] [<ffffffffa05573ce>] ? run_clustered_refs+0x1be/0xb50 [btrfs] [ 469.037972] [<ffffffffa05a5278>] ? btrfs_find_ref_cluster+0x68/0x170 [btrfs] [ 469.037999] [<f...
2012 Jun 11
0
[PATCH] Btrfs: call filemap_fdatawrite twice for compression V2
...ret = cow_file_range_async(inode, locked_page, start, end, page_started, nr_written); + } return ret; } diff --git a/fs/btrfs/ordered-data.c b/fs/btrfs/ordered-data.c index 9e138cd..643335a 100644 --- a/fs/btrfs/ordered-data.c +++ b/fs/btrfs/ordered-data.c @@ -627,7 +627,27 @@ void btrfs_wait_ordered_range(struct inode *inode, u64 start, u64 len) /* start IO across the range first to instantiate any delalloc * extents */ - filemap_write_and_wait_range(inode->i_mapping, start, orig_end); + filemap_fdatawrite_range(inode->i_mapping, start, orig_end); + + /* + * So with compression we wil...
2012 Apr 20
44
Ceph on btrfs 3.4rc
After running ceph on XFS for some time, I decided to try btrfs again. Performance with the current "for-linux-min" branch and big metadata is much better. The only problem (?) I''m still seeing is a warning that seems to occur from time to time: [87703.784552] ------------[ cut here ]------------ [87703.789759] WARNING: at fs/btrfs/inode.c:2103
2010 Mar 22
0
[PATCH] Btrfs: change direct I/O read to not use i_mutex.
...iocb->inode->i_mapping, + diocb->lockstart, lockend); + lock_extent(io_tree, diocb->lockstart, lockend, GFP_NOFS); - /* ensure writeout and btree update on everything - * we might read for checksum or compressed extents - */ - data_len = lockend + 1 - diocb->lockstart; - err = btrfs_wait_ordered_range(diocb->inode, - diocb->lockstart, data_len); - if (err) { - diocb->error = err; - mutex_unlock(&diocb->inode->i_mutex); - return; - } - data_len = i_size_read(diocb->inode); - if (data_len < end) - end = data_len; - if (end <= diocb->start) { - mutex_unlock(&...
2009 Nov 12
0
[PATCH 05/12] Btrfs: Avoid orphan inodes cleanup during replaying log
...-1; key.objectid = BTRFS_ORPHAN_OBJECTID; btrfs_set_key_type(&key, BTRFS_ORPHAN_ITEM_KEY); key.offset = (u64)-1; - while (1) { ret = btrfs_search_slot(NULL, root, &key, path, 0, 0); if (ret < 0) { @@ -3293,6 +3294,11 @@ void btrfs_delete_inode(struct inode *inode) } btrfs_wait_ordered_range(inode, 0, (u64)-1); + if (root->fs_info->log_root_recovering) { + BUG_ON(!list_empty(&BTRFS_I(inode)->i_orphan)); + goto no_delete; + } + if (inode->i_nlink > 0) { BUG_ON(btrfs_root_refs(&root->root_item) != 0); goto no_delete; @@ -3700,6 +3706,13 @@ struct ino...
2013 Oct 05
10
Linux Arch: kernel BUG at fs/btrfs/inode.c:873!
...fs_writepages+0x28/0x30 [btrfs] [ 68.127985] [<ffffffff8112e28e>] do_writepages+0x1e/0x40 [ 68.128014] [<ffffffff81123669>] __filemap_fdatawrite_range+0x59/0x60 [ 68.128048] [<ffffffff81123733>] filemap_fdatawrite_range+0x13/0x20 [ 68.128090] [<ffffffffa0481c99>] btrfs_wait_ordered_range+0x49/0x110 [btrfs] [ 68.128135] [<ffffffffa04a64c0>] __btrfs_write_out_cache+0x6d0/0x8f0 [btrfs] [ 68.128180] [<ffffffffa04a774d>] btrfs_write_out_cache+0x8d/0xe0 [btrfs] [ 68.128224] [<ffffffffa0459983>] btrfs_write_dirty_block_groups+0x533/0x620 [btrfs] [ 68.128271]...
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.
2009 Aug 24
0
[PATCH] Btrfs: proper metadata -ENOSPC handling
...ur_offset = last_byte; if (err || cur_offset >= block_end) break; + /* 1 item for the file extent */ + err = btrfs_extend_transaction(trans, root, 1); + if (err) + break; } btrfs_end_transaction(trans, root); @@ -3009,7 +3040,17 @@ void btrfs_delete_inode(struct inode *inode) btrfs_wait_ordered_range(inode, 0, (u64)-1); btrfs_i_size_write(inode, 0); - trans = btrfs_join_transaction(root, 1); + + /* + * 1 for the orphan entry + * 1 for the inode + */ + trans = btrfs_join_transaction(root, 2); + if (IS_ERR(trans)) { + WARN_ON(1); + btrfs_orphan_del(NULL, inode); + goto no_delete; + }...
2013 Nov 12
0
[PATCH] Btrfs: incompatible format change to remove hole extents V4
...h_hole(struct inode *inode, loff_t offset, loff_t len) u64 drop_end; int ret = 0; int err = 0; + int rsv_count; bool same_page = ((offset >> PAGE_CACHE_SHIFT) == ((offset + len - 1) >> PAGE_CACHE_SHIFT)); + bool no_holes = btrfs_fs_incompat(root->fs_info, NO_HOLES); btrfs_wait_ordered_range(inode, offset, len); @@ -2157,9 +2161,10 @@ static int btrfs_punch_hole(struct inode *inode, loff_t offset, loff_t len) /* * 1 - update the inode * 1 - removing the extents in the range - * 1 - adding the hole extent + * 1 - adding the hole extent if no_holes isn''t set */ -...
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 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
2013 Oct 18
11
[GIT PULL] Btrfs
Hi Linus, My for-linus branch has a one line fix: git://git.kernel.org/pub/scm/linux/kernel/git/mason/linux-btrfs.git for-linus Sage hit a deadlock with ceph on btrfs, and Josef tracked it down to a regression in our initial rc1 pull. When doing nocow writes we were sometimes starting a transaction with locks held. Josef Bacik (1) commits (+1/-0): Btrfs: release path before starting
2012 Aug 01
7
[PATCH] Btrfs: barrier before waitqueue_active
We need an smb_mb() before waitqueue_active to avoid missing wakeups. Before Mitch was hitting a deadlock between the ordered flushers and the transaction commit because the ordered flushers were waiting for more refs and were never woken up, so those smp_mb()''s are the most important. Everything else I added for correctness sake and to avoid getting bitten by this again somewhere else.
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