:15e80697-2ffb-0b4b-8e1e-e0873a7cf944
...
Snapshot(s):
/mnt/snap2
Signed-off-by: Misono Tomohiro
Signed-off-by: David Sterba
---
Documentation/btrfs-subvolume.asciidoc | 11 ++-
cmds-subvolume.c | 107 ++---
2 files
Sandoval
Signed-off-by: Misono Tomohiro
Signed-off-by: David Sterba
---
cmds-subvolume.c | 963 +--
1 file changed, 936 insertions(+), 27 deletions(-)
diff --git a/cmds-subvolume.c b/cmds-subvolume.c
index a8395aac..84a03fd8 100644
--- a/cmds-subvolume.c
Signed-off-by: Misono Tomohiro
Signed-off-by: David Sterba
---
tests/cli-tests/009-subvolume-list/test.sh | 130 +
1 file changed, 130 insertions(+)
create mode 100755 tests/cli-tests/009-subvolume-list/test.sh
diff --git a/tests/cli-tests/009-subvolume-list/test.sh
b
Add helper function to check that if user 'nobody' exists or not.
Note that 'nobody' should not have root privileges as it will be used
to test the behavior of non-privileged user.
Signed-off-by: Misono Tomohiro
Signed-off-by: David Sterba
---
tests/common | 10 ++
1 file changed, 10
AAA/BBB
ID 258 gen 10 top level 5 path ZZZ
** output of progs <= 4.19
$ btrfs subvolume list -a /mnt
ID 256 gen 9 top level 5 path AAA
ID 257 gen 9 top level 256 path /AAA/BBB
ID 258 gen 10 top level 5 path ZZZ
Signed-off-by: Misono Tomohiro
Signed-off-by: David Sterba
---
Documen
Signed-off-by: Misono Tomohiro
Signed-off-by: David Sterba
---
utils.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/utils.c b/utils.c
index 3a4bc92a..8ce8417d 100644
--- a/utils.c
+++ b/utils.c
@@ -2054,6 +2054,9 @@ int find_mount_root(const char *path, char **mount_root)
to top-level subvolume)
Also, snapshots to be shown are to which the user can access from current
mount point.
(for root, all snapshots in the fs)
===
[1]
https://lore.kernel.org/linux-btrfs/cover.1529310485.git.misono.tomoh...@jp.fujitsu.com/
[2] https://lore
ogs <= 4.19
$ mount -o subvol=AAA $DEV /mnt
$ btrfs subvolume list /mnt
ID 256 gen 11 top level 5 path AAA
ID 257 gen 8 top level 256 path BBB
ID 258 gen 8 top level 257 path BBB/dir/CCC
ID 259 gen 11 top level 256 path ZZZ
Signed-off-by: Misono Tomohiro
Signed-off-by: David Sterba
No functional changes.
This is a preparation work for reworking "subvolume list".
Signed-off-by: Misono Tomohiro
Signed-off-by: David Sterba
---
cmds-subvolume.c | 50 +---
1 file changed, 30 insertions(+), 20 deletions(-)
diff --
On 2018/08/30 2:24, Axel Burri wrote:
> Create separate binaries for each subcommand ("btrfs foo bar").
> Least invasive approach, generate c-files for each command:
>
> # ./splitcmd-gen.sh
> # make V=1 btrfs-subvolume-show
> # make V=1 btrfs-send
> # [...]
>
> Alternative
move 'ret2'.
Signed-off-by: Misono Tomohiro
---
fs/btrfs/extent-tree.c | 12 ++--
1 file changed, 2 insertions(+), 10 deletions(-)
diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c
index 2d9074295d7f..0c87472d5719 100644
--- a/fs/btrfs/extent-tree.c
+++ b/fs/btrfs/extent-tree.c
On 2018/08/28 14:21, Qu Wenruo wrote:
> On 2018/8/24 下午4:09, Misono Tomohiro wrote:
> [snip]
>>>
>>> BTW, what's the possibility of such problem in your test environment?
>>
>> It's like one in several times.
>> It may depend on hardware performance?
On 2018/08/24 16:58, Qu Wenruo wrote:
>
>
> On 2018/8/24 下午3:54, Misono Tomohiro wrote:
>> On 2018/08/24 16:20, Qu Wenruo wrote:
>>>
>>>
>>> On 2018/8/24 下午3:14, Misono Tomohiro wrote:
>>>> Hi,
>>>>
>>>> On 2018/0
On 2018/08/24 16:20, Qu Wenruo wrote:
>
>
> On 2018/8/24 下午3:14, Misono Tomohiro wrote:
>> Hi,
>>
>> On 2018/08/21 14:40, Qu Wenruo wrote:
>>> Commit c6887cd11149 ("Btrfs: don't do nocow check unless we have to")
>>> makes nocow chec
Hi,
On 2018/08/21 14:40, Qu Wenruo wrote:
> Commit c6887cd11149 ("Btrfs: don't do nocow check unless we have to")
> makes nocow check less frequent to improve performance.
>
> However for quota enabled case, such optimization could lead to extra
> unnecessary data reservation, which results
en message is not printed), leading suspicious RCU usage warning
when CONFIG_PROVE_RCU is on.
Fix this by adding a wrapper to call lock/unlock for non debug case too.
Fixes: 672d599041c8 ("btrfs: Use wrapper macro for rcu string to remove
duplicate code")
Reported-by: David Howells
S
generated.
>
> Note that the mount succeeds.
>
> This code was introduced by:
>
> commit 672d599041c862dd61a1576c32e946ef0d77aa34
> Author: Misono Tomohiro
> Date: Thu Aug 2 16:19:07 2018 +0900
>
Thanks for the reporting.
I didn't turn
On 2018/08/12 10:33, Qu Wenruo wrote:
> Provide an offline tool to disable quota.
>
> For kernel which skip_balance doesn't work, there is no way to disable
> quota on huge fs with balance, as quota will cause balance to hang for a
> long long time for each tree block switch.
>
> So add an
On 2018/08/16 3:12, David Sterba wrote:
> Hi,
>
> so I've merged the first bath to devel. There was quite some whitespace
> damage and style issues, but I fixed that as I went through the pathes.
Thanks for taking this.
>
> I've left out all patches that introduce new options, this is the hard
On 2018/08/15 15:13, Qu Wenruo wrote:
> Commit c6887cd11149 ("Btrfs: don't do nocow check unless we have to")
> makes nocow check less frequent to improve performance.
>
> However for quota enabled case, such optimization could lead to extra
> unnecessary data reservation, which results failure
On 2018/08/03 22:46, David Sterba wrote:
> On Wed, Jul 04, 2018 at 05:14:59PM +0900, Misono Tomohiro wrote:
>> Gentle ping, as this is related to the new ioctls merged in 4.18-rc1.
>
> Due to me spending more time than expected on kernel, this patchset will
> be merged par
each that qgroup.
>
> This will cause QGROUP_INFO items of orphan qgroups never get updated in
> quota tree, thus their numbers will stay the same in "btrfs qgroup show"
> output.
>
> [FIX]
> Just mark all qgroups dirty in qgroup_rescan_zero_tracking(), so even
omatically when subvolume is deleted
(to be precise, when the subvolume root is dropped).
Signed-off-by: Misono Tomohiro
---
v4 -> v5:
Commit current transaction before calling btrfs_remove_qgroup() to
keep qgroup consistency in all case. This resolves the concern in
v4 path and
On 2018/08/09 15:14, Qu Wenruo wrote:
>
>
> On 8/9/18 2:05 PM, Misono Tomohiro wrote:
>> On 2018/08/09 14:47, Qu Wenruo wrote:
>>>
>>>
>>> On 8/9/18 12:12 PM, Misono Tomohiro wrote:
>>>> When qgroup is on, subvolume deletion does not remove
On 2018/08/09 14:47, Qu Wenruo wrote:
>
>
> On 8/9/18 12:12 PM, Misono Tomohiro wrote:
>> When qgroup is on, subvolume deletion does not remove qgroup items
>> of the subvolume (qgroup info, limit, relation) from quota tree and
>> they need to get removed manual
uo
Signed-off-by: Misono Tomohiro
---
Hi David,
It turned out that this patch may cause qgroup inconsistency in case
described above and need manual rescan. Since current code will keep
qgroup items but not break qgroup consistency when deleting subvolume,
I cannot clearly say which behavior
and removing first
relation causes inconsistency, remaining items will not be removed.
Fix this by continuing to remove items if return value of
__del_qgroup_relation() is 1.
Signed-off-by: Misono Tomohiro
---
fs/btrfs/qgroup.c | 15 ---
1 file changed, 12 insertions(+), 3 deletions(-)
diff
ing -i option), 1/0 - 2/0, 1/1 - 2/0.
>
> So to make it simple, if snapshot src has higher level qgroups, just
> mark qgroup inconsistent and let later rescan to do its job.
>
> Reported-by: Misono Tomohiro
> Signed-off-by: Qu Wenruo
> ---
> fs/btrfs/qgroup.c | 16
On 2018/08/08 1:23, Lu Fengqi wrote:
> On Mon, Aug 06, 2018 at 01:53:28PM +0900, Misono Tomohiro wrote:
>> When qgroup is on, subvolume deletion does not remove qgroup items
>> of the subvolume (qgroup info, limit, relation) from quota tree and
>> they need to get removed manu
On 2018/08/06 15:17, Qu Wenruo wrote:
>
>
> On 2018年08月06日 13:25, Misono Tomohiro wrote:
>> There are two members in struct btrfs_root which indicate root's
>> objectid: ->objectid and ->root_key.objectid.
>>
>> They are both set to the same value in __setu
e
'objecitd' member and unify code to use ->root_key.objectid in all places.
Signed-off-by: Misono Tomohiro
---
Although being fundamentally independent, this is based on the
patch: https://patchwork.kernel.org/patch/10556485/
since it also touches root->objectid.
fs/btrfs/backref
omatically when subvolume is deleted
(to be precise, when the subvolume root is dropped).
Reviewed-by: Lu Fengqi
Reviewed-by: Qu Wenruo
Signed-off-by: Misono Tomohiro
---
v2 -> v3:
Use root->root_key.objectid instead of root->objectid
Add Reviewed-by tag
v1 -> v2:
Move call
On 2018/08/04 0:06, David Sterba wrote:
> On Wed, Jul 25, 2018 at 05:20:17PM +0900, Misono Tomohiro wrote:
>> Since BTRFS_IOC_INO_PATHS requires fd of subvolume,
>
> Does it? AFAICS btrfs_ioctl_ino_to_path gets root that's the containing
> subvolume of the path given by the us
On 2018/08/03 18:16, Lu Fengqi wrote:
> On Fri, Aug 03, 2018 at 11:39:28AM +0300, Nikolay Borisov wrote:
>>
>>
>> On 3.08.2018 11:37, Misono Tomohiro wrote:
>>> On 2018/08/03 16:15, Lu Fengqi wrote:
>>>> On Fri, Aug 03, 2018 at 03:21:12PM +0900
On 2018/08/03 16:15, Lu Fengqi wrote:
> On Fri, Aug 03, 2018 at 03:21:12PM +0900, Misono Tomohiro wrote:
>> When qgroup is on, subvolume deletion does not remove qgroup item
>> of the subvolume (qgroup info, limits, relation) from quota tree and
>> they needs to get remov
ut we plan to change the
behavior and remove them along with subvolume deletion.
So update the test and keep subvolume (and qgroup item) in any kernel
version.
Signed-off-by: Misono Tomohiro
---
tests/btrfs/057 | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/tests/btrfs/057 b/t
emove them automatically when subvolume is deleted
(to be precise, when the subvolume root is dropped).
Signed-off-by: Misono Tomohiro
---
Note that btrfs/057 fails, but it is the problem of testcase.
I will update it too.
v1 -> v2:
Move call of btrfs_remove_qgroup() from btrfs_del
On 2018/08/03 13:23, Lu Fengqi wrote:
> On Fri, Aug 03, 2018 at 12:17:26PM +0800, Qu Wenruo wrote:
>>
>>
>> On 2018年08月03日 12:08, Misono Tomohiro wrote:
>>> When qgroup is on, subvolume deletion does not remove qgroup items
>>> of the subvolume (qgroup
emove them automatically when subvolume is deleted.
Signed-off-by: Misono Tomohiro
---
I don't see any reason to keep these items after subvolume deletion,
but is there something I'm missing?
fs/btrfs/inode.c | 4
1 file changed, 4 insertions(+)
diff --git a/fs/btrfs/inode.c b/fs/btrfs/ino
Cleanup patch and no functional changes.
Signed-off-by: Misono Tomohiro
---
fs/btrfs/ioctl.c | 6 ++
fs/btrfs/scrub.c | 8 ++--
fs/btrfs/super.c | 9 +++--
fs/btrfs/volumes.c | 21 ++---
4 files changed, 13 insertions(+), 31 deletions(-)
diff --git a/fs
ay return old device's value after umount/mount
(Example: See "btrfs ins dump-t -t DEV $DEV" after btrfs/100 finish).
Fix this by just increment dev_stats_ccnt in
btrfs_dev_replace_finishing() when replace is succeeded.
Signed-off-by: Misono Tomohiro
---
fs/btrfs/dev-replace.c | 6 ++
This is useful.
Reviewed-by: Misono Tomohiro
On 2018/07/17 15:15, Qu Wenruo wrote:
> For developer, it's pretty common to use "btrfs check" or "btrfs ins
> dump-tree" on raw dumps.
>
> However "btrfs check" can only complete real block devices, and
>
On 2018/06/08 21:47, Nikolay Borisov wrote:
> This commit pulls those portions of the kernel implementation of
> delayed refs which are necessary to have them working in user-space.
> I've done the following modifications:
>
> 1. Replaced all kmem_cache_alloc calls to kmalloc.
>
> 2. Removed all
On 2018/06/08 21:47, Nikolay Borisov wrote:
> This commit enables the delayed refs infrastructures. This entails doing
> the following:
>
> 1. Replacing existing calls of btrfs_extent_post_op (which is the
> equivalent of delayed refs) with the proper btrfs_run_delayed_refs.
> As well as
On 2018/07/27 15:09, Qu Wenruo wrote:
>
>
> On 2018年07月27日 09:43, Misono Tomohiro wrote:
>> On 2018/07/27 10:19, Qu Wenruo wrote:
>>>
>>>
>>> On 2018年07月27日 09:10, Misono Tomohiro wrote:
>>>> On 2018/07/26 18:15, Qu Wenruo wrote:
>>
On 2018/07/27 10:19, Qu Wenruo wrote:
>
>
> On 2018年07月27日 09:10, Misono Tomohiro wrote:
>> On 2018/07/26 18:15, Qu Wenruo wrote:
>>> Between btrfs_quota_enable() finished and rescan kicked in, there is a
>>> small window that quota status has (ON | INCONSISTENT
trfs_quota_enable(),
> so even after power loss we will still kick in rescan automatically.
>
> Suggested-by: Misono Tomohiro
> Signed-off-by: Qu Wenruo
> ---
> fs/btrfs/qgroup.c | 5 +++--
> 1 file changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/fs/btrfs/
On 2018/07/26 15:59, Qu Wenruo wrote:
> Under certain case, btrfs/166 could cause power loss just after quota
> tree initialized but rescan not kicked in.
>
> In this case, since flags of qgroup status item is just ON |
> INCONSISTENT, without RESCAN flag, rescan won't be kicked in in next
>
There is no user of this function.
This is forgotten to get removed in commit a575ceeb1338
("Btrfs: get rid of unused orphan infrastructure").
Signed-off-by: Misono Tomohiro
---
fs/btrfs/ctree.h | 1 -
fs/btrfs/extent-tree.c | 5 -
2 files changed, 6 deletions(-)
diff
Use ERR_CAST() instead of void * to make meaning clear.
Signed-off-by: Misono Tomohiro
---
fs/btrfs/backref.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/fs/btrfs/backref.c b/fs/btrfs/backref.c
index 7ce0b5f9e99e..9f231bbccb1e 100644
--- a/fs/btrfs/backref.c
+++ b/fs
info and not ref
- snapshot aware defrag (through iterate_extent_inodes_from_logical())
- currently dead code and not used
Signed-off-by: Misono Tomohiro
---
fs/btrfs/backref.c | 10 --
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/fs/btrfs/backref.c b/fs/btrfs/backref.
Reset ret value to zero after snprintf(), which returns the number
of written chars. Otherwise non-zero value returns after command
success with -P option. Also set return value from __ino_to_path_fd() to
reflect the final status for default behavior.
Signed-off-by: Misono Tomohiro
---
cmds
Since BTRFS_IOC_INO_PATHS requires fd of subvolume, logical-resolve
cannot find the path when mount point is not FS_TREE
(because the subvolume path cannot be opened).
In that case, print message to try -P option instead.
Signed-off-by: Misono Tomohiro
---
cmds-inspect.c | 34
root 5
// v2 ioctl returns all refs pointing at least one block of given extent
$ btrfs inspect-internal logical-resolve -P --ignore-offset \
$((3392*4096)) /mnt
inode 257 offset 0 root 5
inode 257 offset 45056 root 5
Signed-off-by: Misono Tomohiro
---
v1 -> v2
- add explnation
- add bui
Patch 1 and 2 fix some issues in logical-resolve.
Patch 3 is a main part and adds v2 support of BTRFS_IOC_LOGICA_INO_V2
Misono Tomohiro (3):
btrfs-progs: ins: logical-resolve: Set correct error value
btrfs-progs: ins: logical-resolve: Print message when path cannot be
resolved
btrfs
Signed-off-by: Misono Tomohiro
---
Documentation/btrfs-inspect-internal.asciidoc | 4
cmds-inspect.c| 17 +++--
ioctl.h | 10 +-
libbtrfsutil/btrfs.h | 10 +-
4 files changed
On 2018/07/05 4:20, Stéphane Lesimple wrote:
> We reuse the task_position enum and task_ctx struct of the original progress
> indicator, adding more values and fields for our needs.
>
> Then add hooks in all steps of the check to properly record progress.
>
> Signed-off-by: Stéphane Lesimple
>
Gentle ping, as this is related to the new ioctls merged in 4.18-rc1.
On 2018/06/18 17:40, Misono Tomohiro wrote:
> Changelog
>
> v1 -> v2:
> generally update whole patch set, especially:
>- rebased to progs 4.17
>- Improve error handling
>- Update
Update the information to reflect the status of 4.18
Main Updates:
- Add explanation of improved compression heuristic algorithm
- Add explanation that norecovery == nologreplay
- Add explanation of nossd_spread mount option
- Add explanation of rmdir_subovl feature
Signed-off-by: Misono
trfs_quota_enable")
> Link: https://marc.info/?l=linux-btrfs=152999289017582
> Reported-by: Misono Tomohiro
> Reviewed-by: Misono Tomohiro
> Signed-off-by: Nikolay Borisov
> ---
> fs/btrfs/ioctl.c | 15 ++-
> fs/btrfs/qgroup.c | 38 +++
> Misono,
>
> Can you please try the attached patch?
>
I tried and it works (on 4.18.0-rc3).
Committing transaction before starting rescan worker is
what btrfs_qgroup_resan() does, so it looks fine.
(though I'm not sure why you don't see the problem in your machine.)
Reviewe
On 2018/06/28 16:12, Qu Wenruo wrote:
>
>
> On 2018年06月27日 16:25, Misono Tomohiro wrote:
>> On 2018/06/27 17:10, Qu Wenruo wrote:
>>>
>>>
>>> On 2018年06月26日 14:00, Misono Tomohiro wrote:
>>>> Hello Nikolay,
>>>>
>>>>
to keep
> the original behavior.
>
> Reported-by: Misono Tomohiro
> Fixes: ff3d27a048d9 ("btrfs: qgroup: Finish rescan when hit the last leaf of
> extent tree")
> Signed-off-by: Qu Wenruo
> ---
> changelog:
> v2:
> Commit message update, as the bug only
On 2018/06/27 17:22, Nikolay Borisov wrote:
>
>
> On 27.06.2018 11:20, Misono Tomohiro wrote:
>> I can see the failure with or without options...
>> maybe it depends on machine spec?
>
> I'm testing in a virtual machine:
>
> qemu-system-x86_64 -smp 6 -kernel
On 2018/06/27 17:10, Qu Wenruo wrote:
>
>
> On 2018年06月26日 14:00, Misono Tomohiro wrote:
>> Hello Nikolay,
>>
>> I noticed that commit 5d23515be669 ("btrfs: Move qgroup rescan
>> on quota enable to btrfs_quota_enable") in 4.17 sometimes causes
>&
On 2018/06/27 17:04, Nikolay Borisov wrote:
>
>
> On 27.06.2018 10:55, Misono Tomohiro wrote:
>> On 2018/06/27 16:40, Nikolay Borisov wrote:
>>>
>>>
>>> On 26.06.2018 09:00, Misono Tomohiro wrote:
>>>> Hello Nikolay,
>>>>
&
On 2018/06/27 16:40, Nikolay Borisov wrote:
>
>
> On 26.06.2018 09:00, Misono Tomohiro wrote:
>> Hello Nikolay,
>>
>> I noticed that commit 5d23515be669 ("btrfs: Move qgroup rescan
>> on quota enable to btrfs_quota_enable") in 4.17 sometimes causes
disk.
>
> This patch aims to fix this by movign the transaction creation/commit
> inside btrfs_quota_enable, which allows to schedule the quota commit
> after the transaction has been committed.
>
> Fixes: 5d23515be669 ("btrfs: Move qgroup rescan on quota enable to
> b
Hello Nikolay,
I noticed that commit 5d23515be669 ("btrfs: Move qgroup rescan
on quota enable to btrfs_quota_enable") in 4.17 sometimes causes
to fail correctly rescanning quota when quota is enabled.
Simple reproducer:
$ mkfs.btrfs -f $DEV
$ mount $DEV /mnt
$ dd if=/dev/urandom of=/mnt/file
On 2018/06/26 1:20, David Sterba wrote:
> On Mon, Jun 25, 2018 at 01:58:58PM +0900, Misono Tomohiro wrote:
>> So, this is the updated version of
>> https://patchwork.kernel.org/patch/10063039/
>>
>> This time xfstest is ok and
>> Reviewed-by: Misono
So, this is the updated version of https://patchwork.kernel.org/patch/10063039/
This time xfstest is ok and
Reviewed-by: Misono Tomohiro
On 2018/06/18 2:39, Goldwyn Rodrigues wrote:
> From: Goldwyn Rodrigues
>
> struct kiocb carries the ki_pos, so there is no need to pass it as
>
Factor out main logic of btrfs_util_subvolume_info_fd().
This is a preparation work to relax the root privilege of this function.
No functional change happens.
Signed-off-by: Misono Tomohiro
---
libbtrfsutil/subvolume.c | 45 ++---
1 file changed, 26
-A /mnt
ID 256 gen 6 top level 5 path /mnt/AAA
Signed-off-by: Misono Tomohiro
---
Documentation/btrfs-subvolume.asciidoc | 2 +
cmds-subvolume.c | 73 +-
2 files changed, 66 insertions(+), 9 deletions(-)
diff --git a/Documentation/btrfs
behavior of "sub show"
18th-20th patch are cli-test for "sub list" of new behavior.
* Future todo:
If this approach is ok, I'd like to update the output of "sub list" more like:
- Remove obsolete field (i.e. top-level) from output
Any comments are welcome.
This commit relaxes the privileges of util_subvolume_info() if kernel
supports new ioctl (BTRFS_IOC_GET_SUBVOL_INFO) and @id is zero
(i.e. when getting the information of the given path/fd).
For older kernel (< 4.18), the behavior is the same.
Signed-off-by: Misono Tomohiro
---
libbtrfsu
ing memory.
Signed-off-by: Misono Tomohiro
---
Documentation/btrfs-subvolume.asciidoc | 5 ++
cmds-subvolume.c | 140 ++---
2 files changed, 100 insertions(+), 45 deletions(-)
diff --git a/Documentation/btrfs-subvolume.asciidoc
b/Documenta
Factor out the main logic of btrfs_util_subvolume_iterator_next().
This is a preparation work to relax the root privilege of this function.
No functional change happens.
Signed-off-by: Misono Tomohiro
---
libbtrfsutil/subvolume.c | 13 ++---
1 file changed, 10 insertions(+), 3
AAA/BBB
ID 258 gen 10 top level 5 path ZZZ
** output of progs <= 4.17
$ btrfs subvolume list -a /mnt
ID 256 gen 9 top level 5 path AAA
ID 257 gen 9 top level 256 path /AAA/BBB
ID 258 gen 10 top level 5 path ZZZ
Signed-off-by: Misono Tomohiro
---
Documentation/btrfs-subvolume.asciido
t in "parent ID/UUID"
- Fix indent/misspelling
- Add missing comma
Signed-off-by: Misono Tomohiro
---
Documentation/btrfs-subvolume.asciidoc | 77 --
1 file changed, 55 insertions(+), 22 deletions(-)
diff --git a/Documentation/btrfs-subvolume.a
Copy and add 3 definitions of new unprivileged ioctl
(BTRFS_IOC_GET_SUBVOL_INFO, BTRFS_IOC_GET_SUBVOL_ROOTREF and
BTRFS_IOC_INO_LOOKUP_USER) from kernel. They will be used to implement
the user version of "btrfs subvolume list/show" etc.
Signed-off-by: Misono Tomohiro
--
/mnt
ID 256 gen 9 top level 5 path .
ID 258 gen 7 top level 5 path bbb
ID 259 gen 8 top level 5 path ccc
Note that this option lists top-level subvolume if it is mounted in the
way.
Signed-off-by: Misono Tomohiro
---
Documentation/btrfs-subvolume.asciidoc | 4 ++
cmds-subvolume.c
Explicitly states that -d requires root privileges.
Also, update some option handling with regard to -d option.
Signed-off-by: Misono Tomohiro
---
Documentation/btrfs-subvolume.asciidoc | 3 ++-
cmds-subvolume.c | 8
2 files changed, 10 insertions(+), 1 deletion
ume
by INO_LOOKUP_USER (may happen if a dir in the path is being mounted)
- it cannot be opened due to permission error
Note that this commit also allows root user to specify non-subvolume
direcotry when @top is zero. Only in that case, root's code path is
the same as user.
Signed-off-by: Misono Tomoh
Sandoval
Signed-off-by: Misono Tomohiro
---
cmds-subvolume.c | 963 +--
1 file changed, 936 insertions(+), 27 deletions(-)
diff --git a/cmds-subvolume.c b/cmds-subvolume.c
index 45363a5a..c54a8003 100644
--- a/cmds-subvolume.c
+++ b/cmds
:15e80697-2ffb-0b4b-8e1e-e0873a7cf944
...
Snapshot(s):
/mnt/snap2
Signed-off-by: Misono Tomohiro
---
Documentation/btrfs-subvolume.asciidoc | 11 +++-
cmds-subvolume.c | 107 +
2 files changed, 105 insertions
vel 256 path ZZZ
Signed-off-by: Misono Tomohiro
---
Documentation/btrfs-subvolume.asciidoc | 8 +-
cmds-subvolume.c | 144 +
2 files changed, 119 insertions(+), 33 deletions(-)
diff --git a/Documentation/btrfs-subvolume.asciidoc
b/Doc
Currently "sub list -o" lists only child subvolumes of the specified
path. So, update help message and variable name more appropriately.
Signed-off-by: Misono Tomohiro
---
Documentation/btrfs-subvolume.asciidoc | 2 +-
cmds-subvolume.c | 10 +-
2 files
Test user 'progs-test' will be used to test the behavior of normal user.
In order to pass this check, add the user by "useradd -M progs-test".
Note that progs-test should not have root privileges.
Signed-off-by: Misono Tomohiro
---
tests/common | 10 ++
1 file changed, 10
Signed-off-by: Misono Tomohiro
---
tests/cli-tests/010-subvolume-list-follow/test.sh | 86 +++
1 file changed, 86 insertions(+)
create mode 100755 tests/cli-tests/010-subvolume-list-follow/test.sh
diff --git a/tests/cli-tests/010-subvolume-list-follow/test.sh
b/tests/cli
Signed-off-by: Misono Tomohiro
---
tests/cli-tests/009-subvolume-list/test.sh | 134 +
1 file changed, 134 insertions(+)
create mode 100755 tests/cli-tests/009-subvolume-list/test.sh
diff --git a/tests/cli-tests/009-subvolume-list/test.sh
b/tests/cli-tests/009
Signed-off-by: Misono Tomohiro
---
utils.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/utils.c b/utils.c
index 21de09d3..1a4366e8 100644
--- a/utils.c
+++ b/utils.c
@@ -2048,6 +2048,9 @@ int find_mount_root(const char *path, char **mount_root)
char *longest_match = NULL;
No functional changes.
This is a preparation work for reworking "subvolume list".
Signed-off-by: Misono Tomohiro
---
cmds-subvolume.c | 50 ++
1 file changed, 30 insertions(+), 20 deletions(-)
diff --git a/cmds-subvolume.c b/cmds-s
ipped if kernel does not support the feature,
which can be checked whether /sys/fs/btrfs/features/rmdir_subvol
exists or not.
Reviewed-by: David Sterba
Signed-off-by: Misono Tomohiro
---
changelog:
v2 -> v3 - Skip test if kernel does not support the feature by
checking sysfs
On 2018/06/07 21:22, David Sterba wrote:
> On Thu, Jun 07, 2018 at 11:49:58AM +0900, Misono Tomohiro wrote:
>> Initialize all filed of btrfs_inode_item to zero in order to prevent
>> having some garbage, especially for flags field.
>
> Have you observed in practice or is it a
Initialize all filed of btrfs_inode_item to zero in order to prevent
having some garbage, especially for flags field.
Signed-off-by: Misono Tomohiro
---
check/mode-common.c | 6 +-
1 file changed, 1 insertion(+), 5 deletions(-)
diff --git a/check/mode-common.c b/check/mode-common.c
index
On 2018/05/15 10:33, Su Yue wrote:
> Define new macro I_ERR_ODD_INODE_FLAGS to represents odd inode flags.
>
> Symlinks should never have append/immutable flags.
> While processing inodes, if found a symlink with append/immutable
> flags, mark the inode record with I_ERR_ODD_INODE_FLAGS.
>
>
Signed-off-by: Misono Tomohiro
---
Hi david,
It seems that v8 patch I sent last week is missed and commit in misc-next
tree is also a bit updated from v7, so I resend the fix as a separate patch.
Please fold this patch to current misc-next (head is the commit to be fixed:
"btrfs
Thanks again.
David, could you apply this on top of my v7 patch in for-next tree?
Regards,
Tomohiro Misono
On 2018/05/31 15:21, Dan Carpenter wrote:
> memdup_user() returns error pointers, it doesn't return NULL.
>
> Fixes: 01141b08dee5 ("btrfs: Add unprivileged ioctl which returns subvolume's
subvolume is also searched and filled.
Note that the maximum length of path is shorter 256 (BTRFS_VOL_NAME_MAX+1)
bytes than ino_lookup ioctl because of space of subvolume's name.
Reviewed-by: Gu Jinxiang
Reviewed-by: Qu Wenruo
Tested-by: Gu Jinxiang
Signed-off-by: Misono Tomohiro
---
Thanks for the reporting.
I will update the patch.
Regards,
Tomohiro Misono
On 2018/05/30 19:19, Dan Carpenter wrote:
> Hello Tomohiro Misono,
>
> The patch 56bfce6502b7: "btrfs: Add unprivileged version of
> ino_lookup ioctl" from May 16, 2018, leads to the following static
> checker warning:
1 - 100 of 358 matches
Mail list logo