On 04/21/2018 10:43 AM, Qu Wenruo wrote:
On 2018年04月21日 10:38, Anand Jain wrote:
On 04/20/2018 11:15 PM, David Sterba wrote:
On Fri, Apr 20, 2018 at 10:32:03PM +0800, Anand Jain wrote:
On 04/19/2018 05:38 PM, Qu Wenruo wrote:
Although we have already checked incompat flags manually
On 2018年04月21日 10:38, Anand Jain wrote:
>
>
> On 04/20/2018 11:15 PM, David Sterba wrote:
>> On Fri, Apr 20, 2018 at 10:32:03PM +0800, Anand Jain wrote:
>>>
>>>
>>> On 04/19/2018 05:38 PM, Qu Wenruo wrote:
Although we have already checked incompat flags manually before really
On 04/20/2018 11:15 PM, David Sterba wrote:
On Fri, Apr 20, 2018 at 10:32:03PM +0800, Anand Jain wrote:
On 04/19/2018 05:38 PM, Qu Wenruo wrote:
Although we have already checked incompat flags manually before really
mounting it, we could still enhance btrfs_check_super_valid() to check
Hi,
We came across a scenario where inspite of fsync-ing the directory,
the entry was not persisted - the file created under this directory
was lost.
Consider the following workload :
1. creat test/foo
2. mkdir test/A
3. creat test/A/foo
4. fsync test/A/foo
5. fsync test
-crash-
When
On 04/18/2018 01:15 AM, Filipe Manana wrote:
> On Wed, Apr 18, 2018 at 12:39 AM, Howard McLauchlan
> wrote:
>> Presently btrfs send/receive does not propagate inode attribute flags;
>> all chattr operations are effectively discarded upon transmission.
>>
>> This patch adds
The patchset implements the existing VFS ioctls for reading extended
ioctl flags by btrfs.
There are many flags/attributes/extended/combined, the naming is
confusing, so let's recap what we have:
* generic VFS inode flags (i_flags)
- S_* namespace
The btrfs inode flag flavour is now simply called 'inode flags' and the
vfs inode are i_flags. Also rename the internal variable to something
less confusing than 'ip'.
Signed-off-by: David Sterba
---
fs/btrfs/ctree.h | 2 +-
fs/btrfs/inode.c | 4 ++--
fs/btrfs/ioctl.c | 16
The FS_*_FL flags cannot be easily identified by a variable name prefix
but we still need to recognize them so the 'fsflags' should be closer to
the naming scheme but again the 'fs' part sounds like it's a filesystem
flag. I don't have a better idea for now.
Signed-off-by: David Sterba
Preparatory work for the FS_IOC_FSGETXATTR ioctl, basic conversions and
checking helpers.
Signed-off-by: David Sterba
---
fs/btrfs/ioctl.c | 32
1 file changed, 32 insertions(+)
diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c
index
The new ioctl is an extension to the FS_IOC_GETFLAGS and adds new
flags and is extensible. This patch allows to return the xflags portion
of the fsxattr structure, other items have no meaning for btrfs or can
be added later.
The original patch was written by Chandan Jay Sharma but was incomplete
The new ioctl is an extension to the FS_IOC_SETFLAGS and adds new
flags and is extensible. Don't get fooled by the XATTR in the name, it
does not have anything in common with the extended attributes,
incidentally also abbreviated as XATTRs.
This patch allows to set the xflags portion of the
Converts btrfs_inode::flags to the FS_*_FL flags.
Signed-off-by: David Sterba
---
fs/btrfs/ioctl.c | 9 +
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c
index 953473f2a136..f0e6074233fa 100644
--- a/fs/btrfs/ioctl.c
The FS_*_FL flags cannot be easily identified by a prefix but we still
need to recognize them so the 'fsflags' should be closer to the naming
scheme but again the 'fs' part sounds like it's a filesystem flag. I
don't have a better idea for now.
Signed-off-by: David Sterba
---
On Fri, Apr 20, 2018 at 10:32:03PM +0800, Anand Jain wrote:
>
>
> On 04/19/2018 05:38 PM, Qu Wenruo wrote:
> > Although we have already checked incompat flags manually before really
> > mounting it, we could still enhance btrfs_check_super_valid() to check
> > incompat flags for later write time
On 2018-04-20 10:21, David Sterba wrote:
This patchset adds new ioctl similar to TRIM, that provides several
other ways how to clear the unused space. The changelogs are
incomplete, for preview not for inclusion yet.
+1 for the idea. This will be insanely useful for certain VM setups.
It
@@ -3563,6 +3565,12 @@ int write_all_supers(struct btrfs_fs_info *fs_info, int
max_mirrors)
sb = fs_info->super_for_commit;
dev_item = >dev_item;
+ if (btrfs_check_super_valid(fs_info, sb, -1)) {
+ btrfs_err(fs_info,
+ "superblock corruption
On 04/19/2018 05:38 PM, Qu Wenruo wrote:
Although we have already checked incompat flags manually before really
mounting it, we could still enhance btrfs_check_super_valid() to check
incompat flags for later write time super block validation check.
This patch adds such incompat flags check
A new ioctl that will clear the free space (by writing zeros) given by
the user range. Similar to the TRIM ioctl.
We need a new ioctl for that because struct fstrim_range does not
provide any existing or reserved member for extensions. The new ioctl
also supports TRIM as the operation type.
Signed-off-by: David Sterba
---
fs/btrfs/extent-tree.c | 12 +++-
include/uapi/linux/btrfs.h | 5 +
2 files changed, 16 insertions(+), 1 deletion(-)
diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c
index 285bace8e2c6..bd2ac5779998 100644
---
Signed-off-by: David Sterba
---
fs/btrfs/extent-tree.c | 25 ++---
1 file changed, 14 insertions(+), 11 deletions(-)
diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c
index ffdd3aba508c..b317f8ee42a9 100644
--- a/fs/btrfs/extent-tree.c
+++
Signed-off-by: David Sterba
---
fs/btrfs/extent-tree.c | 14 --
include/uapi/linux/btrfs.h | 1 +
2 files changed, 13 insertions(+), 2 deletions(-)
diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c
index 21a24fff32dd..285bace8e2c6 100644
---
Signed-off-by: David Sterba
---
fs/btrfs/ctree.h | 1 +
fs/btrfs/extent-tree.c | 3 +++
2 files changed, 4 insertions(+)
diff --git a/fs/btrfs/ctree.h b/fs/btrfs/ctree.h
index 7cde72683b8e..772cb4ccc5f7 100644
--- a/fs/btrfs/ctree.h
+++ b/fs/btrfs/ctree.h
@@ -679,6
This patchset adds new ioctl similar to TRIM, that provides several
other ways how to clear the unused space. The changelogs are
incomplete, for preview not for inclusion yet.
It compiles and has been tested lightly, the clearing modes depend on hw
capabilities (secure discard, sector unmapping
This is preparatory work to implement clearing free space by zeroing,
much in the same way the FITRIM ioctl works. This patch simply defines
a symbolic name for the current clearing operation and passes the
parameter around. No functional change.
Signed-off-by: David Sterba
Ok not that simple, the running status is checked outside of
balance_mutex and there's one more assertion that does not expect the
balance_ctl to exist:
@@ -4031,16 +4032,16 @@ int btrfs_pause_balance(struct btrfs_fs_info *fs_info)
return -ENOTCONN;
}
-
On Thu, Apr 19, 2018 at 07:24:48PM +0300, Nikolay Borisov wrote:
> I agree with David, just make it btrfs_validate_super
Ack.
--
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 Fri, Apr 20, 2018 at 01:58:11PM +0200, David Sterba wrote:
> On Fri, Apr 20, 2018 at 03:52:24PM +0800, Anand Jain wrote:
> >
> >
> > On 04/20/2018 12:33 AM, David Sterba wrote:
> > > Currently fs_info::balance_running is 0 or 1 and does not use the
> > > semantics of atomics. The pause and
Balance cannot be started on a read-only filesystem and will have to
finish/exit before eg. going to read-only via remount.
In case the filesystem is forcibly set to read-only after an error,
balance will finish anyway and if the cancel call is too fast it will
just wait for that to happen.
The
On Fri, Apr 20, 2018 at 05:13:02PM +0800, Anand Jain wrote:
>
>
> On 04/20/2018 12:33 AM, David Sterba wrote:
> > Balance cannot be started on a read-only filesystem and will have to
> > finish/exit before eg. going to read-only via remount.
>
> It can be paused as well.
> btrfs balance
On Fri, Apr 20, 2018 at 03:52:24PM +0800, Anand Jain wrote:
>
>
> On 04/20/2018 12:33 AM, David Sterba wrote:
> > Currently fs_info::balance_running is 0 or 1 and does not use the
> > semantics of atomics. The pause and cancel check for 0, that can happen
> > only after __btrfs_balance exits for
Hi Zygo,
Thanks for the reply. Here are few responses about btrfs behavior that
you had questions about in your email.
On Thu, Apr 19, 2018 at 4:41 PM, Zygo Blaxell
wrote:
>
> On Mon, Apr 16, 2018 at 09:35:24AM -0500, Jayashree Mohan wrote:
> > Hi,
> >
> > The
On Fri, Apr 20, 2018 at 10:07:17AM +0300, Nikolay Borisov wrote:
>
>
> On 19.04.2018 19:33, David Sterba wrote:
> > + /* reset_balance_state needs volume_mutex */
>
> Does it make sense to codify this invariant as lockdep_assert_held in
> reset_balance_state ?
No, the comment and the
On Fri, Apr 20, 2018 at 10:23 AM, Gu, Jinxiang wrote:
> Hi,
>
> Here's a bug report.
> Kernel v4.17-rc1 failed xfstests-dev/btrfs/007.
> It is not always happens.( occurred times/test times: 1/20)
You don't need to check how many times it fails... You have a fsstress
seed
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 fs/btrfs/volumes.c:3890!
::
kernel: balance_kthread+0x51/0x60 [btrfs]
kernel: kthread+0x111/0x130
::
On 04/20/2018 12:33 AM, David Sterba wrote:
While the spinlock does not cause problems, using the mutex is more
correct and consistent with others. The global status of balance is eg.
checked from btrfs_pause_balance or btrfs_cancel_balance with mutex.
Resuming balance happens during mount or
Hi,
Here's a bug report.
Kernel v4.17-rc1 failed xfstests-dev/btrfs/007.
It is not always happens.( occurred times/test times: 1/20)
And I confirmed this test using kernel v4.16-rc1.
It also occurred sometimes.
LOG when using kernel v4.17-rc1.
btrfs/007[failed, exit status 1] - output
On 04/20/2018 12:33 AM, David Sterba wrote:
The parameter controls locking of the stats part but we can lock it
unconditionally, as this only happens once when balance starts. This is
not performance critical.
Add the prefix for an exported function.
Signed-off-by: David Sterba
Timofey Titovets posted on Fri, 20 Apr 2018 01:32:42 +0300 as excerpted:
> 2018-04-20 1:08 GMT+03:00 Drew Bloechl :
>> I've got a btrfs filesystem that I can't seem to get back to a useful
>> state. The symptom I started with is that rename() operations started
>> dying with
On 04/20/2018 12:33 AM, David Sterba wrote:
Balance cannot be started on a read-only filesystem and will have to
finish/exit before eg. going to read-only via remount.
It can be paused as well.
btrfs balance pause /btrfs && mount -o remount,ro /dev/sdb /btrfs
@@ -4053,15 +4053,20 @@
On 04/20/2018 12:33 AM, David Sterba wrote:
The function __cancel_balance name is confusing with the cancel
operation of balance and it really resets the state of balance back to
zero. The unset_balance_control helper is called only from one place and
simple enough to be inlined.
On 04/20/2018 12:33 AM, David Sterba wrote:
Currently fs_info::balance_running is 0 or 1 and does not use the
semantics of atomics. The pause and cancel check for 0, that can happen
only after __btrfs_balance exits for whatever reason.
Parallel calls to balance ioctl may enter
On 04/20/2018 12:33 AM, David Sterba wrote:
Replace a WARN_ON with a proper check and message in case something goes
really wrong and resumed balance cannot set up its exclusive status.
The check is a user friendly assertion, I don't expect to ever happen
under normal circumstances.
Also
On 04/20/2018 12:33 AM, David Sterba wrote:
The device replace is paused by unmount or read only remount, and
resumed on next mount or write remount.
The exclusive status should be checked properly as it's a global
invariant and we must not allow 2 operations run. In this case, the
balance
On 04/20/2018 12:33 AM, David Sterba wrote:
Make the clearning visible in the callers so we can pair it with the
test_and_set part.
Signed-off-by: David Sterba
Reviewed-by: Anand Jain
Thanks, Anand
---
fs/btrfs/ioctl.c | 2 +-
On 19.04.2018 19:33, David Sterba wrote:
> + /* reset_balance_state needs volume_mutex */
Does it make sense to codify this invariant as lockdep_assert_held in
reset_balance_state ?
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to
On 19.04.2018 19:33, David Sterba wrote:
> The device replace is paused by unmount or read only remount, and
> resumed on next mount or write remount.
>
> The exclusive status should be checked properly as it's a global
> invariant and we must not allow 2 operations run. In this case, the
>
On 19.04.2018 19:33, David Sterba wrote:
> Make the clearning visible in the callers so we can pair it with the
> test_and_set part.
>
> Signed-off-by: David Sterba
Reviewed-by: Nikolay Borisov
> ---
> fs/btrfs/ioctl.c | 2 +-
> fs/btrfs/volumes.c |
On 04/20/2018 02:22 PM, Gu, Jinxiang wrote:
Hi,
I reproduced this using kernel v4.17-rc1.
It is not always happens.( occurred times/test times: 1/20)
Though it was reported here, its not related to this patch set.
Instead its about the send receive.
Pls post it as a separate thread so it
Hi,
I reproduced this using kernel v4.17-rc1.
It is not always happens.( occurred times/test times: 1/20)
> -Original Message-
> From: linux-btrfs-ow...@vger.kernel.org
> [mailto:linux-btrfs-ow...@vger.kernel.org] On Behalf Of Anand Jain
> Sent: Tuesday, January 23, 2018 5:53 AM
> To:
49 matches
Mail list logo