-by: Anand Jain <anand.j...@oracle.com>
---
fs/btrfs/volumes.c | 4
1 file changed, 4 insertions(+)
diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c
index ba32e2d73fbe..8bac1cf17048 100644
--- a/fs/btrfs/volumes.c
+++ b/fs/btrfs/volumes.c
@@ -798,6 +798,10 @@ static noinline int device_li
BTRFS_SUPER_FLAG_VOL_MOVED_ON.
Signed-off-by: Anand Jain <anand.j...@oracle.com>
---
fs/btrfs/disk-io.c | 53 -
fs/btrfs/volumes.c | 14 +--
include/uapi/linux/btrfs_tree.h | 1 +
3 files changed, 65 insertions(+), 3 deletions(-)
diff --gi
We need to delete a device from the dev_list, so refactor
btrfs_free_stale_device() for delete_device_from_list().
Signed-off-by: Anand Jain <anand.j...@oracle.com>
---
fs/btrfs/volumes.c | 27 +--
1 file changed, 17 insertions(+), 10 deletions(-)
diff --git a/fs
which is added here. At which it shall
report 'Inappropriate ioctl for device'. And will report
'Operation not permitted' on mounted device.
Signed-off-by: Anand Jain <anand.j...@oracle.com>
---
cmds-device.c | 54 ++
ioctl.h | 2 ++
2
conditions.
This patch proposes to use ioctl #5 as it was empty.
IOW(BTRFS_IOCTL_MAGIC, 5, ..)
If #5 is reserved for some other purpose, I think I should change this.
Signed-off-by: Anand Jain <anand.j...@oracle.com>
---
fs/btrfs/super.c | 4 +++
fs/btrfs/vol
Patch 1/2 is preparatory patch to get a function to delete a device
from the list.
Patch 2/2 adds the ioctl and feature to delete a device from the
device list.
Anand Jain (2):
btrfs: refactor btrfs_free_stale_device() to get device list delete
btrfs: introduce feature to ignore a btrfs
scanned won't appear in the alloc_list.
Signed-off-by: Anand Jain <anand.j...@oracle.com>
---
tests/btrfs/154 | 188
tests/btrfs/154.out | 10 +++
tests/btrfs/group | 1 +
3 files changed, 199 insertions(+)
create mode 100755 tests
to the device alloc list.
So now with this patch, to bring back the missing device user can run,
btrfs dev scan
Signed-off-by: Anand Jain <anand.j...@oracle.com>
---
This patch needs:
[PATCH 0/4] factor __btrfs_open_devices()
fs/btrfs/volumes.
no-functional
changes patches, which can be merged together if needed.
Anand Jain (4):
btrfs: set fs_devices->seed directly
btrfs: let variable required be declared inside the loop
btrfs: move check for device generation to the last
btrfs: factor __btrfs_open_devices() to cre
A preparation patch to create the actual device open in a new function.
Signed-off-by: Anand Jain <anand.j...@oracle.com>
---
fs/btrfs/volumes.c | 11 ++-
1 file changed, 6 insertions(+), 5 deletions(-)
diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c
index ab2f34
No functional changes. This helps to move the entire section into
a new function.
Signed-off-by: Anand Jain <anand.j...@oracle.com>
---
fs/btrfs/volumes.c | 8 +---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c
index ea6e54
No functional changes, create btrfs_open_one_device() from
__btrfs_open_devices(). This is a preparatory work to add dynamic
device scan.
Signed-off-by: Anand Jain <anand.j...@oracle.com>
---
fs/btrfs/volumes.c | 126 +
1 file chang
This is in preparation to move a section of code in __btrfs_open_devices()
into a new function so that it can be reused. As we set seeding if any of
the device is having SB flag BTRFS_SUPER_FLAG_SEEDING, so do it in the
device list loop itself. No functional changes.
Signed-off-by: Anand Jain
On 11/09/2017 03:53 AM, Liu Bo wrote:
On Tue, Nov 07, 2017 at 04:32:55PM +0800, Anand Jain wrote:
On 11/02/2017 08:54 AM, Liu Bo wrote:
With raid6 profile, btrfs can end up with data corruption by the
following steps.
Say we have a 5 disks that are set up with raid6 profile,
1) mount
On 11/02/2017 08:54 AM, 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 default every device is set with
On 11/02/2017 08:54 AM, Liu Bo wrote:
With raid6 profile, btrfs can end up with data corruption by the
following steps.
Say we have a 5 disks that are set up with raid6 profile,
1) mount this btrfs
2) one disk gets pulled out
3) write something to btrfs and sync
4) another disk gets pulled
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
btrfs_async_submit_limit() will return 256 * 2/3.
Signed-off-by: Anand Jain <anand.j...@oracle.com>
---
v2: add more change log.
v3: don't compute 256 * 2/3. I didn't know compiler will do it anyway,
thats nice. So keeping that open coded. And comment removed.
fs/btrfs/disk-io.c | 4 ++
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 <anand.j...@oracle.com>
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
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. R
We can push volume_mutex lock further down after the memory operation.
Signed-off-by: Anand Jain <anand.j...@oracle.com>
---
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 09c95f
Do string check for the device's new size before volume_mutex is held.
Signed-off-by: Anand Jain <anand.j...@oracle.com>
---
fs/btrfs/ioctl.c | 37 +++--
1 file changed, 19 insertions(+), 18 deletions(-)
diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c
As i_size_read() takes care of 32bit smp or preempt cases as well.
Signed-off-by: Anand Jain <anand.j...@oracle.com>
---
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 <anand.j...@oracle.com>
---
fs/btrfs/volumes.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/fs
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 <anand.j...@oracle.com>
---
fs/btrfs/ioctl.c | 2 --
fs/btrfs/volumes.c | 10 +-
2 files changed, 9 insertions(+), 3 deletions(-)
diff --gi
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 <anan
Signed-off-by: Anand Jain <anand.j...@oracle.com>
---
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
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
On 11/03/2017 07:13 PM, 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 actions can be done with RCU
+ * protection
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 <anand.j...@oracle.com>
---
David, This patch is based on your workspace/for-next plus your
recent patchset '[PATCH 00/11] Device
looks good.
Reviewed-by: Anand Jain <anand.j...@oracle.com>
Thanks, Anand
On 11/01/2017 01:44 AM, David Sterba wrote:
Signed-off-by: David Sterba <dste...@suse.com>
---
fs/btrfs/volumes.c | 7 +++
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/fs/btrfs/vo
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 actions can be done with RCU
+ * protection
+ *
+ * may be used to exclude some
Looks good.
Reviewed-by: Anand Jain <anand.j...@oracle.com>
Thanks, Anand
On 11/01/2017 01:44 AM, David Sterba wrote:
Signed-off-by: David Sterba <dste...@suse.com>
---
fs/btrfs/volumes.c | 39 +++
1 file changed, 11 insertions(+),
),
so it at least it's not that easy to hit the leak, but it's still
possible through the path that frees stale devices.
Fixes: e0ae99941423 ("btrfs: preallocate device flush bio")
Signed-off-by: David Sterba <dste...@suse.com>
Reviewed-by: Anand Jain <anand.j...@oracle.
This patch maintains consistency of mode in device get and put. And is just
a cleanup patch. There isn't any problem that was noticed, so no functional
changes.
Signed-off-by: Anand Jain <anand.j...@oracle.com>
---
v2: commit update
v3: commit update
fs/btrfs/volumes.c | 16 -
btrfs_async_submit_limit() will return 170 itself.
Signed-off-by: Anand Jain <anand.j...@oracle.com>
---
IMO:
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 gene
On 10/31/2017 10:21 PM, Nikolay Borisov wrote:
On 31.10.2017 04:11, Anand Jain wrote:
On 10/30/2017 10:39 PM, David Sterba wrote:
On Fri, Oct 20, 2017 at 10:07:15PM +0800, Anand Jain wrote:
We aren't setting the FMODE_WRITE when initializing btrfs_device
structure and when calling
On 10/31/2017 10:18 PM, Nikolay Borisov wrote:
On 31.10.2017 14:59, Anand Jain wrote:
btrfs_async_submit_limit() would return the q depth to be 256, however
when we are using it we are making it 2/3 times of it. So instead let
the function return the final computed value.
Signed-off
btrfs_async_submit_limit() would return the q depth to be 256, however
when we are using it we are making it 2/3 times of it. So instead let
the function return the final computed value.
Signed-off-by: Anand Jain <anand.j...@oracle.com>
---
fs/btrfs/disk-io.c | 6 --
fs/btrfs/volumes
On 10/30/2017 10:39 PM, David Sterba wrote:
On Fri, Oct 20, 2017 at 10:07:15PM +0800, Anand Jain wrote:
We aren't setting the FMODE_WRITE when initializing btrfs_device
structure and when calling blkdev_put, however we are setting it
only when calling blkdev_get_by_path().
But this still
btrfs_read_dev_super() returns -1 / -EPERM upon not finding a suitable SB,
change that to return -ENOENT instead, which is much closer to the actual
possible errors.
Signed-off-by: Anand Jain <anand.j...@oracle.com>
---
v2: use -ENOENT instead of 1.
disk-io.c | 2 +-
utils.c | 2 +-
vol
On 10/27/2017 04:04 PM, Qu Wenruo wrote:
On 2017年10月27日 15:54, Nikolay Borisov wrote:
On 27.10.2017 10:31, Anand Jain wrote:
btrfs_read_dev_super() returns -1 upon not finding a suitable SB,
change that to return 1 instead, so that it can reserve the < 0
values for the er
btrfs_read_dev_super() returns -1 upon not finding a suitable SB,
change that to return 1 instead, so that it can reserve the < 0
values for the errno communications.
Signed-off-by: Anand Jain <anand.j...@oracle.com>
---
An independent patch, not related to any recent patch sent to M
dev_to_fsid()
which can fail if the user is not root OR if the device has media
errors as well. So skip the seed check altogether if we fail to
know the device superblock and thus the fsid.
With this now we are able to view the btrfs fi usage when the
device is bad.
Signed-off-by: Anand Jain <anan
proach.
Since only the size of non-seed devices is matter, fix this by just
skipping seed device by checking device's fsid and comparing it to the fsid
obtained by FS_INFO ioctl.
Signed-off-by: Tomohiro Misono <misono.tomoh...@jp.fujitsu.com>
Reviewed-by: Anand Jain <anand.j.
On 10/23/2017 12:44 PM, Misono, Tomohiro wrote:
Move dev_to_fsid() from cmds-filesystem.c to cmds-fi-usage.c in order to
call it from both "fi show" and "fi usage".
Signed-off-by: Tomohiro Misono <misono.tomoh...@jp.fujitsu.com>
Reviewed-by: Anand Jain <anand.j.
unction btrfs_dev_stat_inc_and_print() and which can be renamed as needed.
Signed-off-by: Anand Jain <anand.j...@oracle.com>
---
fs/btrfs/volumes.c | 7 +++
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c
index efaf85dd91b0..d1d8aa226bff 100644
--- a/fs/bt
On 10/20/2017 11:27 PM, David Sterba wrote:
On Fri, Oct 20, 2017 at 05:50:59PM +0800, Anand Jain wrote:
btrfs_end_bio() is using btrfs_dev_stat_inc() and then
btrfs_dev_stat_print_on_error() separately instead
use btrfs_dev_stat_inc_and_print() directly.
No need to worry about print lines
We aren't setting the FMODE_WRITE when initializing btrfs_device
structure and when calling blkdev_put, however we are setting it
only when calling blkdev_get_by_path().
Signed-off-by: Anand Jain <anand.j...@oracle.com>
---
v2: Reword commit log.
fs/btrfs/volumes.c | 16
On 10/20/2017 08:26 PM, Nikolay Borisov wrote:
On 20.10.2017 13:33, Anand Jain wrote:
We aren't saving the fmode_t flags at %struct btrfs_device->mode same
as it used to open the device at device replace, so fix that.
I think this could use a bit of rewording to better explain w
We aren't saving the fmode_t flags at %struct btrfs_device->mode same
as it used to open the device at device replace, so fix that.
Signed-off-by: Anand Jain <anand.j...@oracle.com>
---
fs/btrfs/volumes.c | 16
1 file changed, 8 insertions(+), 8 deletions(-)
diff -
Devices opened through replace/add would have FMODE_WRITE | FMODE_EXCL,
as compared with devices opened through the mount which will have
FMODE_READ | FMODE_WRITE | FMODE_EXCL. So maintain consistency.
Signed-off-by: Anand Jain <anand.j...@oracle.com>
---
fs/btrfs/volumes.c | 4 ++--
] btrfs: REQ_PREFLUSH does not use btrfs_end_bio() completion callback
there isn't any IO which is doing that.
This consolidation is a preparatory patch to add device
critical error handling in btrfs_dev_stat_inc_and_print()
and can be renamed as needed.
Signed-off-by: Anand Jain <anan
On 10/16/2017 10:45 PM, David Sterba wrote:
On Thu, Oct 12, 2017 at 05:00:41PM +0800, Anand Jain wrote:
That was only an extra check to tackle few bugs around this
area, now its save to remove it.
Signed-off-by: Anand Jain <anand.j...@oracle.com>
---
fs/btrfs/volumes.c | 8 ++
Use ASSERT instead of BUG_ON.
Signed-off-by: Anand Jain <anand.j...@oracle.com>
---
V2: Accepts David suggestion to keep the check as ASSERT.
Adds more comments to explain the context.
fs/btrfs/volumes.c | 15 ---
1 file changed, 8 insertions(+), 7 deletions(-)
diff --gi
On 10/16/2017 12:35 PM, Misono, Tomohiro wrote:
On 2017/10/16 12:30, Anand Jain wrote:
On 10/13/2017 01:27 PM, Duncan wrote:
Misono, Tomohiro posted on Wed, 11 Oct 2017 11:18:50 +0900 as excerpted:
Add 'btrfs remove missing-all' to remove all the missing devices at once
for improving
On 10/14/2017 02:47 AM, Liu Bo wrote:
On Tue, Oct 03, 2017 at 11:59:19PM +0800, Anand Jain wrote:
From: Anand Jain <anand.j...@oracle.com>
This patch provides helper functions to force a device to failed,
and we need it for the following reasons,
1) a. It can be reported that devi
On 10/14/2017 02:46 AM, Liu Bo wrote:
On Sun, Oct 08, 2017 at 10:23:58PM +0800, Anand Jain wrote:
On 10/07/2017 07:56 AM, Liu Bo wrote:
On Thu, Oct 05, 2017 at 09:56:59PM +0800, Anand Jain wrote:
On 10/05/2017 04:11 AM, Liu Bo wrote:
On Tue, Oct 03, 2017 at 11:59:20PM +0800, Anand Jain
On 10/14/2017 04:51 AM, Liu Bo wrote:
On Wed, Oct 11, 2017 at 10:38:50AM +0300, Nikolay Borisov wrote:
On 10.10.2017 20:53, Liu Bo wrote:
We've avoided data losing raid profile when doing balance, but it
turns out that deleting a device could also result in the same
problem
This fixes the
On 10/13/2017 01:27 PM, Duncan wrote:
Misono, Tomohiro posted on Wed, 11 Oct 2017 11:18:50 +0900 as excerpted:
Add 'btrfs remove missing-all' to remove all the missing devices at once
for improving usability.
Example:
sudo mkfs.btrfs -f -d raid1 /dev/sdb1 /dev/sdb2 /dev/sdb3 /dev/sdb4
At few places we could use BLK_STS_OK and BLK_STS_NOSUPP.
Signed-off-by: Anand Jain <anand.j...@oracle.com>
---
fs/btrfs/compression.c | 3 ++-
fs/btrfs/inode.c | 4 ++--
fs/btrfs/volumes.c | 2 +-
3 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/fs/btrfs/compressi
- bio->bi_status = BLK_STS_IOERR;
+ if (atomic_read(>error) > bbio->max_errors)
+ bio->bi_status = BLK_STS_IOERR;
+ else
+ bio->bi_status = 0;
Thanks for the fix, I'd prefer BLK_STS_OK rather than 0.
With
v_nr=0 must be completed so that the below
condition is true
if (atomic_dec_and_test(>stripes_pending)) {
Signed-off-by: Anand Jain <anand.j...@oracle.com>
Reviewed-by: Liu Bo <bo.li@oracle.com>
---
v2: Use BLK_STS_OK instead of 0.
fs/btrfs/volumes.c | 5 -
1 file
v_nr=0 must be completed so that the below
condition is true
if (atomic_dec_and_test(>stripes_pending)) {
Signed-off-by: Anand Jain <anand.j...@oracle.com>
---
fs/btrfs/volumes.c | 5 -
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/fs/btrfs/volumes.c b/fs/btrfs/
Not quite. While the seed device is still connected I would like to
force some files over to the rw device. The use case is basically a
much slower link to a seed device holding significantly more data than
we currently need. An example would be a slower iscsi link to the seed
device and a
In btrfs_init_new_device() when btrfs_attach_transaction() fails we
shouldn't call btrfs_end_transaction(). Fix it.
Signed-off-by: Anand Jain <anand.j...@oracle.com>
Fixes:
btrfs: error out if btrfs_attach_transaction() fails
---
Hi David,
Can you pls squash this changes to the patch
Thanks Dan! You are right. Will fix it.
Anand
On 10/13/2017 04:39 AM, Dan Carpenter wrote:
Hello Anand Jain,
The patch 1eea2715ca9b: "btrfs: error out if
btrfs_attach_transaction() fails" from Sep 28, 2017, leads to the
following static checker warning:
fs/btrfs/volu
That was only an extra check to tackle few bugs around this
area, now its save to remove it.
Signed-off-by: Anand Jain <anand.j...@oracle.com>
---
fs/btrfs/volumes.c | 8 ++--
1 file changed, 2 insertions(+), 6 deletions(-)
diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c
A cleanup patch, use need_full_stripe() to replace the open code.
Signed-off-by: Anand Jain <anand.j...@oracle.com>
---
fs/btrfs/volumes.c | 16 ++--
1 file changed, 6 insertions(+), 10 deletions(-)
diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c
index 3b3ba1
On 10/12/2017 08:47 AM, Joseph Dunn wrote:
After seeing how btrfs seeds work I wondered if it was possible to push
specific files from the seed to the rw device. I know that removing
the seed device will flush all the contents over to the rw device, but
what about flushing individual files on
On 10/11/2017 05:33 PM, Nikolay Borisov wrote:
On 11.10.2017 03:28, Liu Bo wrote:
If one of btrfs's devices was pulled out and we've replaced it with a
new one, then they have the same uuid.
If that device gets reconnected, 'btrfs filesystem show' will show the
stale one instead of the new
On 10/11/2017 02:11 PM, Anand Jain wrote:
On 10/11/2017 05:51 AM, Liu Bo wrote:
It was introduced because btrfs used to do blkdev_put in a deferred
work, now that btrfs has put blkdev in place, this rcu_barrier can be
removed.
On the 2nd thought, modprobe -r btrfs would still need
On 10/11/2017 05:51 AM, Liu Bo wrote:
It's pointless to defer it to a kthread helper as we're not under any
special context.
Reviewed-by: Anand Jain <anand.j...@oracle.com>
Thanks, Anand
Signed-off-by: Liu Bo <bo.li@oracle.com>
---
fs/btrfs/volumes.c | 14 ++-
to not include the stale one, this could confuse users as people may
monitor btrfs by running that cli.
This does the similar thing to what kernel side has done.
Reviewed-by: Anand Jain <anand.j...@oracle.com>
Thanks, Anand
Signed-off-by: Liu Bo <bo.li@oracle.com>
---
vo
On 10/11/2017 05:51 AM, Liu Bo wrote:
It was introduced because btrfs used to do blkdev_put in a deferred
work, now that btrfs has put blkdev in place, this rcu_barrier can be
removed.
Reviewed-by: Anand Jain <anand.j...@oracle.com>
Thanks, Anand
Signed-off-by: Liu Bo
add_missing_dev() can return device pointer so that IS_ERR/
PTR_ERR can be used to check for the actual error occurred
in the function.
Signed-off-by: Anand Jain <anand.j...@oracle.com>
Reviewed-by: Liu Bo <bo.li@oracle.com>
---
v2: add btrfs_err in read_one_dev too
v3: fix wro
add_missing_dev() can return device pointer so that IS_ERR/
PTR_ERR can be used to check for the actual error occurred
in the function.
Signed-off-by: Anand Jain <anand.j...@oracle.com>
Reviewed-by: Liu Bo <bo.li@oracle.com>
---
fs/btrfs/volumes.c | 17 -
1 file
When device is missing without the -o degraded option then
its an error so report it as an error instead of warning.
And when -o degraded option is provided, log the missing
device as warning.
Signed-off-by: Anand Jain <anand.j...@oracle.com>
---
v2: Rename from
[PATCH 2/2] btrfs: cl
add_missing_dev() can return device pointer so that IS_ERR/
PTR_ERR can be used to check for the actual error occurred
in the function.
Signed-off-by: Anand Jain <anand.j...@oracle.com>
---
v2: This patch is a split from
[PATCH 1/2] btrfs: fix read_one_chunk() return error code
fs
EIO is only for the IO failure to the device, avoid it.
Signed-off-by: Anand Jain <anand.j...@oracle.com>
---
v2: This patch is renamed from
[PATCH 1/2] btrfs: fix read_one_chunk() return error code
fs/btrfs/volumes.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff
Signed-off-by: Anand Jain <anand.j...@oracle.com>
---
v2: This patch is a split from
[PATCH 2/2] btrfs: clean up btrfs_report_missing_device() usage
fs/btrfs/volumes.c | 12 ++--
fs/btrfs/volumes.h | 2 --
2 files changed, 6 insertions(+), 8 deletions(-)
diff --git a/fs
On 10/07/2017 07:56 AM, Liu Bo wrote:
On Thu, Oct 05, 2017 at 09:56:59PM +0800, Anand Jain wrote:
On 10/05/2017 04:11 AM, Liu Bo wrote:
On Tue, Oct 03, 2017 at 11:59:20PM +0800, Anand Jain wrote:
From: Anand Jain <anand.j...@oracle.com>
Write and flush errors are critical errors
as static. And to print warning, just
open code it.
Signed-off-by: Anand Jain <anand.j...@oracle.com>
---
fs/btrfs/volumes.c | 41 +++--
fs/btrfs/volumes.h | 3 ---
2 files changed, 23 insertions(+), 21 deletions(-)
diff --git a/fs/btrfs/volumes.c b/fs
EIO is for IO (RW) failures, use correct error return
codes at two locations with in read_one_chunk(). Also
adds a small cleanup.
Signed-off-by: Anand Jain <anand.j...@oracle.com>
---
fs/btrfs/volumes.c | 17 ++---
fs/btrfs/volumes.h | 3 +--
2 files changed, 11 insertions
On 10/05/2017 04:11 AM, Liu Bo wrote:
On Tue, Oct 03, 2017 at 11:59:20PM +0800, Anand Jain wrote:
From: Anand Jain <anand.j...@oracle.com>
Write and flush errors are critical errors, upon which the device fd
must be closed and marked as failed.
Can we defer the job of closing
to
RDONLY.
Signed-off-by: Anand Jain <anand.j...@oracle.com>
---
This patch is to replace
[PATCH v8 2/2] btrfs: check device for critical errors and mark failed
fs/btrfs/volumes.h | 5 +
1 file changed, 5 insertions(+)
diff --git a/fs/btrfs/volumes.h b/fs/btrfs/volumes.h
On 10/05/2017 04:22 PM, Nikolay Borisov wrote:
Currently when a read-only snapshot is received and subsequently its ro property
is set to false i.e. switched to rw-mode the received_uuid of that subvol
remains
intact. However, once the received volume is switched to RW mode we cannot
From: Anand Jain <anand.j...@oracle.com>
Write and flush errors are critical errors, upon which the device fd
must be closed and marked as failed.
There are two type of device close in btrfs, one, close as part
of clean up where we shall release the struct btrfs_device and
or btrfs_fs_d
From: Anand Jain <anand.j...@oracle.com>
This patch provides helper functions to force a device to failed,
and we need it for the following reasons,
1) a. It can be reported that device has failed when it does and
b. Close the device when it goes offline so that blocklayer can
cle
ices
then its a split brain scenario where user intervention will be required.
On the sysfs part there are patches in the ML which was sent before,
I shall be reviving them as well.
Thanks, Anand
Anand Jain (2):
btrfs: introduce device dynamic state transition to failed
btrfs: check device for crit
On 09/27/2017 10:17 PM, David Sterba wrote:
On Wed, Sep 27, 2017 at 05:50:52PM +0800, Anand Jain wrote:
btrfs_init_new_device() calls btrfs_attach_transaction() to
commit sys chunks, however take the error path out if it fails.
Signed-off-by: Anand Jain <anand.j...@oracle.com>
---
fs
On 09/27/2017 10:26 PM, Nikolay Borisov wrote:
On 27.09.2017 17:22, David Sterba wrote:
On Tue, Sep 26, 2017 at 03:14:27PM +0300, Nikolay Borisov wrote:
On 26.09.2017 11:47, Anand Jain wrote:
1/2 fixes a bug which failed to reset writable when sprouting failed
2/2 fixes BUG_ON
btrfs_init_new_device() calls btrfs_attach_transaction() to
commit sys chunks, and it should error out if it fails.
Signed-off-by: Anand Jain <anand.j...@oracle.com>
Reviewed-by: Qu Wenruo <quwenruo.bt...@gmx.com>
---
v4: make this patch as part of this set.
avoid double mutex
Instead of BUG_ON return error to the caller. And handle the fail
condition by calling the abort transaction and going through the
error path.
Signed-off-by: Anand Jain <anand.j...@oracle.com>
Reviewed-by: Nikolay Borisov <nbori...@suse.com>
---
v4: none;
v3: meld this with
bt
When new device is being added to seed FS, seed FS is marked writable,
but when we fail to bring in the new device, we missed to undo the
writable part. This patch fixes it.
Signed-off-by: Anand Jain <anand.j...@oracle.com>
Reviewed-by: Nikolay Borisov <nbori...@suse.com>
---
v4: none
On 09/27/2017 01:49 AM, David Sterba wrote:
On Tue, Sep 26, 2017 at 08:57:47PM +0800, Qu Wenruo wrote:
On 2017年09月26日 16:41, Anand Jain wrote:
When new device is being added to seed FS, seed FS is marked writable,
but when we fail to bring in the new device, we missed to undo the
writable
btrfs_init_new_device() calls btrfs_attach_transaction() to
commit sys chunks, however take the error path out if it fails.
Signed-off-by: Anand Jain <anand.j...@oracle.com>
---
fs/btrfs/volumes.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/fs/btrfs/volumes.c b/fs
Instead of BUG_ON return error to the caller. And handle the fail
condition by calling the abort transaction and going through the
error path.
Signed-off-by: Anand Jain <anand.j...@oracle.com>
---
v2: do not consolidate btrfs_abort_transaction()
v3: meld 2/3 and 3/3 from v2
fs/btrfs/vol
When new device is being added to seed FS, seed FS is marked writable,
but when we fail to bring in the new device, we missed to undo the
writable part. This patch fixes it.
Signed-off-by: Anand Jain <anand.j...@oracle.com>
---
v3: none
v2: add commit log
fs/btrfs/volumes.c | 2 ++
1/2 fixes a bug which failed to reset writable when sprouting failed
2/2 fixes BUG_ON in btrfs_init_new_device()
Anand Jain (2):
btrfs: undo writable when sprouting fails
btrfs: fix BUG_ON in btrfs_init_new_device()
fs/btrfs/volumes.c | 16 +++-
1 file changed, 11 insertions
901 - 1000 of 3004 matches
Mail list logo