Re: [PATCH 6/7] Btrfs: kill the btree_inode

2016-09-07 Thread Chandan Rajendra
On Friday, September 02, 2016 03:40:05 PM Josef Bacik wrote: Please find my comment inlined below, > In order to more efficiently support sub-page blocksizes we need to stop > allocating pages from pagecache for our metadata. Instead switch to using the > account_metadata* counters for making su

[PATCH] Btrfs: Free fs_info->eb_info only when it holds a valid pointer

2016-09-14 Thread Chandan Rajendra
causes a NULL pointer dereference. Signed-off-by: Chandan Rajendra --- fs/btrfs/ctree.h | 7 +-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/fs/btrfs/ctree.h b/fs/btrfs/ctree.h index ee6956c..33ce069 100644 --- a/fs/btrfs/ctree.h +++ b/fs/btrfs/ctree.h @@ -2882,8 +2882,1

Re: [PATCH v2 0/6] Btrfs: free space tree and sanity test fixes

2016-09-28 Thread Chandan Rajendra
executed generic/127 on a filesystem created using "fragment-free-space-tree.py" that you had provided sometime ago. I did not notice any regressions during the test runs. Tested-by: Chandan Rajendra > > I'm working on the btrfs-progs follow up, but these patches are safe >

[PATCH V21 01/19] Btrfs: subpage-blocksize: extent_clear_unlock_delalloc: Prevent page from being unlocked more than once

2016-10-02 Thread Chandan Rajendra
d by a future commit that gets compression to work in subpage-blocksize scenario. Signed-off-by: Chandan Rajendra --- fs/btrfs/extent_io.c | 16 +++ fs/btrfs/extent_io.h | 5 ++-- fs/btrfs/inode.c | 78 +--- 3 files changed, 57 insertions(+),

[PATCH V21 03/19] Btrfs: subpage-blocksize: Use PG_Uptodate flag to track block uptodate status

2016-10-02 Thread Chandan Rajendra
tatus in the case of blocksize < PAGE_SIZE. We will continue to use PG_Uptodate flag to track uptodate status for blocksize == PAGE_SIZE scenario. Signed-off-by: Chandan Rajendra --- fs/btrfs/extent_io.c | 61 +++- fs/btrfs/extent_io.h | 2 +- fs

[PATCH V21 02/19] Btrfs: subpage-blocksize: Make sure delalloc range intersects with the locked page's range

2016-10-02 Thread Chandan Rajendra
check to make sure that the delalloc range starts from within the file range mapped by the page. Reviewed-by: Josef Bacik Signed-off-by: Chandan Rajendra --- fs/btrfs/extent_io.c | 12 +--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/exte

[PATCH V21 00/19] Allow I/O on blocks whose size is less than page size

2016-10-02 Thread Chandan Rajendra
hole() has been fixed to check for the presence of BLK_STATE_UPTODATE flags for blocks in pages which partially map the file range being punched. Changes from V11: 1. Addressed the review comments provided by Liu Bo for version V11. 2. Fixed file defragmentation code to work in subpagesize

[PATCH V21 11/19] Btrfs: subpage-blocksize: Deal with partial ordered extent allocations.

2016-10-02 Thread Chandan Rajendra
In subpage-blocksize scenario, extent allocations for only some of the dirty blocks of a page can succeed, while allocation for rest of the blocks can fail. This patch allows I/O against such pages to be submitted. Signed-off-by: Chandan Rajendra --- fs/btrfs/extent_io.c | 27

[PATCH V21 09/19] Btrfs: subpage-blocksize: Compute free space tree BITMAP_RANGE based on sectorsize

2016-10-02 Thread Chandan Rajendra
The default bitmap length computation in free space tree sanity tests assumes PAGE_SIZE as the sectorsize. This commit fixes this by using a variable sectorsize to calculate BITMAP_RANGE. Signed-off-by: Chandan Rajendra --- fs/btrfs/tests/free-space-tree-tests.c | 79

[PATCH V21 10/19] Btrfs: subpage-blocksize: Allow mounting filesystems where sectorsize < PAGE_SIZE

2016-10-02 Thread Chandan Rajendra
to be able to mount and use filesystems with 2048 bytes as the sectorsize. Signed-off-by: Chandan Rajendra --- fs/btrfs/disk-io.c | 21 - fs/btrfs/disk-io.h | 2 +- fs/btrfs/extent-tree.c | 4 ++-- fs/btrfs/extent_io.c | 3 +-- fs/btrfs/extent_io.h | 2 +- fs

[PATCH V21 07/19] Btrfs: subpage-blocksize: Use kmalloc()-ed memory to hold metadata blocks

2016-10-02 Thread Chandan Rajendra
ed-off-by: Chandan Rajendra --- fs/btrfs/ctree.h | 6 +- fs/btrfs/disk-io.c | 27 +++--- fs/btrfs/extent_io.c | 204 +-- fs/btrfs/extent_io.h | 8 +- fs/btrfs/tests/extent-io-tests.c | 4 +- 5 files cha

[PATCH V21 15/19] Btrfs: subpage-blocksize: Enable dedupe ioctl

2016-10-02 Thread Chandan Rajendra
ock size < page size". Signed-off-by: Chandan Rajendra --- fs/btrfs/ioctl.c | 10 -- 1 file changed, 10 deletions(-) diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c index 4077fc1..cf13029 100644 --- a/fs/btrfs/ioctl.c +++ b/fs/btrfs/ioctl.c @@ -3321,21 +33

[PATCH V21 13/19] Btrfs: subpage-blocksize: btrfs_punch_hole: Fix uptodate blocks check

