btrfs panic

2011-07-14 Thread Xiao Guangrong
When xfstests 224 was running, the box was panic, and i got this message: [ 1998.327235] = [ 1998.329940] [ INFO: possible recursive locking detected ] [ 1998.329940] 2.6.39+ #3 [ 1998.329940] - [ 1998.329940]

[PATCH 5/5] Btrfs: using rcu lock in the reader side of devices list

2011-04-20 Thread Xiao Guangrong
fs_devices->devices is only updated on remove and add device paths, so we can use rcu to protect it in the reader side Signed-off-by: Xiao Guangrong --- fs/btrfs/disk-io.c | 21 +++-- fs/btrfs/ioctl.c |7 ++-- fs/btrfs/volumes.c |

[PATCH 4/5] Btrfs: drop unnecessary device lock

2011-04-20 Thread Xiao Guangrong
tex safely, like other initialized function does(add_missing_dev, __find_device, __btrfs_open_devices ...). Signed-off-by: Xiao Guangrong --- fs/btrfs/volumes.c | 13 ++--- 1 files changed, 6 insertions(+), 7 deletions(-) diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c index d203

[PATCH 3/5] Btrfs: fix the race between remove dev and alloc chunk

2011-04-20 Thread Xiao Guangrong
On remove device path, it updates device->dev_alloc_list but does not hold chunk lock Signed-off-by: Xiao Guangrong --- fs/btrfs/volumes.c |6 ++ 1 files changed, 6 insertions(+), 0 deletions(-) diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c index a672249..d20351f 100644 --- a

[PATCH 2/5] Btrfs: fix the race between reading and updating devices

2011-04-20 Thread Xiao Guangrong
the mutex to avoid the reader side to reach them Signed-off-by: Xiao Guangrong --- fs/btrfs/disk-io.c |4 fs/btrfs/volumes.c |7 +++ 2 files changed, 11 insertions(+), 0 deletions(-) diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c index ef6865c..5a70096 100644 --- a/fs/b

[PATCH 1/5] Btrfs: fix bh leak on __btrfs_open_devices path

2011-04-20 Thread Xiao Guangrong
'bh' is forgot to release if no error is detected Signed-off-by: Xiao Guangrong --- fs/btrfs/volumes.c |1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c index 8b9fb8c..69fc902 100644 --- a/fs/btrfs/volumes.c +++ b/fs/btrfs

Re: [PATCH 1/2] Btrfs: allocate extent state and check the result properly

2011-04-19 Thread Xiao Guangrong
On 04/19/2011 07:55 PM, Chris Mason wrote: > Sorry, could you please change this to check the results of the atomic > allocatoin in set/clear_extent_bit? I'd rather not add a new BUG_ON > deeper into the code. > OK, i have posted the v2 patch to fix it, thanks for your review! -- To unsubscribe

[PATCH v2 2/2] Btrfs: fix unsafe usage of merge_state

2011-04-19 Thread Xiao Guangrong
merge_state can free the current state if it can be merged with the next node, but in set_extent_bit(), after merge_state, we still use the current extent to get the next node and cache it into cached_state Signed-off-by: Xiao Guangrong --- fs/btrfs/extent_io.c | 22 ++ 1

[PATCH v2 1/2] Btrfs: allocate extent state and check the result properly

2011-04-19 Thread Xiao Guangrong
ate fail, we trigger BUG_ON instead of returning -ENOMEM since the return value of clear_extent_bit() is ignored by many callers Signed-off-by: Xiao Guangrong --- fs/btrfs/extent_io.c | 34 ++ 1 files changed, 26 insertions(+), 8 deletions(-) diff --git a/fs/bt

Re: [PATCH 1/2] Btrfs: allocate extent state and check the result properly

2011-04-18 Thread Xiao Guangrong
On 04/12/2011 04:14 PM, Xiao Guangrong wrote: > It doesn't allocate extent_state and check the result properly: > - in set_extent_bit, it doesn't allocate extent_state if the path is not > allowed wait > > - in clear_extent_bit, it doesn't check the result af

[PATCH 2/2] Btrfs: fix unsafe usage of merge_state

2011-04-12 Thread Xiao Guangrong
merge_state can free the current state if it can be merged with the next node, but in set_extent_bit(), after merge_state, we still use the current extent to get the next node and cache it into cached_state Signed-off-by: Xiao Guangrong --- fs/btrfs/extent_io.c | 22 ++ 1

[PATCH 1/2] Btrfs: allocate extent state and check the result properly

2011-04-12 Thread Xiao Guangrong
ate fail, we trigger BUG_ON instead of returning -ENOMEM since the return value of clear_extent_bit() is ignored by many callers Signed-off-by: Xiao Guangrong --- fs/btrfs/extent_io.c | 29 + 1 files changed, 21 insertions(+), 8 deletions(-) diff --git a/fs/btrfs/ex

[PATCH] btrfs: using btrfs_stack_device_id() get devid

2010-01-06 Thread Xiao Guangrong
We can use btrfs_stack_device_id() to get dev_item->devid Signed-off-by: Xiao Guangrong --- fs/btrfs/volumes.c |6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c index 198cff2..3b8b2b9 100644 --- a/fs/btrfs/volumes.c +++ b