On Tue, Nov 27, 2018 at 02:24:41PM +0900, Misono Tomohiro wrote:
> Hello,
>
> This is basically the resend of
> "[PATCH v2 00/20] btrfs-progs: Rework of "subvolume list/show" and relax the
> root privileges of them" [1]
> which I submitted in June. The aim of this series is to allow
From: Omar Sandoval
I apparently didn't test this on a pre-4.18 kernel.
test_subvolume_info_unprivileged() checks for an ENOTTY, but this
doesn't seem to work correctly with subTest().
test_subvolume_iterator_unprivileged() doesn't have a check at all. Add
an explicit check to both before doing
On Tue, Nov 27, 2018 at 08:53:59PM +0100, David Sterba wrote:
> The first auto-assigned value to enum is 0, we can use that and not
> initialize all members where the auto-increment does the same. This is
> used for values that are not part of on-disk format.
Reviewed-by: Omar Sandoval
On Tue, Nov 27, 2018 at 08:53:57PM +0100, David Sterba wrote:
> We can use simple enum for values that are not part of on-disk format:
> ordered extent flags.
Reviewed-by: Omar Sandoval
> Signed-off-by: David Sterba
> ---
> fs/btrfs/orde
On Tue, Nov 27, 2018 at 08:53:55PM +0100, David Sterba wrote:
> We can use simple enum for values that are not part of on-disk format:
> tree lock types.
>
> Signed-off-by: David Sterba
> ---
> fs/btrfs/locking.h | 10 ++
> 1 file changed, 6 insertions(+), 4 deletions(-)
>
> diff --git
On Tue, Nov 27, 2018 at 08:53:52PM +0100, David Sterba wrote:
> We can use simple enum for values that are not part of on-disk format:
> extent map flags.
Reviewed-by: Omar Sandoval
> Signed-off-by: David Sterba
> ---
> fs/btrfs/extent_map.h | 21 ++---
>
On Tue, Nov 27, 2018 at 08:53:50PM +0100, David Sterba wrote:
> We can use simple enum for values that are not part of on-disk format:
> extent buffer flags;
This one has a "swtich" typo in the subject. Otherwise,
Reviewed-by: Omar Sandoval
> Signed-off-by: David Sterba
On Tue, Nov 27, 2018 at 08:53:48PM +0100, David Sterba wrote:
> We can use simple enum for values that are not part of on-disk format:
> root tree flags.
Reviewed-by: Omar Sandoval
> Signed-off-by: David Sterba
> ---
> fs/btrfs/ctree.h | 33 +
&g
On Tue, Nov 27, 2018 at 08:53:45PM +0100, David Sterba wrote:
> We can use simple enum for values that are not part of on-disk format:
> internal filesystem states.
Hah, looks like we never had a bit 0 ;)
Reviewed-by: Omar Sandoval
> Signed-off-by: David Sterba
> ---
> fs/btr
On Tue, Nov 27, 2018 at 08:53:43PM +0100, David Sterba wrote:
> We can use simple enum for values that are not part of on-disk format:
> block reserve types.
Reviewed-by: Omar Sandoval
> Signed-off-by: David Sterba
> ---
> fs/btrfs/ctree.h | 19 ---
>
On Tue, Nov 27, 2018 at 08:53:41PM +0100, David Sterba wrote:
> We can use simple enum for values that are not part of on-disk format:
> global filesystem states.
Reviewed-by: Omar Sandoval
Some typos/wording suggestions below.
> Signed-off-by: David Sterba
> ---
> fs/btr
On Mon, Nov 26, 2018 at 05:18:12PM +0100, David Sterba wrote:
> On Tue, Nov 13, 2018 at 11:46:55PM -0800, Omar Sandoval wrote:
> > From: Omar Sandoval
> >
> > Hi,
> >
> > This series contains my backlog of libbtrfsutil changes which I've been
>
110 MB/s2.6 MB
> > 15 3.036 MB/s110 MB/s2.6 MB
> >
> > [0] http://sun.aei.polsl.pl/~sdeor/index.php?page=silesia
> >
> > Signed-off-by: Jennifer Liu
> > Signed-off-by: Nick Terrell
> > Reviewed-by: Omar Sandoval
>
2 2.9513 MB/s113 MB/s1.8 MB
> > >> 13 2.9510 MB/s111 MB/s2.3 MB
> > >> 14 2.997 MB/s110 MB/s2.6 MB
> > >> 15 3.036 MB/s110 MB/s2.6 MB
> > >>
t; Remove 'tree' as well to silence the warning when -Wunused-but-set-variable
> is used to compile btrfs.
Reviewed-by: Omar Sandoval
> Signed-off-by: Johannes Thumshirn
> ---
> fs/btrfs/compression.c | 2 --
> 1 file changed, 2 deletions(-)
>
> diff --git a/fs/btrfs/compressio
t; Remove 'tree' as well to silence the warning when -Wunused-but-set-variable is
> used to compile btrfs.
The subject says bio_readpage_error() but this is
end_extent_writepage(). Otherwise,
Reviewed-by: Omar Sandoval
> Signed-off-by: Johannes Thumshirn
> ---
> fs/btrfs/extent_io.c |
t feature bits with
> sysfs files).
>
> But commit e410e34fad91 (Revert "btrfs: synchronize incompat feature bits with
> sysfs files") reverted 14e46e04958d so btrfs_sysfs_feature_update() ended up
> as an unused function.
Reviewed-by: Omar Sandoval
> Signed-off-by:
(btrfs: switch to discard_new_inode())
> discard_new_inode() is called when err is set and inode is non NULL. Therefore
> drop_on_err is not used anymore and thus causes a warning when building with
> -Wunused-but-set-variable.
Reviewed-by: Omar Sandoval
> Signed-off-by: Johannes Thumshirn
From: Omar Sandoval
With the previous few fixes and features, we should bump the minor
version.
Signed-off-by: Omar Sandoval
---
libbtrfsutil/btrfsutil.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/libbtrfsutil/btrfsutil.h b/libbtrfsutil/btrfsutil.h
index d88c39e5
From: Omar Sandoval
btrfsutil.h and the Python docstrings are thorough, but I've gotten a
couple of requests for a high-level overview of the available interfaces
and example usages. Add them to README.md.
Signed-off-by: Omar Sandoval
---
libbtrfsutil/README.md | 422
From: Omar Sandoval
Attempt to use the BTRFS_IOC_GET_SUBVOL_INFO ioctl (added in kernel
4.18) for subvolume_info() if not root. Also, rename
get_subvolume_info_root() -> get_subvolume_info_privileged() for
consistency with further changes.
This is based on a patch from Misono Tomohiro.
Sig
From: Omar Sandoval
We can use the new BTRFS_IOC_GET_SUBVOL_ROOTREF and
BTRFS_IOC_INO_LOOKUP_USER ioctls to allow non-root users to list
subvolumes.
This is based on a patch from Misono Tomohiro but takes a different
approach (mainly, this approach is more similar to the existing tree
search
From: Omar Sandoval
Some upcoming tests will need to create a second Btrfs filesystem, so
add support for this to the test helpers.
Signed-off-by: Omar Sandoval
---
libbtrfsutil/python/tests/__init__.py | 35 +--
1 file changed, 22 insertions(+), 13 deletions(-)
diff
From: Omar Sandoval
This has been supported since day one, but it wasn't documented.
Signed-off-by: Omar Sandoval
---
libbtrfsutil/python/module.c | 13 +
1 file changed, 9 insertions(+), 4 deletions(-)
diff --git a/libbtrfsutil/python/module.c b/libbtrfsutil/python/module.c
From: Omar Sandoval
These will be used for testing some upcoming changes which allow
unprivileged operations.
Signed-off-by: Omar Sandoval
---
libbtrfsutil/python/tests/__init__.py | 31 ++-
1 file changed, 30 insertions(+), 1 deletion(-)
diff --git a/libbtrfsutil
From: Omar Sandoval
Right now, we're defaulting to top=5 (i.e, all subvolumes). The
documented default is top=0 (i.e, only beneath the given path). This is
the expected behavior. Fix it and make the test cases cover it.
Reported-by: Jonathan Lemon
Signed-off-by: Omar Sandoval
From: Omar Sandoval
Hi,
This series contains my backlog of libbtrfsutil changes which I've been
collecting over the past few weeks.
Patches 1-4 are fixes. Patches 5-6 add functionality to the unit tests
which is needed for patches 7-8. Patches 7-8 add support for the
unprivileged ioctls added
From: Omar Sandoval
async became a keyword in Python 3.7, so, e.g., create_subvolume('foo',
async=True) is now a syntax error. Fix it with the Python convention of
adding a trailing underscore to the keyword (async -> async_). This is
what several other Python libraries did to han
From: Omar Sandoval
We're leaking file descriptors, which makes it impossible to clean up
the temporary mount point created by the test.
Signed-off-by: Omar Sandoval
---
libbtrfsutil/python/tests/test_subvolume.py | 51 -
1 file changed, 30 insertions(+), 21 deletions
gt;> On Thu, Sep 27, 2018 at 11:17:32AM -0700, Omar Sandoval wrote:
> > >>> From: Omar Sandoval
> > >>> This series implements swap file support for Btrfs.
> > >>>
> > >>> Changes from v8 [1]:
> > >>>
> > >>>
On Wed, Nov 07, 2018 at 05:01:19PM +0100, David Sterba wrote:
> On Wed, Oct 31, 2018 at 10:06:08AM -0700, Omar Sandoval wrote:
> > From: Omar Sandoval
> >
> > There's a race between close_ctree() and cleaner_kthread().
> > close_ctree() sets btrfs_fs_closing(),
From: Omar Sandoval
Swap files currently need to exist on exactly one device in exactly one
place.
Signed-off-by: Omar Sandoval
---
tests/btrfs/175 | 73 +
tests/btrfs/175.out | 8 +
tests/btrfs/group | 1 +
3 files changed, 82
From: Omar Sandoval
Btrfs forbids some operations which should not be done on a swap file.
Signed-off-by: Omar Sandoval
---
tests/btrfs/174 | 66 +
tests/btrfs/174.out | 10 +++
tests/btrfs/group | 1 +
3 files changed, 77 insertions
From: Omar Sandoval
Make sure that we don't remove or replace a device with an active swap
file but can add, remove, and replace other devices.
Signed-off-by: Omar Sandoval
---
tests/btrfs/176 | 82 +
tests/btrfs/176.out | 5 +++
tests/btrfs
From: Omar Sandoval
This series fixes a couple of generic swapfile tests and adds some
Btrfs-specific swapfile tests. Btrfs swapfile support is scheduled for
4.21 [1].
1: https://www.spinics.net/lists/linux-btrfs/msg83454.html
Thanks!
Omar Sandoval (7):
generic/{472,496,497}: fix $seeqres
From: Omar Sandoval
Make sure we don't shrink the device past an active swap file, but allow
shrinking otherwise, as well as growing and balance.
Signed-off-by: Omar Sandoval
---
tests/btrfs/177 | 64 +
tests/btrfs/177.out | 6 +
tests
From: Omar Sandoval
Signed-off-by: Omar Sandoval
---
tests/generic/472 | 2 +-
tests/generic/496 | 2 +-
tests/generic/497 | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/tests/generic/472 b/tests/generic/472
index c74d6c70..04ed3e73 100755
--- a/tests/generic/472
+++ b
From: Omar Sandoval
The swap file must be set nocow before it is written to, otherwise it is
ignored and Btrfs refuses to activate it as swap.
Fixes: 25ce9740065e ("generic: test swapfile creation, activation, and
deactivation")
Signed-off-by: Omar Sandoval
---
tests/generi
From: Omar Sandoval
Swap files on Btrfs have some restrictions not applicable to other
filesystems.
Signed-off-by: Omar Sandoval
---
tests/btrfs/173 | 55 +
tests/btrfs/173.out | 5 +
tests/btrfs/group | 1 +
3 files changed, 61
On Thu, Nov 01, 2018 at 04:29:48PM +0100, David Sterba wrote:
> On Thu, Nov 01, 2018 at 08:24:25AM -0700, Omar Sandoval wrote:
> > On Thu, Nov 01, 2018 at 04:22:29PM +0100, David Sterba wrote:
> > > On Thu, Nov 01, 2018 at 04:08:32PM +0100, David Sterba wrote:
> > > >
On Thu, Nov 01, 2018 at 08:24:25AM -0700, Omar Sandoval wrote:
> On Thu, Nov 01, 2018 at 04:22:29PM +0100, David Sterba wrote:
> > On Thu, Nov 01, 2018 at 04:08:32PM +0100, David Sterba wrote:
> > > On Thu, Nov 01, 2018 at 01:31:18PM +, Chris Mason wrote:
> > > >
n Wed, Oct 31, 2018 at 10:06:08AM -0700, Omar Sandoval wrote:
> > > >> From: Omar Sandoval
> > > >>
> > > >> There's a race between close_ctree() and cleaner_kthread().
> > > >> close_ctree() sets btrfs_fs_closing(), and the c
On Thu, Nov 01, 2018 at 04:08:32PM +0100, David Sterba wrote:
> On Thu, Nov 01, 2018 at 01:31:18PM +, Chris Mason wrote:
> > On 1 Nov 2018, at 6:15, David Sterba wrote:
> >
> > > On Wed, Oct 31, 2018 at 10:06:08AM -0700, Omar Sandoval wrote:
> > >> From:
From: Omar Sandoval
There's a race between close_ctree() and cleaner_kthread().
close_ctree() sets btrfs_fs_closing(), and the cleaner stops when it
sees it set, but this is racy; the cleaner might have already checked
the bit and could be cleaning stuff. In particular, if it deletes unused
On Wed, Oct 31, 2018 at 06:40:29PM +0200, Nikolay Borisov wrote:
>
>
> On 31.10.18 г. 18:35 ч., Omar Sandoval wrote:
> > On Wed, Oct 31, 2018 at 10:43:02AM +0200, Nikolay Borisov wrote:
> >>
> >>
> >> On 31.10.18 г. 2:14 ч., Omar Sandoval wrote:
>
On Wed, Oct 31, 2018 at 03:41:47PM +0800, Lu Fengqi wrote:
> On Tue, Oct 30, 2018 at 05:14:42PM -0700, Omar Sandoval wrote:
> >From: Omar Sandoval
> >
> >There's a race between close_ctree() and cleaner_kthread().
> >close_ctree() sets btrfs_fs_closing(), and the cl
On Wed, Oct 31, 2018 at 10:43:02AM +0200, Nikolay Borisov wrote:
>
>
> On 31.10.18 г. 2:14 ч., Omar Sandoval wrote:
> > From: Omar Sandoval
> >
> > There's a race between close_ctree() and cleaner_kthread().
> > close_ctree() sets btrfs_fs_closing(), and t
From: Omar Sandoval
There's a race between close_ctree() and cleaner_kthread().
close_ctree() sets btrfs_fs_closing(), and the cleaner stops when it
sees it set, but this is racy; the cleaner might have already checked
the bit and could be cleaning stuff. In particular, if it deletes unused
6 MB
> 153.036 MB/s 110 MB/s 2.6 MB
>
> [0] http://sun.aei.polsl.pl/~sdeor/index.php?page=silesia
Reviewed-by: Omar Sandoval
> Signed-off-by: Jennifer Liu
> Signed-off-by: Nick Terrell
> ---
> fs/btrfs/compression.c | 172 +-
On Fri, Oct 19, 2018 at 05:43:18PM +0200, David Sterba wrote:
> On Thu, Sep 27, 2018 at 11:17:32AM -0700, Omar Sandoval wrote:
> > From: Omar Sandoval
> > This series implements swap file support for Btrfs.
> >
> > Changes from v8 [1]:
> >
> > - Fixed a b
On Mon, Oct 01, 2018 at 05:46:21PM +0300, Nikolay Borisov wrote:
> Similarly to the fix in e444c7bfa65f ("btrfs-progs: check: Fix wrong
> error message in case of corrupted extent") this commits addresses the
> same problem but for corrupted bitmap objects.
Oops.
Reviewe
t; functions. And then introducing a wrapper function to contains the
> existing check_space_cache and the newly introduced repair code.
> Finally, it's important to note that FST repair code first clears the
> existing FST in case of any problem found and rebuilds it from scratch.
Revie
On Mon, Oct 01, 2018 at 05:46:18PM +0300, Nikolay Borisov wrote:
> The RO_FREE_SPACE_TREE(_VALID) flags are required in order to be able
> to open an FST filesystem in repair mode. Add them to
> BTRFS_FEATURE_COMPAT_RO_SUPP.
>
> Signed-off-by: Nikolay Borisov
> ---
> ctree.h | 4 +++-
> 1 file
On Mon, Oct 01, 2018 at 05:46:16PM +0300, Nikolay Borisov wrote:
> To help implement free space tree checker in user space some kernel
> function are necessary, namely iterating/deleting/adding freespace
> items, some internal search functions. Functions to populate a block
> group based on the
n machine.
> This is in preparation for adding free space tree conversion support.
I had to check, but it looks like these are also pulled from the kernel
source, so
Reviewed-by: Omar Sandoval
> Signed-off-by: Nikolay Borisov
> ---
> kernel-lib/bitops.h | 82
> ++
s.
Reviewed-by: Omar Sandoval
> Signed-off-by: Nikolay Borisov
> ---
> kernel-lib/bitops.h | 142
> +---
> 1 file changed, 46 insertions(+), 96 deletions(-)
>
> diff --git a/kernel-lib/bitops.h b/kernel-lib/bitops.h
> ind
tions. Since in userspace we don't have to deal with page mappings
> their implementation is vastly simplified by simply setting each bit in
> the passed range.
Reviewed-by: Omar Sandoval
> Signed-off-by: Nikolay Borisov
>
On Mon, Oct 01, 2018 at 05:46:12PM +0300, Nikolay Borisov wrote:
> For completeness sake add code to btrfs_read_fs_root so that it can
> handle the freespace tree.
Reviewed-by: Omar Sandoval
> Signed-off-by: Nikolay Borisov
> ---
> disk-io.c | 3 +++
> 1 file cha
On Wed, Sep 26, 2018 at 09:34:27AM +0300, Nikolay Borisov wrote:
>
>
> On 26.09.2018 07:07, Anand Jain wrote:
> >
> >
> > On 09/25/2018 06:51 PM, Nikolay Borisov wrote:
> >>
> >>
> >> On 25.09.2018 07:24, Anand Jain wrote:
> >>> As of now _scratch_mkfs_sized() checks if the requested size is
On Wed, Sep 26, 2018 at 04:35:45PM +0800, zhong jiang wrote:
> Trival cleanup, list_move_tail will implement the same function that
> list_del() + list_add_tail() will do. hence just replace them.
>
> Signed-off-by: zhong jiang
> ---
> fs/btrfs/send.c | 3 +--
> 1 file changed, 1 insertion(+),
From: Omar Sandoval
Btrfs has not allowed swap files since commit 35054394c4b3 ("Btrfs: stop
providing a bmap operation to avoid swapfile corruptions"). However, now
that the proper restrictions are in place, Btrfs can support swap files
through the swap file a_ops, similar to iomap
From: Omar Sandoval
The Btrfs swap code is going to need it, so give it a btrfs_ prefix and
make it non-static.
Reviewed-by: Nikolay Borisov
Signed-off-by: Omar Sandoval
---
fs/btrfs/volumes.c | 29 ++---
fs/btrfs/volumes.h | 2 ++
2 files changed, 20 insertions
From: Omar Sandoval
A later patch will implement swap file support for Btrfs, but before we
do that, we need to make sure that the various Btrfs ioctls cannot
change a swap file.
When a swap file is active, we must make sure that the extents of the
file are not moved and that they don't become
From: Omar Sandoval
Hi,
This series implements swap file support for Btrfs.
Changes from v8 [1]:
- Fixed a bug in btrfs_swap_activate() which would cause us to miss some
file extents if they were merged into one extent map entry.
- Fixed build for !CONFIG_SWAP.
- Changed all error messages
From: Omar Sandoval
Btrfs currently does not support swap files because swap's use of bmap
does not work with copy-on-write and multiple devices. See commit
35054394c4b3 ("Btrfs: stop providing a bmap operation to avoid swapfile
corruptions"). However, the swap code has a
From: Omar Sandoval
The SWP_FILE flag serves two purposes: to make swap_{read,write}page()
go through the filesystem, and to make swapoff() call
->swap_deactivate(). For Btrfs, we want the latter but not the former,
so split this flag into two. This makes us always call
->swap_deac
From: Omar Sandoval
The documentation for these functions is wrong in several ways:
- swap_activate() is called with the inode locked
- swap_activate() takes a swap_info_struct * and a sector_t *
- swap_activate() can also return a positive number of extents it added
itself
- swap_deactivate
From: Omar Sandoval
The only aops we define for symlinks are identical to the aops for
regular files. This has been the case since symlink support was added in
commit 2b8d99a723a3 ("Btrfs: symlinks and hard links"). As far as I can
tell, there wasn't a good reason to have sep
On Fri, Jun 15, 2018 at 02:06:01PM +0300, Nikolay Borisov wrote:
> Now that all the prerequisite code for proper support of free space
> tree repair is in, it's time to wire it in. This is achieved by first
> hooking the freespace tree to the __free_extent/alloc_reserved_tree_block
> functions.
On Fri, Jun 15, 2018 at 02:06:00PM +0300, Nikolay Borisov wrote:
> The RO_FREE_SPACE_TREE(_VALID) flags are required in order to be able
> to open an FST filesystem in repair mode. Add them to
> BTRFS_FEATURE_COMPAT_RO_SUPP.
>
> Signed-off-by: Nikolay Borisov
> ---
> ctree.h | 4 +++-
> 1 file
On Fri, Jun 15, 2018 at 02:05:59PM +0300, Nikolay Borisov wrote:
> To help implement free space tree checker in user space some kernel
> function are necessary, namely iterating/deleting/adding freespace
> items, some internal search functions. Functions to populate a block
> group based on the
On Fri, Jun 15, 2018 at 02:05:57PM +0300, Nikolay Borisov wrote:
> For completeness sake add code to btrfs_read_fs_root so that it can
> handle the freespace tree.
Reviewed-by: Omar Sandoval
> Signed-off-by: Nikolay Borisov
> ---
> disk-io.c | 3 +++
> 1 file cha
On Fri, Sep 21, 2018 at 05:17:35PM +0200, David Sterba wrote:
> On Thu, Sep 20, 2018 at 10:41:24AM -0700, Omar Sandoval wrote:
> > On Thu, Sep 20, 2018 at 07:22:55PM +0200, David Sterba wrote:
> > > On Wed, Sep 19, 2018 at 10:02:11PM -0700, Omar Sandoval wrote:
> >
On Thu, Sep 20, 2018 at 07:22:55PM +0200, David Sterba wrote:
> On Wed, Sep 19, 2018 at 10:02:11PM -0700, Omar Sandoval wrote:
> > From: Omar Sandoval
> > Changes from v7 [1]:
> >
> > - Expanded a few commit messages
> > - Added Johannes' acked-by on patches 1
On Thu, Sep 20, 2018 at 07:15:41PM +0200, David Sterba wrote:
> On Wed, Sep 19, 2018 at 10:02:17PM -0700, Omar Sandoval wrote:
> > From: Omar Sandoval
> >
> > Btrfs has not allowed swap files since commit 35054394c4b3 ("Btrfs: stop
> > providing a bmap operati
From: Omar Sandoval
The Btrfs swap code is going to need it, so give it a btrfs_ prefix and
make it non-static.
Reviewed-by: Nikolay Borisov
Signed-off-by: Omar Sandoval
---
fs/btrfs/volumes.c | 29 ++---
fs/btrfs/volumes.h | 2 ++
2 files changed, 20 insertions
From: Omar Sandoval
Hi,
This series implements swap file support for Btrfs.
Changes from v7 [1]:
- Expanded a few commit messages
- Added Johannes' acked-by on patches 1 and 2
- Rebased on v4.19-rc4
No functional changes.
Thanks!
1: https://www.spinics.net/lists/linux-btrfs/msg81933.html
From: Omar Sandoval
A later patch will implement swap file support for Btrfs, but before we
do that, we need to make sure that the various Btrfs ioctls cannot
change a swap file.
When a swap file is active, we must make sure that the extents of the
file are not moved and that they don't become
From: Omar Sandoval
Btrfs has not allowed swap files since commit 35054394c4b3 ("Btrfs: stop
providing a bmap operation to avoid swapfile corruptions"). However, now
that the proper restrictions are in place, Btrfs can support swap files
through the swap file a_ops, similar to iomap
From: Omar Sandoval
The SWP_FILE flag serves two purposes: to make swap_{read,write}page()
go through the filesystem, and to make swapoff() call
->swap_deactivate(). For Btrfs, we want the latter but not the former,
so split this flag into two. This makes us always call
->swap_deac
From: Omar Sandoval
Btrfs currently does not support swap files because swap's use of bmap
does not work with copy-on-write and multiple devices. See commit
35054394c4b3 ("Btrfs: stop providing a bmap operation to avoid swapfile
corruptions"). However, the swap code has a
From: Omar Sandoval
The documentation for these functions is wrong in several ways:
- swap_activate() is called with the inode locked
- swap_activate() takes a swap_info_struct * and a sector_t *
- swap_activate() can also return a positive number of extents it added
itself
- swap_deactivate
On Wed, Sep 19, 2018 at 02:09:09PM -0400, Johannes Weiner wrote:
> On Tue, Sep 11, 2018 at 03:34:45PM -0700, Omar Sandoval wrote:
> > From: Omar Sandoval
> >
> > Btrfs will need this for swap file support.
> >
> > Signed-off-by: Omar Sandoval
>
> That l
On Wed, Sep 19, 2018 at 02:02:32PM -0400, Johannes Weiner wrote:
> On Tue, Sep 11, 2018 at 03:34:44PM -0700, Omar Sandoval wrote:
> > @@ -2411,8 +2412,10 @@ static int setup_swap_extents(struct
> > swap_info_struct *sis, sector_t *span)
> >
> > if (ma
On Tue, Sep 11, 2018 at 03:34:43PM -0700, Omar Sandoval wrote:
> From: Omar Sandoval
>
> Hi,
>
> This series implements swap file support for Btrfs.
>
> Changes from v6 [1]:
>
> - Moved btrfs_get_chunk_map() comment to function body
> - Added more comments a
On Tue, Sep 11, 2018 at 01:58:03PM -0400, Josef Bacik wrote:
> We keep track of dirty bg's as a reservation in the delayed_refs_rsv, so
> when we abort and we cleanup those dirty bgs we need to drop their
> reservation so we don't have accounting issues and lots of scary
> messages on umount.
l
> clear the reserved extent reservation, resulting in a negative
> accounting of the reserved bytes for the block group and space info.
> Fix this by only doing the free if we didn't successfully insert a file
> extent for this extent.
Reviewed-by: Omar Sandoval
> Signed-off-by: Josef
On Tue, Sep 11, 2018 at 01:57:48PM -0400, Josef Bacik wrote:
> With severe fragmentation we can end up with our inode rsv size being
> huge during writeout, which would cause us to need to make very large
> metadata reservations. However we may not actually need that much once
> writeout is
reasons, run the delayed iputs so that any potential space is free'd up.
> If there is and we freed enough we can then commit the transaction and
> potentially be able to make our reservation.
Reviewed-by: Omar Sandoval
> Signed-off-by: Josef Bacik
> ---
> fs/btrfs/extent-tree.c | 9
On Tue, Sep 11, 2018 at 01:57:45PM -0400, Josef Bacik wrote:
> If we use up our block group before allocating a new one we'll easily
> get a max_extent_size that's set really really low, which will result in
> a lot of fragmentation. We need to make sure we're resetting the
> max_extent_size when
er use, drop it an add a public wrapper for the helper needed by
> tests.
Reviewed-by: Omar Sandoval
> Signed-off-by: David Sterba
> ---
>
> v2:
> - add noinline_for_stack back
> fs/btrfs/ctree.h | 6 --
> fs/btrfs/extent_io.c | 13 +
imize out
> any code that would depend on conditions using btrfs_is_testing.
>
> As this is only for the testing code, drop unlikely().
Reviewed-by: Omar Sandoval
> Signed-off-by: David Sterba
> ---
>
> v2:
> - remove unlikely
> - simplify to: return test_bit(...)
>
ock group, so we're sure to be done with all IO by the time we get to
> btrfs_stop_all_workers(). This fixes the panic I was seeing
> consistently in testing.
Reviewed-by: Omar Sandoval
> Signed-off-by: Josef Bacik
> ---
> fs/btrfs/extent-tree.c | 1 +
> 1 file changed, 1 inse
On Tue, Sep 11, 2018 at 01:57:34PM -0400, Josef Bacik wrote:
> From: Josef Bacik
>
> The cleanup_extent_op function actually would run the extent_op if it
> needed running, which made the name sort of a misnomer. Change it to
> run_and_cleanup_extent_op, and move the actual cleanup work to
>
v->type, (unsigned long long)rsv->size,
> +(unsigned long long)rsv->reserved);
How about passing a string name for each of these instead of an ID which
we have to cross-reference with the source?
Besides that,
Reviewed-by: Omar Sandoval
> + spin_unlock(>lock);
>
e still want to commit as we may be able to allocate a chunk to make
> our reservation. So instead of just returning ENOSPC, check if we have
> free block groups pending, and if so commit the transaction to allow us
> to use that free space.
Reviewed-by: Omar Sandoval
> Si
On Tue, Sep 11, 2018 at 01:57:36PM -0400, Josef Bacik wrote:
> We pick the number of ref's to run based on the number of ref heads, and
> only make the decision to stop once we've processed entire ref heads, so
> only count the ref heads we've run and bail once we've hit the number of
> ref heads
On Tue, Sep 11, 2018 at 01:57:32PM -0400, Josef Bacik wrote:
> From: Josef Bacik
>
> We do this dance in cleanup_ref_head and check_ref_cleanup, unify it
> into a helper and cleanup the calling functions.
Reviewed-by: Omar Sandoval
> Signed-off-by: Josef Bacik
> ---
> f
From: Omar Sandoval
The SWP_FILE flag serves two purposes: to make swap_{read,write}page()
go through the filesystem, and to make swapoff() call
->swap_deactivate(). For Btrfs, we want the latter but not the former,
so split this flag into two. This makes us always call
->swap_deac
From: Omar Sandoval
Hi,
This series implements swap file support for Btrfs.
Changes from v6 [1]:
- Moved btrfs_get_chunk_map() comment to function body
- Added more comments about pinned block group/device rbtree
- Fixed bug in patch 4 which broke resize
Based on v4.19-rc3.
Thanks!
1
1 - 100 of 808 matches
Mail list logo