2016-10-02 Thread Chandan Rajendra
In case of subpage-blocksize, the file blocks to be punched may map only part of a page. For file blocks inside such pages, we need to check for the presence of BLK_STATE_UPTODATE flag. Signed-off-by: Chandan Rajendra --- fs/btrfs/file.c | 89

[PATCH V21 12/19] Btrfs: subpage-blocksize: Explicitly track I/O status of blocks of an ordered extent.

2016-10-02 Thread Chandan Rajendra
In subpage-blocksize scenario a page can have more than one block. So in addition to PagePrivate2 flag, we would have to track the I/O status of each block of a page to reliably mark the ordered extent as complete. Signed-off-by: Chandan Rajendra --- fs/btrfs/extent_io.c| 19 +-- fs/btrfs

[PATCH V21 06/19] Btrfs: subpage-blocksize: Fix whole page write

2016-10-02 Thread Chandan Rajendra
page->private or by the PG_uptodate flag. Signed-off-by: Chandan Rajendra --- fs/btrfs/extent_io.c | 114 +++--- fs/btrfs/file.c | 16 +++ fs/btrfs/inode.c | 69 -- fs/btrfs/relocation.c | 3 ++ 4 fi

[PATCH V21 08/19] Btrfs: subpage-blocksize: Execute sanity tests on all possible block sizes

2016-10-02 Thread Chandan Rajendra
This commit executes sanity tests for all valid sectorsize/nodesize combinations. Signed-off-by: Chandan Rajendra --- fs/btrfs/tests/btrfs-tests.c | 8 +++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/fs/btrfs/tests/btrfs-tests.c b/fs/btrfs/tests/btrfs-tests.c index dca90d6

[PATCH V21 05/19] Btrfs: subpage-blocksize: Fix whole page read.

2016-10-02 Thread Chandan Rajendra
atch gets the io_lock only when the last block of the bio_vec is being processed. Signed-off-by: Chandan Rajendra --- fs/btrfs/extent_io.c | 299 +-- fs/btrfs/extent_io.h | 76 - fs/btrfs/inode.c | 13 +-- 3 files changed, 320 i

[PATCH V21 14/19] Btrfs: subpage-blocksize: Fix file defragmentation code

2016-10-02 Thread Chandan Rajendra
This commit gets file defragmentation code to work in subpage-blocksize scenario. It does this by keeping track of page offsets that mark block boundaries and passing them as arguments to the functions that implement the defragmentation logic. Signed-off-by: Chandan Rajendra --- fs/btrfs

[PATCH V21 04/19] Btrfs: Remove extent_io_tree's track_uptodate member

2016-10-02 Thread Chandan Rajendra
We now track block uptodate status using a page's PG_Uptodate flag. Hence this commit removes the now unused extent_io_tree->track_uptodate member. Signed-off-by: Chandan Rajendra --- fs/btrfs/disk-io.c | 1 - fs/btrfs/extent_io.h | 1 - fs/btrfs/inode.c | 2 -- 3 files ch

[PATCH V21 18/19] Btrfs: subpage-blocksize: __btrfs_lookup_bio_sums: Set offset when moving to a new bio_vec

2016-10-02 Thread Chandan Rajendra
hen we move to the next bvec of the bio. Signed-off-by: Chandan Rajendra --- fs/btrfs/file-item.c | 7 +-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/fs/btrfs/file-item.c b/fs/btrfs/file-item.c index d0d571c..8fc09c1 100644 --- a/fs/btrfs/file-item.c +++ b/fs/btrfs/file-ite

[PATCH V21 19/19] Btrfs: subpage-blocksize: Disable compression

2016-10-02 Thread Chandan Rajendra
mand. Signed-off-by: Chandan Rajendra --- fs/btrfs/ioctl.c | 8 +++- fs/btrfs/super.c | 19 +++ 2 files changed, 26 insertions(+), 1 deletion(-) diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c index 0fdc0a0..862d97b 100644 --- a/fs/btrfs/ioctl.c +++ b/fs/btrfs/ioctl.c @@ -322,6 +

[PATCH V21 17/19] Btrfs: subpage-blocksize: Make file extent relocate code subpage blocksize aware

2016-10-02 Thread Chandan Rajendra
The file extent relocation code currently assumes blocksize to be same as PAGE_SIZE. This commit adds code to support subpage blocksize scenario. Signed-off-by: Chandan Rajendra --- fs/btrfs/relocation.c | 90 --- 1 file changed, 71 insertions

[PATCH V21 16/19] Btrfs: subpage-blocksize: btrfs_clone: Flush dirty blocks of a page that do not map the clone range

2016-10-02 Thread Chandan Rajendra
such dirty blocks to be flushed to disk before performing the clone operation. Signed-off-by: Chandan Rajendra --- fs/btrfs/ioctl.c | 16 1 file changed, 16 insertions(+) diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c index cf13029..0fdc0a0 100644 --- a/fs/btrfs/ioctl.c +++ b

Re: [PATCH v3 06/10] writeback: introduce super_operations->write_metadata

2018-01-29 Thread Chandan Rajendra
On Wednesday, January 3, 2018 9:59:24 PM IST Josef Bacik wrote: > On Wed, Jan 03, 2018 at 05:26:03PM +0100, Jan Kara wrote: > > Oh ok well if that's the case then I'll fix this up to be a ratio, test > everything, and send it along probably early next week. Thanks, > Hi Josef, Did you get a c

Re: [PATCH v3 06/10] writeback: introduce super_operations->write_metadata

