On 2018年05月18日 13:23, Steve Leung wrote:
> Hi list,
>
> I've got 3-device raid1 btrfs filesystem that's throwing up some
> "corrupt leaf" errors in dmesg. This is a uniquified list I've
> observed lately:
>
> BTRFS critical (device sda1): corrupt leaf: root=1 block=4970196795392
> slot=307
On 18.05.2018 05:55, Liu Bo wrote:
> On Wed, May 16, 2018 at 3:03 PM, Nikolay Borisov wrote:
>>
>>
>> On 15.05.2018 20:52, Liu Bo wrote:
>>> The check is superfluous since all of callers who set search_for_commit
>>> also have skip_locking set.
>>
>> This is false. For
On 2018年05月18日 11:00, Liu Bo wrote:
> As unlock_up() is written as
>
> for () {
>if (!path->locks[i])
>break;
>...
>if (... && path->locks[i]) {
>}
> }
>
> Apparently, @path->locks[i] is always true at this 'if'.
>
> Signed-off-by: Liu Bo
Hi list,
I've got 3-device raid1 btrfs filesystem that's throwing up some
"corrupt leaf" errors in dmesg. This is a uniquified list I've
observed lately:
BTRFS critical (device sda1): corrupt leaf: root=1
block=4970196795392 slot=307 ino=206231 file_offset=0, invalid ram_bytes
for
On 2018年05月18日 11:00, Liu Bo wrote:
> The check is superfluous since all of callers who set search_for_commit
> also have skip_locking set.
>
> Signed-off-by: Liu Bo
Reviewed-by: Qu Wenruo
Although more obvious comment about search_commit_root and
On 2018年05月18日 11:00, Liu Bo wrote:
> If parent_transid "0" is passed to btrfs_buffer_uptodate(),
> btrfs_buffer_uptodate() is equivalent to extent_buffer_uptodate(), but
> extent_buffer_uptodate() is preferred since we don't have to look into
> verify_parent_transid().
>
> Signed-off-by: Liu
On 2018年05月18日 11:00, Liu Bo wrote:
> It's good to have a helper instead of having all get-root details
> open-coded.
>
> The new helper locks (if necessary) and sets root node of the path.
>
> Also invert the checks to make the code flow easier to read.
>
> There is no functional change in
> -Original Message-
> From: linux-btrfs-ow...@vger.kernel.org
> [mailto:linux-btrfs-ow...@vger.kernel.org] On Behalf Of Tomohiro Misono
> Sent: Friday, May 18, 2018 10:55 AM
> To: linux-btrfs@vger.kernel.org
> Subject: [PATCH v6 2/3] btrfs: Add unprivileged ioctl which returns
>
On 2018年05月18日 11:00, Liu Bo wrote:
> read_block_for_search() can be simplified as,
>
> tmp = find_extent_buffer();
> if (tmp)
>return;
>
> free_extent_buffer();
> read_tree_block();
>
> Apparently, @tmp must be NULL at this point, free_extent_buffer() is not
> needed.>
> Signed-off-by:
On 2018年05月18日 13:02, Nikolay Borisov wrote:
>
>
> On 18.05.2018 05:59, Liu Bo wrote:
>> As verify_level_key() is checked after verify_parent_transid(), i.e.
>>
>> if (verify_parent_transid())
>>ret = -EIO;
>> else if (verify_level_key())
>>ret = -EUCLEAN;
>>
>> if parent_transid is 0,
> -Original Message-
> From: linux-btrfs-ow...@vger.kernel.org
> [mailto:linux-btrfs-ow...@vger.kernel.org] On Behalf Of Tomohiro Misono
> Sent: Friday, May 18, 2018 10:55 AM
> To: linux-btrfs@vger.kernel.org
> Subject: [PATCH v6 1/3] btrfs: Add unprivileged ioctl which returns
On 2018年05月18日 10:59, Liu Bo wrote:
> As verify_level_key() is checked after verify_parent_transid(), i.e.
>
> if (verify_parent_transid())
>ret = -EIO;
> else if (verify_level_key())
>ret = -EUCLEAN;
>
> if parent_transid is 0, verify_parent_transid() skips verifying
> parent_transid
On 18.05.2018 05:59, Liu Bo wrote:
> As verify_level_key() is checked after verify_parent_transid(), i.e.
>
> if (verify_parent_transid())
>ret = -EIO;
> else if (verify_level_key())
>ret = -EUCLEAN;
>
> if parent_transid is 0, verify_parent_transid() skips verifying
> parent_transid
On 2018/05/17 6:38, je...@suse.com wrote:
> From: Jeff Mahoney
>
> The btrfs qgroup show command currently only exports qgroup IDs,
> forcing the user to resolve which subvolume each corresponds to.
>
> This patch adds pathname resolution to qgroup show so that when
> the -P
On Thu, May 17, 2018 at 10:28:26AM -0500, Eric Sandeen wrote:
> This tests the online label ioctl that btrfs has, which has been
> recently proposed for XFS.
>
> To run, it requires an updated xfs_io with the label command and a
> filesystem that supports it
>
> A slight change here to
The check is superfluous since all of callers who set search_for_commit
also have skip_locking set.
Signed-off-by: Liu Bo
---
fs/btrfs/ctree.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/fs/btrfs/ctree.c b/fs/btrfs/ctree.c
index d12fc0474e21..8d3b09038f37
If parent_transid "0" is passed to btrfs_buffer_uptodate(),
btrfs_buffer_uptodate() is equivalent to extent_buffer_uptodate(), but
extent_buffer_uptodate() is preferred since we don't have to look into
verify_parent_transid().
Signed-off-by: Liu Bo
---
fs/btrfs/ctree.c
read_block_for_search() can be simplified as,
tmp = find_extent_buffer();
if (tmp)
return;
free_extent_buffer();
read_tree_block();
Apparently, @tmp must be NULL at this point, free_extent_buffer() is not
needed.
Signed-off-by: Liu Bo
---
fs/btrfs/ctree.c | 1 -
It's good to have a helper instead of having all get-root details
open-coded.
The new helper locks (if necessary) and sets root node of the path.
Also invert the checks to make the code flow easier to read.
There is no functional change in this commit.
Signed-off-by: Liu Bo
Typically, when acquiring root node's lock, btrfs tries its best to get
read lock and trade for write lock if @write_lock_level implies to do so.
In case of (cow && (p->keep_locks || p->lowest_level)), write_lock_level
is set to BTRFS_MAX_LEVEL, which means we need to acquire root node's
write
As unlock_up() is written as
for () {
if (!path->locks[i])
break;
...
if (... && path->locks[i]) {
}
}
Apparently, @path->locks[i] is always true at this 'if'.
Signed-off-by: Liu Bo
---
fs/btrfs/ctree.c | 2 +-
1 file changed, 1 insertion(+), 1
Here are a collection of patches I did for btrfs_search_slot().
v2: more explicit commit log for each patch.
Liu Bo (6):
Btrfs: remove superfluous free_extent_buffer
Btrfs: use more straightforward extent_buffer_uptodate
Btrfs: move get root of btrfs_search_slot to a helper
Btrfs: remove
As verify_level_key() is checked after verify_parent_transid(), i.e.
if (verify_parent_transid())
ret = -EIO;
else if (verify_level_key())
ret = -EUCLEAN;
if parent_transid is 0, verify_parent_transid() skips verifying
parent_transid and considers eb as valid, and if verify_level_key()
On 2018/05/18 11:54, Tomohiro Misono wrote:
> Add new unprivileged ioctl BTRFS_IOC_GET_SUBVOL_INFO which returns
> the information of subvolume containing this inode.
> (i.e. returns the information in ROOT_ITEM and ROOT_BACKREF.)
>
> Signed-off-by: Tomohiro Misono
On Wed, May 16, 2018 at 3:03 PM, Nikolay Borisov wrote:
>
>
> On 15.05.2018 20:52, Liu Bo wrote:
>> The check is superfluous since all of callers who set search_for_commit
>> also have skip_locking set.
>
> This is false. For example btrfs_qgroup_rescan_worker sets
>
Add unprivileged version of ino_lookup ioctl BTRFS_IOC_INO_LOOKUP_USER
to allow normal users to call "btrfs subvolume list/show" etc. in
combination with BTRFS_IOC_GET_SUBVOL_INFO/BTRFS_IOC_GET_SUBVOL_ROOTREF.
This can be used like BTRFS_IOC_INO_LOOKUP but the argument is
different. This is
Add new unprivileged ioctl BTRFS_IOC_GET_SUBVOL_INFO which returns
the information of subvolume containing this inode.
(i.e. returns the information in ROOT_ITEM and ROOT_BACKREF.)
Signed-off-by: Tomohiro Misono
---
v5 -> v6
- Use brfs_read_fs_root_no_name()
changelog:
v5 -> v6
- Update 1st patch by using btrfs_fs_root_no_name()
- Return -EUCLEAN when btrfs_next_leaf/next_item() should not fail
- Add Reviewed-by tag
v4 -> v5
- Update error handling of 1st/2nd patch. See each log for details
- Fix misspelling
v3 -> v4
- call
Add unprivileged ioctl BTRFS_IOC_GET_SUBVOL_ROOTREF which
returns ROOT_REF information of the subvolume containing this inode
except the subvolume name (this is because to prevent potential name
leak). The subvolume name will be gained by user version of ino_lookup
ioctl
On Wed, May 16, 2018 at 2:43 PM, Nikolay Borisov wrote:
>
>
> On 15.05.2018 20:52, Liu Bo wrote:
>> In read_block_for_search(), it's straightforward to use
>> extent_buffer_uptodate() instead since 0 is passed as parent transid to
>
> "instead of the more heavyweight
On 2018/05/18 10:10, Qu Wenruo wrote:
>
>
> On 2018年05月18日 09:00, Misono Tomohiro wrote:
>> On 2018/05/17 15:39, Qu Wenruo wrote:
>>>
>>>
>>> On 2018年05月16日 13:49, Tomohiro Misono wrote:
Add new unprivileged ioctl BTRFS_IOC_GET_SUBVOL_INFO which returns
the information of subvolume
On 2018年05月18日 09:00, Misono Tomohiro wrote:
> On 2018/05/17 15:39, Qu Wenruo wrote:
>>
>>
>> On 2018年05月16日 13:49, Tomohiro Misono wrote:
>>> Add new unprivileged ioctl BTRFS_IOC_GET_SUBVOL_INFO which returns
>>> the information of subvolume containing this inode.
>>> (i.e. returns the
On 2018/05/17 15:39, Qu Wenruo wrote:
>
>
> On 2018年05月16日 13:49, Tomohiro Misono wrote:
>> Add new unprivileged ioctl BTRFS_IOC_GET_SUBVOL_INFO which returns
>> the information of subvolume containing this inode.
>> (i.e. returns the information in ROOT_ITEM and ROOT_BACKREF.)
>>
>>
On Thu, May 17, 2018 at 01:15:51AM -0400, Zygo Blaxell wrote:
> On Sun, May 13, 2018 at 11:26:39AM -0700, Darrick J. Wong wrote:
> > On Sun, May 13, 2018 at 06:21:52PM +, Mark Fasheh wrote:
> > > On Fri, May 11, 2018 at 05:06:34PM -0700, Darrick J. Wong wrote:
> > > > On Fri, May 11, 2018 at
On Sun, May 13, 2018 at 10:50:25PM +0200, Adam Borowski wrote:
> On Sun, May 13, 2018 at 06:16:53PM +, Mark Fasheh wrote:
> > On Sat, May 12, 2018 at 04:49:20AM +0200, Adam Borowski wrote:
> > > On Fri, May 11, 2018 at 12:26:50PM -0700, Mark Fasheh wrote:
> > > > The permission check in
On Fri, May 11, 2018 at 01:13:31PM -0700, Omar Sandoval wrote:
> From: Omar Sandoval
>
> btrfs_free_extent() can fail because of ENOMEM. There's no reason to
> panic here, we can just abort the transaction.
>
> Fixes: f4b9aa8d3b87 ("btrfs_truncate")
> Reviewed-by: Nikolay
On Thu, May 17, 2018 at 02:16:29PM +0300, Nikolay Borisov wrote:
> select_delayed_ref really just gets the next delayed ref which has to
> be processed - either an add ref or drop ref. We never go back for
> anything. So the comment is actually bogus, just remove it.
>
> Signed-off-by: Nikolay
On Thu, May 17, 2018 at 02:24:51PM +0900, Misono Tomohiro wrote:
> Deletion of a subvolume by rmdir(2) has become allowed by the
> 'commit cd2decf640b1 ("btrfs: Allow rmdir(2) to delete an empty
> subvolume")'.
>
> It is a kind of new feature and this commits add a sysfs entry
>
On 17.05.2018 18:41, David Sterba wrote:
> The dedupe range is 16 MiB, with 4 KiB pages and 8 byte pointers, the
> arrays can be 32KiB large. To avoid allocation failures due to
> fragmented memory, use the allocation with fallback to vmalloc.
>
> The arrays are allocated and freed only inside
The dedupe range is 16 MiB, with 4 KiB pages and 8 byte pointers, the
arrays can be 32KiB large. To avoid allocation failures due to
fragmented memory, use the allocation with fallback to vmalloc.
The arrays are allocated and freed only inside btrfs_extent_same and
reused for all the ranges.
On 2018-05-17 10:46, Jeff Mahoney wrote:
On 5/16/18 6:35 PM, David Sterba wrote:
On Wed, May 16, 2018 at 06:03:56PM +0800, Anand Jain wrote:
Not yet ready for the integration. As I need to introduce
-o no_read_mirror_policy instead of -o read_mirror_policy=-
Mount option is mostly likely not
This tests the online label ioctl that btrfs has, which has been
recently proposed for XFS.
To run, it requires an updated xfs_io with the label command and a
filesystem that supports it
A slight change here to _require_xfs_io_command as well, so that tests
which simply fail with "Inappropriate
On 5/17/18 8:25 AM, Austin S. Hemmelgarn wrote:
> On 2018-05-16 22:32, Anand Jain wrote:
>>
>>
>> On 05/17/2018 06:35 AM, David Sterba wrote:
>>> On Wed, May 16, 2018 at 06:03:56PM +0800, Anand Jain wrote:
Not yet ready for the integration. As I need to introduce
-o no_read_mirror_policy
On 5/16/18 6:35 PM, David Sterba wrote:
> On Wed, May 16, 2018 at 06:03:56PM +0800, Anand Jain wrote:
>> Not yet ready for the integration. As I need to introduce
>> -o no_read_mirror_policy instead of -o read_mirror_policy=-
>
> Mount option is mostly likely not the right interface for setting
Looks like the original idea was to print the hex of the flags which
is not coded with their flag name. So use the current buf pointer bp
instead of buf.
Signed-off-by: Anand Jain
---
fs/btrfs/relocation.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git
running an rsync -av --del as the only process hiting my btrfs backup
filesystem. rsync is now stuck and so is all other access to the
filesystem. Looking at ps it seems the btrfs-cleaner is running, so
maybe that deadlocked with Stack for the rsync:
[<0>]
On 2018-05-16 22:32, Anand Jain wrote:
On 05/17/2018 06:35 AM, David Sterba wrote:
On Wed, May 16, 2018 at 06:03:56PM +0800, Anand Jain wrote:
Not yet ready for the integration. As I need to introduce
-o no_read_mirror_policy instead of -o read_mirror_policy=-
Mount option is mostly likely
On Wed, May 16, 2018 at 10:51:28AM +0800, Anand Jain wrote:
> Add a kernel log when the balance ends, either for cancel or completed
> or if it is paused.
Missing S-O-B.
> ---
> v1->v2: Moved from 2/3 to 3/3
>
> fs/btrfs/volumes.c | 7 +++
> 1 file changed, 7 insertions(+)
>
> diff --git
On Wed, May 16, 2018 at 10:51:26AM +0800, Anand Jain wrote:
> Kernel logs are very important for the forensic investigations of the
> issues in general make it easy to use it. This patch adds 'balance:'
> prefix so that it can be easily searched.
>
> Signed-off-by: Anand Jain
On Wed, May 16, 2018 at 10:51:27AM +0800, Anand Jain wrote:
> Balance args info is an important information to be reviewed for the
> system audit. So this patch adds it to the kernel log.
>
> Example:
>
> -> btrfs bal start -dprofiles='raid1|single',convert=raid5
>
select_delayed_ref really just gets the next delayed ref which has to
be processed - either an add ref or drop ref. We never go back for
anything. So the comment is actually bogus, just remove it.
Signed-off-by: Nikolay Borisov
---
fs/btrfs/extent-tree.c | 4
1 file
Looks like Qu may have taken care of corrupted compressed data with
NODATASUM from causing causing random kernel memory corruption.
As long as the compressed data was valid and could be uncompressed,
there were no problems, even on data marked NOCOW/NODATASUM. If the
data being sent to be
On 2018年05月17日 16:25, Misono Tomohiro wrote:
> On 2018/05/17 15:56, Qu Wenruo wrote:
>>
>>
>> On 2018年05月16日 13:49, Tomohiro Misono wrote:
>>> [based on current misc-next]
>>>
>>> changelog:
>>> v4 -> v5
>>> - Update error handling of 1st/2nd patch. See each log for details
>>> - Fix
On 2018年05月17日 16:19, Qu Wenruo wrote:
>
>
> On 2018年05月17日 16:14, Nikolay Borisov wrote:
>>
>>
>> On 17.05.2018 09:27, Qu Wenruo wrote:
>>> James Harvey reported that some corrupted compressed extent data can
>>> lead to various kernel memory corruption.
>>>
>>> Such corrupted extent data
On 2018/05/17 15:56, Qu Wenruo wrote:
>
>
> On 2018年05月16日 13:49, Tomohiro Misono wrote:
>> [based on current misc-next]
>>
>> changelog:
>> v4 -> v5
>> - Update error handling of 1st/2nd patch. See each log for details
>> - Fix misspelling
>> v3 -> v4
>> - call btrfs_next_leaf() after
On 2018年05月17日 16:14, Nikolay Borisov wrote:
>
>
> On 17.05.2018 09:27, Qu Wenruo wrote:
>> James Harvey reported that some corrupted compressed extent data can
>> lead to various kernel memory corruption.
>>
>> Such corrupted extent data belongs to inode with NODATASUM flags, thus
>> data
On 17.05.2018 09:27, Qu Wenruo wrote:
> James Harvey reported that some corrupted compressed extent data can
> lead to various kernel memory corruption.
>
> Such corrupted extent data belongs to inode with NODATASUM flags, thus
> data csum won't help us detecting such bug.
>
> If lucky enough,
On 2018年05月17日 15:48, Nikolay Borisov wrote:
>
>
> On 17.05.2018 09:27, Qu Wenruo wrote:
>> Signed-off-by: Qu Wenruo
>
> Overall it looks good and useful just a couple of nits below.
>> ---
>> fs/btrfs/lzo.c | 23 +++
>> 1 file changed, 23 insertions(+)
>>
On 17.05.2018 09:27, Qu Wenruo wrote:
> Signed-off-by: Qu Wenruo
Overall it looks good and useful just a couple of nits below.
> ---
> fs/btrfs/lzo.c | 23 +++
> 1 file changed, 23 insertions(+)
>
> diff --git a/fs/btrfs/lzo.c b/fs/btrfs/lzo.c
> index
On 17.05.2018 09:27, Qu Wenruo wrote:
> Since compression.h is using SZ_* macros, and if some user only includes
> compression.h without linux/sizes.h, it will cause compile error.
>
> One example is lzo.c, if it uses BTRFS_MAX_COMPRESSED, it would cause
> compile error.
>
> Fix it by adding
On 05/16/2018 10:35 PM, David Sterba wrote:
On Mon, Apr 30, 2018 at 05:48:45PM +0800, Anand Jain wrote:
We set the BTRFS_BALANCE_RESUME flag in the btrfs_recover_balance(),
which is not called during the remount. So when resuming from the
paused balance we hit BUG.
kernel: kernel BUG at
We set the BTRFS_BALANCE_RESUME flag in the btrfs_recover_balance()
only, which isn't called during the remount. So when resuming from
the paused balance we hit the BUG.
kernel: kernel BUG at fs/btrfs/volumes.c:3890!
::
kernel: balance_kthread+0x51/0x60 [btrfs]
kernel: kthread+0x111/0x130
In nocow path, we check if the extent is snapshotted in
btrfs_cross_ref_exist(). We can do the similar check earlier and avoid
unnecessary search into extent tree.
A fio test on a Intel D-1531, 16GB RAM, SSD RAID-5 machine as follows:
[global]
group_reporting
time_based
thread=1
ioengine=libaio
On 2018年05月16日 13:49, Tomohiro Misono wrote:
> [based on current misc-next]
>
> changelog:
> v4 -> v5
> - Update error handling of 1st/2nd patch. See each log for details
> - Fix misspelling
> v3 -> v4
> - call btrfs_next_leaf() after btrfs_search_slot() when the slot
> position
On 2018年05月16日 13:49, Tomohiro Misono wrote:
> Add unprivileged ioctl BTRFS_IOC_GET_SUBVOL_ROOTREF which
> returns ROOT_REF information of the subvolume containing this inode
> except the subvolume name (this is because to prevent potential name
> leak). The subvolume name will be gained by user
On 2018年05月16日 13:49, Tomohiro Misono wrote:
> Add new unprivileged ioctl BTRFS_IOC_GET_SUBVOL_INFO which returns
> the information of subvolume containing this inode.
> (i.e. returns the information in ROOT_ITEM and ROOT_BACKREF.)
>
> Signed-off-by: Tomohiro Misono
Hi,
> -Original Message-
> From: linux-btrfs-ow...@vger.kernel.org
> [mailto:linux-btrfs-ow...@vger.kernel.org] On Behalf Of Tomohiro Misono
> Sent: Wednesday, May 16, 2018 1:50 PM
> To: linux-btrfs@vger.kernel.org
> Subject: [PATCH v5 2/3] btrfs: Add unprivileged ioctl which returns
>
James Harvey reported that some corrupted compressed extent data can
lead to various kernel memory corruption.
Such corrupted extent data belongs to inode with NODATASUM flags, thus
data csum won't help us detecting such bug.
If lucky enough, kasan could catch it like:
Unlike regular lzo compressed extent, inline extent doesn't have Header
and only has one Segment.
And further more, inlined extent always has csum in its leaf header,
it's less possible to have corrupted data.
Anyway, still add extra segment header length check.
Signed-off-by: Qu Wenruo
Signed-off-by: Qu Wenruo
---
fs/btrfs/lzo.c | 23 +++
1 file changed, 23 insertions(+)
diff --git a/fs/btrfs/lzo.c b/fs/btrfs/lzo.c
index 0667ea07f766..3d2ae4c08876 100644
--- a/fs/btrfs/lzo.c
+++ b/fs/btrfs/lzo.c
@@ -17,6 +17,29 @@
#define LZO_LEN4
James Harvey reported pretty strange kernel misbehavior where after
reading certain btrfs compressed data, kernel crash with unrelated
calltrace.
(https://bugzilla.kernel.org/show_bug.cgi?id=199707 and
https://www.spinics.net/lists/linux-btrfs/msg77971.html)
Thanks for his comprehensive debug
Since compression.h is using SZ_* macros, and if some user only includes
compression.h without linux/sizes.h, it will cause compile error.
One example is lzo.c, if it uses BTRFS_MAX_COMPRESSED, it would cause
compile error.
Fix it by adding linux/sizes.h in compression.h
Signed-off-by: Qu
> -Original Message-
> From: linux-btrfs-ow...@vger.kernel.org
> [mailto:linux-btrfs-ow...@vger.kernel.org] On Behalf Of Tomohiro Misono
> Sent: Wednesday, May 16, 2018 1:50 PM
> To: linux-btrfs@vger.kernel.org
> Subject: [PATCH v5 1/3] btrfs: Add unprivileged ioctl which returns
73 matches
Mail list logo