On Sat, Nov 4, 2017 at 1:25 PM, Chris Murphy wrote:
>
> On Sat, Nov 4, 2017 at 1:26 AM, Dave wrote:
> > On Mon, Oct 30, 2017 at 5:37 PM, Chris Murphy
> > wrote:
> >>
> >> That is not a general purpose file system. It's
On 2017-10-31 23:18, Tomasz Chmielewski wrote:
On 2017-09-18 17:20, Tomasz Chmielewski wrote:
# df -h /var/lib/lxd
FWIW, standard (aka util-linux) df is effectively useless in a
situation
such as this, as it really doesn't give you the information you need
(it
can say you have lots of space
Obviously (for me) yes, but who will decide? There should be --no-reflink for
people trying to defragment something.
>Seems to me any request to duplicate should be optimized by default
>with an auto reflink when possible, and require an explicit option to
>inhibit.
Key word is "any". I much
1. If the pdflush issue is fixed, we should go back to bdi congestion method,
as block layer is more appropriate and accurate to tell when the device is
congested. Device q depth 256 is very generic.
2. Consider RAID1 devices at different speed (SSD and iscsi LUN) not too sure
if this approach
On 11/06/2017 05:20 PM, Qu Wenruo wrote:
Add checker for dir item, for key types DIR_ITEM, DIR_INDEX and
XATTR_ITEM.
This checker does comprehensive check for:
1) dir_item header and its data size
Against item boundary and maximum name/xattr length.
This part is mostly the same as old
Now, files which have nocompress flag also will be defraged
with compression. However, nocompress flag is still existed
and have to be cleared manually.
So add an option '--clear-nocompress' to extend -c to drop
nocompress flag after defragement.
Suggested-by: David Sterba
In function cmd_filesystem_defrag(), lines of code for error handling
are duplicate and hard to expand in further.
Create a jump label for errors.
Signed-off-by: Su Yue
---
cmds-filesystem.c | 46 +-
1 file changed, 25
We feedback IO progress when it falls below the 2/3 times of the limit
obtained from btrfs_async_submit_limit() so to creates a wait for the
write process and make uncontested progress during the async submission.
In general device/transport q depth is 256 and, btrfs_async_submit_limit()
returns
On 2017年11月07日 04:17, Chris Murphy wrote:
> I just did scrubs on five different volumes using all three scrub
> methods. There were no errors found, so the test leaves uncertain what
> the error handling differences are between the three scrubs. But at
> the least with no errors, there are also
On 2017年11月06日 23:28, David Sterba wrote:
> On Tue, Oct 31, 2017 at 02:08:16PM +0800, Qu Wenruo wrote:
>> btrfs_create_tree() will unconditionally generate UUID for any root.
>> So for quota tree and data reloc tree created by kernel, they will have
>> unique UUIDs.
>>
>> However UUID in root
On 11/07/2017 01:02 AM, David Sterba wrote:
On Mon, Nov 06, 2017 at 04:36:16PM +0800, Anand Jain wrote:
Signed-off-by: Anand Jain
No changelog at all?
Oh. This patch is wrong. I thought I deleted this from my workspace.
Now I notice this ended up in the ML.
We
On 11/07/2017 12:52 AM, David Sterba wrote:
On Mon, Nov 06, 2017 at 04:36:14PM +0800, Anand Jain wrote:
As i_size_read() takes care of 32bit smp or preempt cases as well.
Can bdev->bd_inode->i_size change so that we need to use the
i_size_read()? My answer is 'no'.
Hm. Right I was
I'm doing copies from one subvolume to another, through a mounted top
level (id5) at /mnt/int.
This copies the whole file conventionally (no shared extents)
$ sudo cp /mnt/int/home/chris/Downloads/Fedora-Server-dvd-x86_64-27-1.6.iso
/mnt/int/root00/var/lib/libvirt/images/
This is a reflink copy
ST wrote:
Hello,
I've recently learned about btrfs and consider to utilize for my needs.
I have several questions in this regard:
I manage a dedicated server remotely and have some sort of script that
installs an OS from several images. There I can define partitions and
their FSs.
1. By
On 6.11.2017 21:30, David Sterba wrote:
> There are several functions that take a generic get_extent parameter, but not
> all of them use it to distinguish between btree_get_exnent (for metadata) and
> btrfs_get_extent (for data). This is namely extent_read_full_page and
> __do_readpage.
I
I just did scrubs on five different volumes using all three scrub
methods. There were no errors found, so the test leaves uncertain what
the error handling differences are between the three scrubs. But at
the least with no errors, there are also no disagreements between the
three methods.
1.
On Sun, Oct 29, 2017 at 1:05 PM, Chris Murphy wrote:
> On Thu, Oct 26, 2017 at 4:34 AM, Zak Kohler wrote:
>
>> I will gladly repeat this process, but I am very concerned why this
>> corruption happened in the first place.
>
> Right. So everyone who
On 2017-11-06 13:35, Chris Murphy wrote:
On Mon, Nov 6, 2017 at 6:51 AM, Austin S. Hemmelgarn
wrote:
This brings to mind another 'feature' of BTRFS that I came across recently,
namely that subvolumes that aren't explicitly mounted still show up as mount
points according
All callers pass btrfs_get_extent.
Signed-off-by: David Sterba
---
fs/btrfs/extent_io.c | 10 --
1 file changed, 4 insertions(+), 6 deletions(-)
diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/extent_io.c
index a266239716f7..72620cf41423 100644
--- a/fs/btrfs/extent_io.c
All callers pass btree_get_extent, which needs to be exported.
Signed-off-by: David Sterba
---
fs/btrfs/disk-io.c | 8
fs/btrfs/disk-io.h | 3 +++
fs/btrfs/extent_io.c | 6 +++---
fs/btrfs/extent_io.h | 2 +-
4 files changed, 11 insertions(+), 8 deletions(-)
diff
All callers pass btrfs_get_extent.
Signed-off-by: David Sterba
---
fs/btrfs/extent_io.c | 15 ---
1 file changed, 8 insertions(+), 7 deletions(-)
diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/extent_io.c
index 1140ce4d321a..a266239716f7 100644
---
There's only one caller.
Signed-off-by: David Sterba
---
fs/btrfs/extent_io.c | 5 ++---
fs/btrfs/extent_io.h | 3 +--
fs/btrfs/inode.c | 1 -
3 files changed, 3 insertions(+), 6 deletions(-)
diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/extent_io.c
index
There's only one caller.
Signed-off-by: David Sterba
---
fs/btrfs/extent_io.c | 3 +--
fs/btrfs/extent_io.h | 1 -
fs/btrfs/inode.c | 2 +-
3 files changed, 2 insertions(+), 4 deletions(-)
diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/extent_io.c
index
There's only one caller that passes btrfs_get_extent.
Signed-off-by: David Sterba
---
fs/btrfs/extent_io.c | 11 +--
fs/btrfs/extent_io.h | 3 +--
fs/btrfs/inode.c | 3 +--
3 files changed, 7 insertions(+), 10 deletions(-)
diff --git a/fs/btrfs/extent_io.c
All callers pass btrfs_get_extent_fiemap and get_extent_skip_holes
itself is used only as a fiemap helper.
Signed-off-by: David Sterba
---
fs/btrfs/extent_io.c | 13 +
1 file changed, 5 insertions(+), 8 deletions(-)
diff --git a/fs/btrfs/extent_io.c
All callers pass btrfs_get_extent_fiemap and we don't expect anything
else in the context of extent_fiemap.
Signed-off-by: David Sterba
---
fs/btrfs/extent_io.c | 6 +++---
fs/btrfs/extent_io.h | 2 +-
fs/btrfs/inode.c | 2 +-
3 files changed, 5 insertions(+), 5
Previous patches cleaned up all places where
extent_page_data::get_extent was set and it was btrfs_get_extent all the
time, so we can simply call that instead.
This also reduces size of extent_page_data by 8 bytes which has positive
effect on stack consumption on various functions on the write
There's only one caller.
Signed-off-by: David Sterba
---
fs/btrfs/extent_io.c | 3 +--
fs/btrfs/extent_io.h | 1 -
fs/btrfs/inode.c | 2 +-
3 files changed, 2 insertions(+), 4 deletions(-)
diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/extent_io.c
index
There are several functions that take a generic get_extent parameter, but not
all of them use it to distinguish between btree_get_exnent (for metadata) and
btrfs_get_extent (for data). This is namely extent_read_full_page and
__do_readpage.
The rest can be cleaned up so that the desired
On 2017-11-06 13:45, Chris Murphy wrote:
On Mon, Nov 6, 2017 at 6:29 AM, Austin S. Hemmelgarn
wrote:
With ATA devices (including SATA), except on newer SSD's, TRIM commands
can't be queued,
SATA spec 3.1 includes queued trim. There are SATA spec 3.1 products
on the
On Mon, Nov 6, 2017 at 6:29 AM, Austin S. Hemmelgarn
wrote:
>
> With ATA devices (including SATA), except on newer SSD's, TRIM commands
> can't be queued,
SATA spec 3.1 includes queued trim. There are SATA spec 3.1 products
on the market claiming to do queued trim. Some of
On Mon, Nov 6, 2017 at 6:51 AM, Austin S. Hemmelgarn
wrote:
> This brings to mind another 'feature' of BTRFS that I came across recently,
> namely that subvolumes that aren't explicitly mounted still show up as mount
> points according to how most CLI tools differentiate
The uuid_tree_rescan_sem is used as a mutex (initialized with value 1
and with at most one active user), no reason to obscure that as a
semaphore.
Signed-off-by: David Sterba
---
fs/btrfs/ctree.h | 6 +-
fs/btrfs/disk-io.c | 6 +++---
fs/btrfs/super.c | 4 ++--
The maximum size of a checksum buffer is known, BTRFS_CSUM_SIZE, and we
don't have to allocate it dynamically. This code path is not used at all
as we have only the crc32c and use an on-stack buffer already.
Signed-off-by: David Sterba
---
fs/btrfs/disk-io.c | 16
On Thu, Nov 02, 2017 at 05:21:50PM -0600, Liu Bo wrote:
> Adding __init macro gives kernel a hint that this function is only
> used during the initialization phase and its memory resources can be
> freed up after.
> Signed-off-by: Liu Bo
Reviewed-by: David Sterba
On Mon, Nov 06, 2017 at 04:36:16PM +0800, Anand Jain wrote:
> Signed-off-by: Anand Jain
No changelog at all? Sorry but I'm tired of asking you for explanations
each time. Removing a mutex is far from a trivial change.
--
To unsubscribe from this list: send the line
On Mon, Nov 06, 2017 at 04:36:15PM +0800, Anand Jain wrote:
> Function btrfs_add_device() is about adding the device item
> so rename to reflect that in the function. Similarly we have
> btrfs_rm_dev_item().
>
> Signed-off-by: Anand Jain
Reviewed-by: David Sterba
On Mon, Nov 06, 2017 at 04:36:14PM +0800, Anand Jain wrote:
> As i_size_read() takes care of 32bit smp or preempt cases as well.
Can bdev->bd_inode->i_size change so that we need to use the
i_size_read()? My answer is 'no'. You haven't provided any reasoning
why it should be otherwise.
--
To
On Mon, Nov 06, 2017 at 04:36:12PM +0800, Anand Jain wrote:
> We can push volume_mutex lock further down after the memory operation.
I'm a bit reluctant to apply any patches that cleanup volume_mutex as
it's going to be removed.
--
To unsubscribe from this list: send the line "unsubscribe
On Wed, Nov 01, 2017 at 06:54:02PM -0600, Liu Bo wrote:
> Here we have defined two flags,
> - Fautly
> - In_sync
>
> Currently only In_sync is in use, it only matters when device serves
> as part of a raid profile. The flag In_sync is decided when mounting
> a btrfs and opening a device, by
On Tue, Oct 31, 2017 at 06:56:12PM +, fdman...@kernel.org wrote:
> From: Filipe Manana
>
> The patch from commit 7e3b975a0f92 ("Btrfs: fix reported number of inode
The commit id should be a7e3b975a0f9, looks like a typo, missing 'a' at
the beginning.
> blocks")
On Tue, Oct 31, 2017 at 06:55:40PM +, fdman...@kernel.org wrote:
> From: Filipe Manana
>
> During a buffered IO write, we can have an extent state that we got when
> we locked the range (if the range starts at an offset lower than eof), so
> always pass it to
On 6.11.2017 11:20, Qu Wenruo wrote:
> Since tree-checker has verified leaf when reading from disk, we don't
> need the existing verify_dir_item() or btrfs_is_name_len_valid().
>
> Signed-off-by: Qu Wenruo
Reviewed-by: Nikolay Borisov
> ---
> Unlike checks
On 6.11.2017 11:20, Qu Wenruo wrote:
> Add checker for dir item, for key types DIR_ITEM, DIR_INDEX and
> XATTR_ITEM.
>
> This checker does comprehensive check for:
> 1) dir_item header and its data size
>Against item boundary and maximum name/xattr length.
>This part is mostly the same
On Thu, Nov 02, 2017 at 02:03:53PM +0800, Anand Jain wrote:
> We feedback IO progress when it falls below 2/3 times of the limit
> obtained from btrfs_async_submit_limit(), and creates a wait for the
> write process and makes progress during the async submission.
>
> In general device/transport q
On Thu, Nov 02, 2017 at 02:03:53PM +0800, Anand Jain wrote:
> We feedback IO progress when it falls below 2/3 times of the limit
> obtained from btrfs_async_submit_limit(), and creates a wait for the
> write process and makes progress during the async submission.
>
> In general device/transport q
On Tue, Oct 31, 2017 at 02:08:16PM +0800, Qu Wenruo wrote:
> btrfs_create_tree() will unconditionally generate UUID for any root.
> So for quota tree and data reloc tree created by kernel, they will have
> unique UUIDs.
>
> However UUID in root item is only referred by UUID tree, which only
>
On Mon, Nov 06, 2017 at 10:28:00AM +0800, Anand Jain wrote:
> A cleanup patch no functional change, we hold volume_mutex before
> calling btrfs_rm_device, so move it into the function itself.
>
> Signed-off-by: Anand Jain
> ---
> David, This patch is based on your
On Mon, Nov 06, 2017 at 05:02:21PM +0200, Nikolay Borisov wrote:
> Right, I did a fresh read and indeed the structure now makes sense. I
> have completely missed the nesting though. Maybe you can nest more
> agressively, now every sentence is aligned to the header, perhaps we
> want to have it one
>> @@ -3682,7 +3678,7 @@ static int __btrfs_balance(struct btrfs_fs_info
>> *fs_info)
>> counting = false;
>> goto again;
>> }
>> -error:
>> +free_path:
>> btrfs_free_path(path);
>> if (enospc_errors) {
>> btrfs_info(fs_info, "%d enospc errors
On 6.11.2017 15:51, David Sterba wrote:
> On Thu, Nov 02, 2017 at 12:29:17PM +0200, Nikolay Borisov wrote:
>> On 31.10.2017 19:44, David Sterba wrote:
>>> Overview of the main locks protecting various device-related structures.
>>>
>>> Signed-off-by: David Sterba
>>> ---
>>>
On Sun, Nov 05, 2017 at 10:49:57PM -0800, Benjamin Peterson wrote:
> Signed-off-by: Benjamin Peterson
Applied, thanks.
--
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
On Mon, Nov 06, 2017 at 09:04:37AM +0100, SF Markus Elfring wrote:
>
> * Adjust jump targets so that a call of the function "mutex_unlock"
> can be better reused for error cases at the end of this function.
>
> * Replace three calls by goto statements.
>
> This issue was detected by using the
On Thu, Nov 02, 2017 at 11:49:15AM +0200, Nikolay Borisov wrote:
>
>
> On 31.10.2017 19:44, David Sterba wrote:
> > We take the fs_devices::device_list_mutex mutex in write_all_supers
> > which will prevent any add/del changes to the device list. Therefore we
> > don't need to use the RCU
On Thu, Nov 02, 2017 at 12:29:17PM +0200, Nikolay Borisov wrote:
> On 31.10.2017 19:44, David Sterba wrote:
> > Overview of the main locks protecting various device-related structures.
> >
> > Signed-off-by: David Sterba
> > ---
> > fs/btrfs/volumes.c | 66
> >
On 2017-11-05 03:01, Andrei Borzenkov wrote:
04.11.2017 21:55, Chris Murphy пишет:
On Sat, Nov 4, 2017 at 12:27 PM, Andrei Borzenkov wrote:
04.11.2017 10:05, Adam Borowski пишет:
On Sat, Nov 04, 2017 at 09:26:36AM +0300, Andrei Borzenkov wrote:
04.11.2017 07:49, Adam
On Mon, Nov 06, 2017 at 10:32:48AM +0800, Anand Jain wrote:
> >> + * Lock nesting
> >> + *
> >> + *
> >> + * uuid_mutex
> >> + * volume_mutex
>
> I think it should be nested like this, but as of now its not. Ref [1]
> [1]
> btrfs: move volume_mutex into the btrfs_rm_device()
On Fri, Nov 03, 2017 at 07:13:01PM +0800, Anand Jain wrote:
>
>
> Thanks for writing this.
>
> > + * - fs_devices::device_list_mutex (per-fs, with RCU)
> > + *
> > + * protects updates to fs_devices::devices, ie. adding and deleting
> > + *
> > + * simple list traversal with read-only
On 2017-11-04 13:14, Chris Murphy wrote:
On Fri, Nov 3, 2017 at 10:46 PM, Adam Borowski wrote:
On Fri, Nov 03, 2017 at 04:03:44PM -0600, Chris Murphy wrote:
On Tue, Oct 31, 2017 at 5:28 AM, Austin S. Hemmelgarn
wrote:
If you're running on an SSD
On Thu, Nov 02, 2017 at 11:41:44AM +0200, Nikolay Borisov wrote:
>
>
> On 31.10.2017 19:44, David Sterba wrote:
> > This fixes potential bio leaks, in several error paths. Unfortunatelly
> > the device structure freeing is opencoded in many places and I missed
> > them when introducing the
On 6.11.2017 04:28, Anand Jain wrote:
> A cleanup patch no functional change, we hold volume_mutex before
> calling btrfs_rm_device, so move it into the function itself.
>
> Signed-off-by: Anand Jain
Reviewed-by: Nikolay Borisov
> ---
> David, This
On Mon, Nov 06, 2017 at 10:43:18AM +0800, Qu Wenruo wrote:
>[BUG]
>Kernel panic when mounting with "-o compress" mount option.
>KASAN will report like:
>--
>==
>BUG: KASAN: wild-memory-access in strncmp+0x31/0xc0
>Read of size 1
Hello,
i updated our server from kernel 4.7.4 to 4.13.11 .
We have two connected btrfs devcies:
a) a connected hardware raid5 in the machine (/dev/sdb1)
b) a IBM Storewize v3700 connected via iSCSI
(/dev/mapper/36005076300808b95c803-part1)
After restarting the server, the samba
Since tree-checker has verified leaf when reading from disk, we don't
need the existing verify_dir_item() or btrfs_is_name_len_valid().
Signed-off-by: Qu Wenruo
---
Unlike checks in btrfs_mark_buffer_dirty(), the existing checks all
happen in read routine, so there is no need to
This patchset fix a false panic introduced by tree-checker,
and then introduce dir_item checker, along with cleanups to remove
existing checkers sparsed in dir-item.
The 1st patch is a fix to address kernel panic with sanity test in btrfs.
The cause is there are several callers which call
[BUG]
If we run btrfs with CONFIG_BTRFS_FS_RUN_SANITY_TESTS=y, it will
instantly cause kernel panic like:
--
...
assertion failed: 0, file: fs/btrfs/disk-io.c, line: 3853
...
Call Trace:
btrfs_mark_buffer_dirty+0x187/0x1f0 [btrfs]
setup_items_for_insert+0x385/0x650 [btrfs]
Add checker for dir item, for key types DIR_ITEM, DIR_INDEX and
XATTR_ITEM.
This checker does comprehensive check for:
1) dir_item header and its data size
Against item boundary and maximum name/xattr length.
This part is mostly the same as old verify_dir_item().
2) dir_type
Against
We can push volume_mutex lock further down after the memory operation.
Signed-off-by: Anand Jain
---
fs/btrfs/ioctl.c | 23 ---
1 file changed, 12 insertions(+), 11 deletions(-)
diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c
index
Do string check for the device's new size before volume_mutex is held.
Signed-off-by: Anand Jain
---
fs/btrfs/ioctl.c | 37 +++--
1 file changed, 19 insertions(+), 18 deletions(-)
diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c
index
As i_size_read() takes care of 32bit smp or preempt cases as well.
Signed-off-by: Anand Jain
---
fs/btrfs/ioctl.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c
index b0465020972a..86e7f5abd740 100644
---
Function btrfs_add_device() is about adding the device item
so rename to reflect that in the function. Similarly we have
btrfs_rm_dev_item().
Signed-off-by: Anand Jain
---
fs/btrfs/volumes.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git
By moving the volume_mutex into btrfs_init_new_device() it will be
much closer to the items to be protected.
Signed-off-by: Anand Jain
---
fs/btrfs/ioctl.c | 2 --
fs/btrfs/volumes.c | 10 +-
2 files changed, 9 insertions(+), 3 deletions(-)
diff --git
No functional changes this patch renames btrfs_init_new_device()
to btrfs_add_device(), so that it matches to the btrfs_rm_device()
naming. And further it will help to further cleanup device init part
from btrfs_add_device() and btrfs_init_dev_replace().
Signed-off-by: Anand Jain
Signed-off-by: Anand Jain
---
fs/btrfs/volumes.c | 4
1 file changed, 4 deletions(-)
diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c
index 2329f429ce40..3d5ed4518f20 100644
--- a/fs/btrfs/volumes.c
+++ b/fs/btrfs/volumes.c
@@ -1914,7 +1914,6 @@ int
A miscellaneous device management related cleanup patches. The core
objective of this and upcoming patches is to able to have a clear
clarity on mutex usages and remove redundant codes. And few good
to have fixes.
Anand Jain (7):
btrfs: optimize use of volume_mutex in btrfs_ioctl_resize()
From: Markus Elfring
Date: Sun, 5 Nov 2017 22:03:22 +0100
* Adjust jump targets so that a call of the function "mutex_unlock"
can be better reused for error cases at the end of this function.
* Replace three calls by goto statements.
This issue was detected by
76 matches
Mail list logo