2018-09-28 Thread Chandan Rajendra
On Monday, January 29, 2018 2:36:15 PM IST Chandan Rajendra wrote: > On Wednesday, January 3, 2018 9:59:24 PM IST Josef Bacik wrote: > > On Wed, Jan 03, 2018 at 05:26:03PM +0100, Jan Kara wrote: > > > > > Oh ok well if that's the case then I'll fix this up to be

Qgroup accounting issue on kdave/for-next branch

2016-11-28 Thread Chandan Rajendra
When executing btrfs/126 test on kdave/for-next branch on a ppc64 guest, I noticed the following call trace. [ 77.335887] [ cut here ] [ 77.336115] WARNING: CPU: 0 PID: 8325 at /root/repos/linux/fs/btrfs/qgroup.c:2443 .btrfs_qgroup_free_refroot+0x188/0x220 [ 77.33630

Re: Qgroup accounting issue on kdave/for-next branch

2016-11-29 Thread Chandan Rajendra
On Tuesday, November 29, 2016 03:55:53 PM Qu Wenruo wrote: > At 11/29/2016 02:36 PM, Chandan Rajendra wrote: > > When executing btrfs/126 test on kdave/for-next branch on a ppc64 guest, I > > noticed the following call trace. > > > > [ 77.335

[PATCH] btrfs-progs: Use helper functions to access btrfs_super_block->sys_chunk_array_size

2016-11-29 Thread Chandan Rajendra
ed-off-by: Chandan Rajendra --- utils.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/utils.c b/utils.c index d0189ad..7b17b20 100644 --- a/utils.c +++ b/utils.c @@ -562,14 +562,17 @@ static int insert_temp_chunk_item(int fd, struct extent_buffer *buf, */

Re: Qgroup accounting issue on kdave/for-next branch

2016-11-29 Thread Chandan Rajendra
On Tuesday, November 29, 2016 04:41:41 PM Qu Wenruo wrote: > > At 11/29/2016 04:21 PM, Chandan Rajendra wrote: > > On Tuesday, November 29, 2016 03:55:53 PM Qu Wenruo wrote: > >> At 11/29/2016 02:36 PM, Chandan Rajendra wrote: > >>> When executing btrfs/126 t

[PATCH V2] btrfs-progs: Use helper function to access btrfs_super_block->sys_chunk_array_size

2016-12-01 Thread Chandan Rajendra
ed-off-by: Chandan Rajendra --- utils.c | 8 ++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/utils.c b/utils.c index d0189ad..74dde1e 100644 --- a/utils.c +++ b/utils.c @@ -562,14 +562,18 @@ static int insert_temp_chunk_item(int fd, struct extent_buffer *buf, */

[PATCH 2/2] btrfs-convert: Fix migrate_super_block() to work with 64k sectorsize

2016-12-08 Thread Chandan Rajendra
underlying filesystem. Signed-off-by: Chandan Rajendra --- convert/main.c | 23 --- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/convert/main.c b/convert/main.c index 1148a36..fd6f77b 100644 --- a/convert/main.c +++ b/convert/main.c @@ -1360,7 +1360,7 @@ err

[PATCH 1/2] btrfs-progs: btrfs-convert: Prevent accounting blocks beyond end of device

2016-12-08 Thread Chandan Rajendra
. Signed-off-by: Chandan Rajendra --- convert/main.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/convert/main.c b/convert/main.c index 4b4cea4..1148a36 100644 --- a/convert/main.c +++ b/convert/main.c @@ -1525,6 +1525,9 @@ static int __ext2_add_one_block(ext2_filsys fs, char *bitmap

Re: [PATCH 1/2] btrfs: qgroup: Introduce extent changeset for qgroup reserve functions

2016-12-08 Thread Chandan Rajendra
On Friday, December 02, 2016 10:03:06 AM Qu Wenruo wrote: > Introduce a new parameter, struct extent_changeset for > btrfs_qgroup_reserved_data() and its callers. > > Such extent_changeset was used in btrfs_qgroup_reserve_data() to record > which range it reserved in current reserve, so it can fre

Re: [PATCH 1/2] btrfs-progs: btrfs-convert: Prevent accounting blocks beyond end of device

2016-12-08 Thread Chandan Rajendra
On Friday, December 09, 2016 09:03:57 AM Qu Wenruo wrote: > Hi Chandan, > > Thanks for the patch. > > At 12/08/2016 09:56 PM, Chandan Rajendra wrote: > > When looping across data block bitmap, __ext2_add_one_block() may add > > blocks which do not exist on the u

Re: [PATCH 2/2] btrfs-convert: Fix migrate_super_block() to work with 64k sectorsize

2016-12-08 Thread Chandan Rajendra
On Friday, December 09, 2016 09:09:29 AM Qu Wenruo wrote: > > At 12/08/2016 09:56 PM, Chandan Rajendra wrote: > > migrate_super_block() uses sectorsize to refer to the size of the > > superblock. Hence on 64k sectorsize filesystems, it ends up computing > > checksum beyon

Re: [PATCH 1/2] btrfs: qgroup: Introduce extent changeset for qgroup reserve functions

2016-12-13 Thread Chandan Rajendra
served space underflow. The changes look good to me. Reviewed-by: Chandan Rajendra -- chandan -- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html

Re: [PATCH 2/2] btrfs: qgroup: Fix qgroup reserved space underflow by only freeing reserved ranges

2016-12-13 Thread Chandan Rajendra
ee > data ranges reserved by previous btrfs_qgroup_reserve_data(). > So in above case, Task B will try to free 0 byte, so no underflow. > The changes look good to me. Also, I did not notice any regressions when executing fstests with the patch applied. Reviewed-by: Chandan Rajendra

Re: [PATCH v2 2/3] btrfs-progs: convert: Rework rollback to handle new convert image

2016-12-15 Thread Chandan Rajendra
On Thursday, December 15, 2016 05:03:30 PM Qu Wenruo wrote: > Although commit 9c4b820412746b3 tried to make the rollback condition > less restrict, to co-operate with new rollback behavior, it's still too > restrict. > > If btrfs allocates a new data chunk, it's highly possible that the new > chun

Re: [PATCH v3 5/6] btrfs-progs: convert: Switch to new rollback function

2016-12-19 Thread Chandan Rajendra
convert and old convert. >(To be more specific, old convert is just a subset of more universal > new convert behavior) > >No extra work is needed any more, and we can even open the btrfs RO. Thanks for fixing this. The patchset works fine on ppc64 and x86_64. Tested-by: Chandan

[PATCH] Btrfs: Fix deadlock between direct IO and fast fsync

2016-12-23 Thread Chandan Rajendra
llows the Direct I/O code to complete I/O on all the ordered extents it creates. Signed-off-by: Chandan Rajendra --- fs/btrfs/inode.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c index 5ca88f0..f796037 100644 --- a/fs/btrfs/inode.c +++ b

Re: [PATCH] Btrfs: Fix deadlock between direct IO and fast fsync

2016-12-23 Thread Chandan Rajendra
On Friday, December 23, 2016 03:00:18 PM Chandan Rajendra wrote: > The following deadlock is seen when executing generic/113 test, > > > -+ >

Re: [PATCH] Btrfs: Fix deadlock between direct IO and fast fsync

2016-12-23 Thread Chandan Rajendra
On Friday, December 23, 2016 03:57:40 PM Chandan Rajendra wrote: > On Friday, December 23, 2016 03:00:18 PM Chandan Rajendra wrote: > > The following deadlock is seen when executing generic

Re: [PATCH] Btrfs: Fix deadlock between direct IO and fast fsync

2016-12-23 Thread Chandan Rajendra
On Friday, December 23, 2016 04:18:00 PM Liu Bo wrote: > On Fri, Dec 23, 2016 at 05:27:55PM +0530, Chandan Rajendra wrote: > > On Friday, December 23, 2016 03:57:40 PM Chandan Rajendra wrote: > > > On Friday, December 23, 2016 03:00:18 PM Chandan Rajendra wrote: > > >

[PATCH] btrfs/012: Enable test to be executed on non-4k block size filesystems

2016-12-26 Thread Chandan Rajendra
To get the test to work on non-4k block sized filesystems, this commit obtains the block size of the Btrfs filesystem from $TEST_DIR. Signed-off-by: Chandan Rajendra --- tests/btrfs/012 | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/btrfs/012 b/tests/btrfs/012

Re: [PATCH] Btrfs: fix wrong argument for btrfs_lookup_ordered_range

2017-01-25 Thread Chandan Rajendra
ed_range(inode, page_start, page_end); > + ordered = btrfs_lookup_ordered_range(inode, page_start, PAGE_SIZE); > if (ordered) { > unlock_extent_cached(io_tree, page_start, page_end, > &cached_state, GFP_NOFS); > Thanks

Re: [PATCH V15 00/15] Btrfs: Subpagesize-blocksize: Allow I/O on blocks whose size is less than page size

2016-02-28 Thread Chandan Rajendra
On Thursday 11 Feb 2016 23:17:38 Chandan Rajendra wrote: > Btrfs assumes block size to be the same as the machine's page > size. This would mean that a Btrfs instance created on a 4k page size > machine (e.g. x86) will not be mountable on machines with larger page > sizes (e

[RFC PATCH] btrfs/066: Fix race condition by making 'subvolume stress' task to exit gracefully

2016-03-19 Thread Chandan Rajendra
0, btrfs/065, btrfs/067 and btrfs/068) where __btrfs_stress_subvolume() is used. I am planning to fix them up once we arrive at a solution to which everybody agrees. Signed-off-by: Chandan Rajendra --- common/rc | 9 + tests/btrfs/066 | 27 +++ 2 files cha

Re: [RFC PATCH] btrfs/066: Fix race condition by making 'subvolume stress' task to exit gracefully

2016-03-19 Thread Chandan Rajendra
On Thursday 17 Mar 2016 15:23:39 Eryu Guan wrote: > A named pipe seems too heavy and complicated to me. How about breaking > out the loop in _btrfs_stress_subvolume on the existence of some file? > e.g. > > _btrfs_stress_subvolume(): > ... > local stop_file=$5 > while [ ! -e $sto

[PATCH V2] _btrfs_stress_subvolume: Fix race condition by making 'subvolume stress' task to exit gracefully

2016-03-21 Thread Chandan Rajendra
_stress_subvolume() i.e. btrfs/060, btrfs/065, btrfs/067 & btrfs/068. Suggested-by: Eryu Guan Signed-off-by: Chandan Rajendra --- Changelog: V1->V2: Instead of named pipes, Use a file to let 'subvolume stress' task know that it should break from the while loop. common/rc | 3

Re: [PATCH V2] _btrfs_stress_subvolume: Fix race condition by making 'subvolume stress' task to exit gracefully

2016-03-21 Thread Chandan Rajendra
On Monday 21 Mar 2016 20:07:06 Eryu Guan wrote: > > diff --git a/common/rc b/common/rc > > index 16f5a43..7d971ea 100644 > > --- a/common/rc > > +++ b/common/rc > > @@ -3280,9 +3280,10 @@ _btrfs_stress_subvolume() > > > > local btrfs_mnt=$2 > > local subvol_name=$3 > > local subvol_mnt

[PATCH V3] _btrfs_stress_subvolume: Fix race condition by making 'subvolume stress' task to exit gracefully

2016-03-21 Thread Chandan Rajendra
_stress_subvolume() i.e. btrfs/060, btrfs/065, btrfs/067 & btrfs/068. Suggested-by: Eryu Guan Reviewed-by: Eryu Guan Signed-off-by: Chandan Rajendra --- Changelog: V2->V3: Use the correct argument value as the 'stop file' name in _btrfs_stress_subvolume(). I had forgotten to pull the

Re: [PATCH] btrfs: make sure we stay inside the bvec during __btrfs_lookup_bio_sums

2016-03-21 Thread Chandan Rajendra
e our bio. > Chris, Thanks for finding the issue and fixing it. From now onwards, I will make sure that I have CONFIG_DEBUG_PAGEALLOC enabled on my test kernel build config. Reviewed-by: Chandan Rajendra -- chandan -- To unsubscribe from this list: send the line "unsubscribe linux-btr

Re: [PATCH V15 00/15] Btrfs: Subpagesize-blocksize: Allow I/O on blocks whose size is less than page size

2016-03-22 Thread Chandan Rajendra
On Tuesday 22 Mar 2016 12:04:23 David Sterba wrote: > On Thu, Feb 11, 2016 at 11:17:38PM +0530, Chandan Rajendra wrote: > > this patchset temporarily disables the commit > > f82c458a2c3ffb94b431fc6ad791a79df1b3713e. > > > > The commits for the Btrfs kernel modul

Re: [PATCH V15 00/15] Btrfs: Subpagesize-blocksize: Allow I/O on blocks whose size is less than page size

2016-03-31 Thread Chandan Rajendra
On Thursday 31 Mar 2016 15:59:11 David Sterba wrote: > On Thu, Mar 31, 2016 at 11:31:06AM +0200, David Sterba wrote: > > On Tue, Mar 22, 2016 at 06:50:32PM +0530, Chandan Rajendra wrote: > > > On Tuesday 22 Mar 2016 12:04:23 David Sterba wrote: > > > > On Thu, Fe

[PATCH] Btrfs: __btrfs_buffered_write: Pass valid file offset when releasing delalloc space

2016-04-03 Thread Chandan Rajendra
d hence when passing it as an argument to btrfs_delalloc_release_space(), we may end up releasing larger delalloc space than we originally had reserved. Signed-off-by: Chandan Rajendra --- fs/btrfs/file.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/fs/btrfs/file.c b/f

[PATCH V16 00/18] Allow I/O on blocks whose size is less than page size

2016-04-14 Thread Chandan Rajendra
pages which partially map the file range being punched. Changes from V11: 1. Addressed the review comments provided by Liu Bo for version V11. 2. Fixed file defragmentation code to work in subpagesize-blocksize scenario. 3. Many "hard to reproduce" bugs were fixed. Chandan Rajendr

[PATCH V16 04/18] Btrfs: subpage-blocksize: Define extent_buffer_head.

2016-04-14 Thread Chandan Rajendra
t extent_buffer' to 'struct extent_buffer_head' Also, this patch moves EXTENT_BUFFER_TREE_REF, EXTENT_BUFFER_DUMMY and EXTENT_BUFFER_IN_TREE flags from extent_buffer->ebflags to extent_buffer_head->bflags. Reviewed-by: Liu Bo Signed-off-by: Chandan Rajendra --- fs/btrfs/ct

[PATCH V16 01/18] Btrfs: subpage-blocksize: Fix whole page read.

2016-04-14 Thread Chandan Rajendra
atch gets the io_lock only when the last block of the bio_vec is being processed. Signed-off-by: Chandan Rajendra --- fs/btrfs/extent_io.c | 321 +-- fs/btrfs/extent_io.h | 71 +++- fs/btrfs/inode.c | 13 +-- 3 files changed, 280 in

[PATCH V16 03/18] Btrfs: subpage-blocksize: Make sure delalloc range intersects with the locked page's range

2016-04-14 Thread Chandan Rajendra
check to make sure that the delalloc range starts from within the file range mapped by the page. Signed-off-by: Chandan Rajendra --- fs/btrfs/extent_io.c | 12 +--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/extent_io.c index 9b6c8e0..70d32ef

[PATCH V16 02/18] Btrfs: subpage-blocksize: Fix whole page write

2016-04-14 Thread Chandan Rajendra
->private. Signed-off-by: Chandan Rajendra --- fs/btrfs/extent_io.c | 129 +- fs/btrfs/file.c | 16 +++ fs/btrfs/inode.c | 64 - fs/btrfs/relocation.c | 3 ++ 4 files changed, 125 insertions(+), 87 deleti

[PATCH V16 09/18] Btrfs: subpage-blocksize: Explicitly track I/O status of blocks of an ordered extent.

2016-04-14 Thread Chandan Rajendra
In subpage-blocksize scenario a page can have more than one block. So in addition to PagePrivate2 flag, we would have to track the I/O status of each block of a page to reliably mark the ordered extent as complete. Signed-off-by: Chandan Rajendra --- fs/btrfs/extent_io.c| 19 +-- fs/btrfs

[PATCH V16 17/18] Btrfs: subpage-blocksize: Make file extent relocate code subpage blocksize aware

2016-04-14 Thread Chandan Rajendra
The file extent relocation code currently assumes blocksize to be same as PAGE_CACHE_SIZE. This commit adds code to support subpage blocksize scenario. Signed-off-by: Chandan Rajendra --- fs/btrfs/ioctl.c | 10 +++ fs/btrfs/relocation.c | 73

[PATCH V16 11/18] Btrfs: subpage-blocksize: Prevent writes to an extent buffer when PG_writeback flag is set

2016-04-14 Thread Chandan Rajendra
page. Hence this patch adds a new flag (i.e. EXTENT_BUFFER_HEAD_WRITEBACK) and corresponding code to track the writeback status of the page and to prevent writes to any of the extent buffers mapped to the page while writeback is going on. Signed-off-by: Chandan Rajendra --- fs/btrfs/ct

[PATCH V16 14/18] Btrfs: subpage-blocksize: extent_clear_unlock_delalloc: Prevent page from being unlocked more than once

2016-04-14 Thread Chandan Rajendra
d by a future commit that gets compression to work in subpage-blocksize scenario. Signed-off-by: Chandan Rajendra --- fs/btrfs/extent_io.c | 16 ++ fs/btrfs/extent_io.h | 5 ++-- fs/btrfs/inode.c | 84 ++-- 3 files changed, 61 insertions(+),

[PATCH V16 15/18] Btrfs: subpage-blocksize: Enable dedupe ioctl

2016-04-14 Thread Chandan Rajendra
ock size < page size". Signed-off-by: Chandan Rajendra --- fs/btrfs/ioctl.c | 10 -- 1 file changed, 10 deletions(-) diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c index bf79dbc..4ff7cf8 100644 --- a/fs/btrfs/ioctl.c +++ b/fs/btrfs/ioctl.c @@ -3256,21 +32

[PATCH V16 08/18] Btrfs: subpage-blocksize: Deal with partial ordered extent allocations.

2016-04-14 Thread Chandan Rajendra
In subpage-blocksize scenario, extent allocations for only some of the dirty blocks of a page can succeed, while allocation for rest of the blocks can fail. This patch allows I/O against such pages to be submitted. Signed-off-by: Chandan Rajendra --- fs/btrfs/extent_io.c | 27

[PATCH V16 13/18] Btrfs: subpage-blocksize: Fix file defragmentation code

2016-04-14 Thread Chandan Rajendra
This commit gets file defragmentation code to work in subpage-blocksize scenario. It does this by keeping track of page offsets that mark block boundaries and passing them as arguments to the functions that implement the defragmentation logic. Signed-off-by: Chandan Rajendra --- fs/btrfs

[PATCH V16 05/18] Btrfs: subpage-blocksize: Read tree blocks whose size is < PAGE_CACHE_SIZE

2016-04-14 Thread Chandan Rajendra
In the case of subpage-blocksize, this patch makes it possible to read only a single metadata block from the disk instead of all the metadata blocks that map into a page. Signed-off-by: Chandan Rajendra --- fs/btrfs/disk-io.c | 52 + fs/btrfs/disk-io.h | 3 ++ fs

[PATCH V16 16/18] Btrfs: btrfs_clone: Flush dirty blocks of a page that do not map the clone range

2016-04-14 Thread Chandan Rajendra
such dirty blocks to be flushed to disk before performing the clone operation. Signed-off-by: Chandan Rajendra --- fs/btrfs/ioctl.c | 16 1 file changed, 16 insertions(+) diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c index 4ff7cf8..3038589 100644 --- a/fs/btrfs/ioctl.c +++ b

[PATCH V16 07/18] Btrfs: subpage-blocksize: Allow mounting filesystems where sectorsize < PAGE_SIZE

2016-04-14 Thread Chandan Rajendra
This patch allows mounting filesystems with sectorsize smaller than the PAGE_SIZE. Signed-off-by: Chandan Rajendra --- fs/btrfs/disk-io.c | 10 +++--- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c index 708b8cb..1db0063 100644 --- a/fs

[PATCH V16 06/18] Btrfs: subpage-blocksize: Write only dirty extent buffers belonging to a page

2016-04-14 Thread Chandan Rajendra
For the subpage-blocksize scenario, this patch adds the ability to write a single extent buffer to the disk. Signed-off-by: Chandan Rajendra --- fs/btrfs/disk-io.c | 32 +++--- fs/btrfs/extent_io.c | 277 +-- 2 files changed, 242 insertions

[PATCH V16 10/18] Btrfs: subpage-blocksize: btrfs_punch_hole: Fix uptodate blocks check

2016-04-14 Thread Chandan Rajendra
In case of subpage-blocksize, the file blocks to be punched may map only part of a page. For file blocks inside such pages, we need to check for the presence of BLK_STATE_UPTODATE flag. Signed-off-by: Chandan Rajendra --- fs/btrfs/file.c | 66

[PATCH V16 18/18] Btrfs: subpage-blocksize: __btrfs_lookup_bio_sums: Set offset when moving to a new bio_vec

2016-04-14 Thread Chandan Rajendra
hen we move to the next bvec of the bio. Signed-off-by: Chandan Rajendra --- fs/btrfs/file-item.c | 7 +-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/fs/btrfs/file-item.c b/fs/btrfs/file-item.c index 7a7d6e2..472b069 100644 --- a/fs/btrfs/file-item.c +++ b/fs/btrfs/file-ite

[PATCH V16 12/18] Revert "btrfs: fix lockups from btrfs_clear_path_blocking"

2016-04-14 Thread Chandan Rajendra
The patch "Btrfs: subpage-blocksize: Prevent writes to an extent buffer when PG_writeback flag is set" requires btrfs_try_tree_write_lock() to be a true try lock w.r.t to both spinning and blocking locks. During 2015's Vault Conference Btrfs meetup, Chris Mason had suggested that he will write up a

Re: [PATCH V16 00/18] Allow I/O on blocks whose size is less than page size

2016-04-14 Thread Chandan Rajendra
Hello all, I accidentally sent out patches from the incorrect branch. Please ignore this patchset. -- chandan -- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-

[PATCH V17 12/18] Revert "btrfs: fix lockups from btrfs_clear_path_blocking"

2016-04-14 Thread Chandan Rajendra
The patch "Btrfs: subpage-blocksize: Prevent writes to an extent buffer when PG_writeback flag is set" requires btrfs_try_tree_write_lock() to be a true try lock w.r.t to both spinning and blocking locks. During 2015's Vault Conference Btrfs meetup, Chris Mason had suggested that he will write up a

[PATCH V17 18/18] Btrfs: subpage-blocksize: __btrfs_lookup_bio_sums: Set offset when moving to a new bio_vec

2016-04-14 Thread Chandan Rajendra
hen we move to the next bvec of the bio. Signed-off-by: Chandan Rajendra --- fs/btrfs/file-item.c | 7 +-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/fs/btrfs/file-item.c b/fs/btrfs/file-item.c index 7a7d6e2..472b069 100644 --- a/fs/btrfs/file-item.c +++ b/fs/btrfs/file-ite

[PATCH V17 07/18] Btrfs: subpage-blocksize: Allow mounting filesystems where sectorsize < PAGE_SIZE

2016-04-14 Thread Chandan Rajendra
This patch allows mounting filesystems with sectorsize smaller than the PAGE_SIZE. Signed-off-by: Chandan Rajendra --- fs/btrfs/disk-io.c | 10 +++--- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c index 708b8cb..1db0063 100644 --- a/fs

[PATCH V17 11/18] Btrfs: subpage-blocksize: Prevent writes to an extent buffer when PG_writeback flag is set

2016-04-14 Thread Chandan Rajendra
page. Hence this patch adds a new flag (i.e. EXTENT_BUFFER_HEAD_WRITEBACK) and corresponding code to track the writeback status of the page and to prevent writes to any of the extent buffers mapped to the page while writeback is going on. Signed-off-by: Chandan Rajendra --- fs/btrfs/ct

[PATCH V17 08/18] Btrfs: subpage-blocksize: Deal with partial ordered extent allocations.

2016-04-14 Thread Chandan Rajendra
In subpage-blocksize scenario, extent allocations for only some of the dirty blocks of a page can succeed, while allocation for rest of the blocks can fail. This patch allows I/O against such pages to be submitted. Signed-off-by: Chandan Rajendra --- fs/btrfs/extent_io.c | 27

[PATCH V17 01/18] Btrfs: subpage-blocksize: Fix whole page read.

2016-04-14 Thread Chandan Rajendra
atch gets the io_lock only when the last block of the bio_vec is being processed. Signed-off-by: Chandan Rajendra --- fs/btrfs/extent_io.c | 321 +-- fs/btrfs/extent_io.h | 71 +++- fs/btrfs/inode.c | 13 +-- 3 files changed, 280 in

[PATCH V17 14/18] Btrfs: subpage-blocksize: extent_clear_unlock_delalloc: Prevent page from being unlocked more than once

2016-04-14 Thread Chandan Rajendra
d by a future commit that gets compression to work in subpage-blocksize scenario. Signed-off-by: Chandan Rajendra --- fs/btrfs/extent_io.c | 16 ++ fs/btrfs/extent_io.h | 5 ++-- fs/btrfs/inode.c | 84 ++-- 3 files changed, 61 insertions(+),

[PATCH V17 00/18] Allow I/O on blocks whose size is less than page size

2016-04-14 Thread Chandan Rajendra
ressed the review comments provided by Liu Bo for version V11. 2. Fixed file defragmentation code to work in subpagesize-blocksize scenario. 3. Many "hard to reproduce" bugs were fixed. Chandan Rajendra (18): Btrfs: subpage-blocksize: Fix whole page read. Btrfs: subpage-blocksize:

[PATCH V17 09/18] Btrfs: subpage-blocksize: Explicitly track I/O status of blocks of an ordered extent.

2016-04-14 Thread Chandan Rajendra
In subpage-blocksize scenario a page can have more than one block. So in addition to PagePrivate2 flag, we would have to track the I/O status of each block of a page to reliably mark the ordered extent as complete. Signed-off-by: Chandan Rajendra --- fs/btrfs/extent_io.c| 19 +-- fs/btrfs

[PATCH V17 06/18] Btrfs: subpage-blocksize: Write only dirty extent buffers belonging to a page

2016-04-14 Thread Chandan Rajendra
For the subpage-blocksize scenario, this patch adds the ability to write a single extent buffer to the disk. Signed-off-by: Chandan Rajendra --- fs/btrfs/disk-io.c | 32 +++--- fs/btrfs/extent_io.c | 277 +-- 2 files changed, 242 insertions

[PATCH V17 15/18] Btrfs: subpage-blocksize: Enable dedupe ioctl

2016-04-14 Thread Chandan Rajendra
ock size < page size". Signed-off-by: Chandan Rajendra --- fs/btrfs/ioctl.c | 10 -- 1 file changed, 10 deletions(-) diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c index bf79dbc..4ff7cf8 100644 --- a/fs/btrfs/ioctl.c +++ b/fs/btrfs/ioctl.c @@ -3256,21 +32

[PATCH V17 17/18] Btrfs: subpage-blocksize: Make file extent relocate code subpage blocksize aware

2016-04-14 Thread Chandan Rajendra
The file extent relocation code currently assumes blocksize to be same as PAGE_SIZE. This commit adds code to support subpage blocksize scenario. Signed-off-by: Chandan Rajendra --- fs/btrfs/relocation.c | 73 +-- 1 file changed, 48 insertions

[PATCH V17 02/18] Btrfs: subpage-blocksize: Fix whole page write

2016-04-14 Thread Chandan Rajendra
->private. Signed-off-by: Chandan Rajendra --- fs/btrfs/extent_io.c | 129 +- fs/btrfs/file.c | 16 +++ fs/btrfs/inode.c | 64 - fs/btrfs/relocation.c | 3 ++ 4 files changed, 125 insertions(+), 87 deleti

[PATCH V17 05/18] Btrfs: subpage-blocksize: Read tree blocks whose size is < PAGE_CACHE_SIZE

2016-04-14 Thread Chandan Rajendra
In the case of subpage-blocksize, this patch makes it possible to read only a single metadata block from the disk instead of all the metadata blocks that map into a page. Signed-off-by: Chandan Rajendra --- fs/btrfs/disk-io.c | 52 + fs/btrfs/disk-io.h | 3 ++ fs

[PATCH V17 03/18] Btrfs: subpage-blocksize: Make sure delalloc range intersects with the locked page's range

2016-04-14 Thread Chandan Rajendra
check to make sure that the delalloc range starts from within the file range mapped by the page. Signed-off-by: Chandan Rajendra --- fs/btrfs/extent_io.c | 12 +--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/extent_io.c index 9b6c8e0..70d32ef

[PATCH V17 16/18] Btrfs: btrfs_clone: Flush dirty blocks of a page that do not map the clone range

2016-04-14 Thread Chandan Rajendra
such dirty blocks to be flushed to disk before performing the clone operation. Signed-off-by: Chandan Rajendra --- fs/btrfs/ioctl.c | 16 1 file changed, 16 insertions(+) diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c index 4ff7cf8..7d39cba 100644 --- a/fs/btrfs/ioctl.c +++ b

[PATCH V17 13/18] Btrfs: subpage-blocksize: Fix file defragmentation code

2016-04-14 Thread Chandan Rajendra
This commit gets file defragmentation code to work in subpage-blocksize scenario. It does this by keeping track of page offsets that mark block boundaries and passing them as arguments to the functions that implement the defragmentation logic. Signed-off-by: Chandan Rajendra --- fs/btrfs

[PATCH V17 04/18] Btrfs: subpage-blocksize: Define extent_buffer_head.

2016-04-14 Thread Chandan Rajendra
t extent_buffer' to 'struct extent_buffer_head' Also, this patch moves EXTENT_BUFFER_TREE_REF, EXTENT_BUFFER_DUMMY and EXTENT_BUFFER_IN_TREE flags from extent_buffer->ebflags to extent_buffer_head->bflags. Reviewed-by: Liu Bo Signed-off-by: Chandan Rajendra --- fs/btrfs/ct

[PATCH V17 10/18] Btrfs: subpage-blocksize: btrfs_punch_hole: Fix uptodate blocks check

2016-04-14 Thread Chandan Rajendra
In case of subpage-blocksize, the file blocks to be punched may map only part of a page. For file blocks inside such pages, we need to check for the presence of BLK_STATE_UPTODATE flag. Signed-off-by: Chandan Rajendra --- fs/btrfs/file.c | 66

[PATCH] Btrfs: subpage-blocksize: btrfs_punch_hole: Fix uptodate blocks check

2016-04-17 Thread Chandan Rajendra
In case of subpage-blocksize, the file blocks to be punched may map only part of a page. For file blocks inside such pages, we need to check for the presence of BLK_STATE_UPTODATE flag. Signed-off-by: Chandan Rajendra --- fs/btrfs/file.c | 66

[PATCH] Btrfs: subpage-blocksize: Make sure delalloc range intersects with the locked page's range

2016-04-17 Thread Chandan Rajendra
check to make sure that the delalloc range starts from within the file range mapped by the page. Signed-off-by: Chandan Rajendra --- fs/btrfs/extent_io.c | 12 +--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/extent_io.c index 9b6c8e0..790ad09

[PATCH] Btrfs: subpage-blocksize: btrfs_punch_hole: Fix uptodate blocks check

2016-04-17 Thread Chandan Rajendra
In case of subpage-blocksize, the file blocks to be punched may map only part of a page. For file blocks inside such pages, we need to check for the presence of BLK_STATE_UPTODATE flag. Signed-off-by: Chandan Rajendra --- fs/btrfs/file.c | 66

[PATCH] Btrfs: subpage-blocksize: Define extent_buffer_head.

2016-04-17 Thread Chandan Rajendra
t extent_buffer' to 'struct extent_buffer_head' Also, this patch moves EXTENT_BUFFER_TREE_REF, EXTENT_BUFFER_DUMMY and EXTENT_BUFFER_IN_TREE flags from extent_buffer->ebflags to extent_buffer_head->bflags. Reviewed-by: Liu Bo Signed-off-by: Chandan Rajendra --- fs/btrfs/ct

[PATCH] Btrfs: subpage-blocksize: Prevent writes to an extent buffer when PG_writeback flag is set

2016-04-17 Thread Chandan Rajendra
page. Hence this patch adds a new flag (i.e. EXTENT_BUFFER_HEAD_WRITEBACK) and corresponding code to track the writeback status of the page and to prevent writes to any of the extent buffers mapped to the page while writeback is going on. Signed-off-by: Chandan Rajendra --- fs/btrfs/ct

Re: [PATCH V17 00/18] Allow I/O on blocks whose size is less than page size

2016-04-17 Thread Chandan Rajendra
On Thursday 14 Apr 2016 19:08:09 Chandan Rajendra wrote: > Btrfs assumes block size to be the same as the machine's page > size. This would mean that a Btrfs instance created on a 4k page size > machine (e.g. x86) will not be mountable on machines with larger page > sizes (e

  1   2   3   4   5   6   7   >