On Tue, Nov 06, 2012 at 12:33:08PM +, Michael Kjörling wrote:
Can btrfs deal reasonably gracefully with sudden shutdowns? (I'm
mainly thinking of power outages which lead to logical structure
damage but not physical media damage.)
In theory (i.e. by the design of the FS), you should be
On Tue, Nov 06, 2012 at 12:33:08PM +, Michael Kjörling wrote:
Can btrfs deal reasonably gracefully with sudden shutdowns? (I'm
mainly thinking of power outages which lead to logical structure
damage but not physical media damage.)
AFAIK, yes, because btrfs is naturally COW supported,
On 11/02/2012 04:54 PM, Kyle Gates wrote:
So I have ended up in a state where I can't delete files with rm.
the error I get is no space on device. however I'm not even close to empty.
/dev/sdb1 38G 27G 9.5G 75%
there is about 800k files/dirs in this filesystem
extra strange is that I can in
On 6 Nov 2012 12:48 +, from h...@carfax.org.uk (Hugo Mills):
There are also some caveats: while the FS should always be
consistent, the latest transaction write may not have been completed,
so you could potentially lose up to 30 seconds of writes to the FS
from immediately before the
David Sterba wrote (ao):
On Thu, Nov 01, 2012 at 05:17:04AM +0800, ching wrote:
when a device is mounted under a directory, files in the directory
is hidden, and files in the device is available, right? when a
directory is polyinstantied, files in the original directory is
hidden, and
On Tue, Nov 06, 2012 at 01:47:02PM +, Michael Kjörling wrote:
On 6 Nov 2012 12:48 +, from h...@carfax.org.uk (Hugo Mills):
There are also some caveats: while the FS should always be
consistent, the latest transaction write may not have been completed,
so you could potentially
On Tue, Nov 6, 2012 at 9:45 AM, David Sterba d...@jikos.cz wrote:
On Sat, Nov 03, 2012 at 03:10:52PM +1030, Jordan Windsor wrote:
[root@archpc ~]# btrfs fi df /home/jordan/Storage/
Data: total=580.88GB, used=490.88GB
This is getting full, 84%, there is not much chance of getting rid of
Remove the attempt to cancel a running scrub or device replace
operation in btrfs_handle_error() because it adds the risk of
a deadlock. The only penalty of not canceling the operation is
that some I/O remains active until the procedure completes.
This is basically the same thing that happens to
Before this commit, btrfs_map_block() was called with REQ_WRITE
in order to retrieve the list of mirrors for a disk block.
This needs to be changed for the device replace procedure since
it makes a difference whether you are asking for read mirrors
or for locations to write to.
GET_READ_MIRRORS is
This patch adds some code to disallow operations on the device that
is used as the target for the device replace operation.
Signed-off-by: Stefan Behrens sbehr...@giantdisaster.de
---
fs/btrfs/ctree.h | 2 +-
fs/btrfs/extent-tree.c | 3 ++-
fs/btrfs/ioctl.c | 8 +++-
A small number of functions that are used in a device replace
procedure when the operation is resumed at mount time are unable
to pass the same root pointer that would be used in the regular
(ioctl) context. And since the root pointer is not required, only
the fs_info is, the root pointer argument
This new function is used by the device replace procedure in
a later patch.
Signed-off-by: Stefan Behrens sbehr...@giantdisaster.de
---
fs/btrfs/volumes.c | 18 ++
fs/btrfs/volumes.h | 1 +
2 files changed, 19 insertions(+)
diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c
Just move some code into functions to make everything more readable.
Signed-off-by: Stefan Behrens sbehr...@giantdisaster.de
---
fs/btrfs/scrub.c | 106 +--
1 file changed, 71 insertions(+), 35 deletions(-)
diff --git a/fs/btrfs/scrub.c
Signed-off-by: Stefan Behrens sbehr...@giantdisaster.de
---
fs/btrfs/ctree.h | 66 +++
fs/btrfs/print-tree.c | 3 +++
2 files changed, 69 insertions(+)
diff --git a/fs/btrfs/ctree.h b/fs/btrfs/ctree.h
index 57961f1..4bffc63 100644
---
This change of the define is effective in all modes, it
is required and used only in the case when a device replace
procedure is running. The reason is that during an active
device replace procedure, the target device of the copy
operation is a mirror for the filesystem data as well that
can be
This is required for the device replace procedure in a later step.
Two calling functions also had to be changed to have the fs_info
pointer: repair_io_failure() and scrub_setup_recheck_block().
Signed-off-by: Stefan Behrens sbehr...@giantdisaster.de
---
fs/btrfs/check-integrity.c | 2 +-
This patch series adds support for replacing disks at runtime.
It replaces the following steps in case a disk was lost:
mount ... -o degraded
btrfs device add new_disk
btrfs device delete missing
Or in case a disk just needs to be replaced because the error rate
is increasing:
The device replace procedure makes use of the scrub code. The scrub
code is the most efficient code to read the allocated data of a disk,
i.e. it reads sequentially in order to avoid disk head movements, it
skips unallocated blocks, it uses read ahead mechanisms, and it
contains all the code to
The new function btrfs_find_device_missing_or_by_path() will be
used for the device replace procedure. This function itself calls
the second new function btrfs_find_device_by_path().
Unfortunately, it is not possible to currently make the rest of the
code use these functions as well, since all
With the addition of the device replace procedure, it is possible
for btrfs_map_bio(READ) to report an error. This happens when the
specific mirror is requested which is located on the target disk,
and the copy operation has not yet copied this block. Hence the
block cannot be read and this error
Signed-off-by: Stefan Behrens sbehr...@giantdisaster.de
---
fs/btrfs/ctree.h | 39 +++
fs/btrfs/disk-io.c | 5 +
2 files changed, 44 insertions(+)
diff --git a/fs/btrfs/ctree.h b/fs/btrfs/ctree.h
index ef83538..57961f1 100644
--- a/fs/btrfs/ctree.h
+++
This commit contains all the essential changes to the core code
of Btrfs for support of the device replace procedure.
Signed-off-by: Stefan Behrens sbehr...@giantdisaster.de
---
fs/btrfs/Makefile | 2 +-
fs/btrfs/ctree.h | 2 +
fs/btrfs/disk-io.c | 24 +-
fs/btrfs/reada.c
This is the commit that allows to start the device replace
procedure.
An ioctl() interface is added that supports starting and
canceling the device replace procedure, and to retrieve
the status and progress.
Signed-off-by: Stefan Behrens sbehr...@giantdisaster.de
---
fs/btrfs/ioctl.c | 48
This is required for the device replace procedure in a later step.
Signed-off-by: Stefan Behrens sbehr...@giantdisaster.de
---
fs/btrfs/check-integrity.c | 12 ++--
fs/btrfs/disk-io.c | 2 +-
fs/btrfs/extent_io.c | 11 +--
fs/btrfs/volumes.c | 3 ++-
Btrfs admin operations that are manually started from user mode
and that cannot be executed at the same time return -EINPROGRESS.
A common way to enter and leave this locked section is introduced
since it used to be specific to the balance operation.
Signed-off-by: Stefan Behrens
The block device is removed from the scrub context state structure.
The scrub code as it is used for the device replace procedure reads
the source data from whereever it is optimal. The source device might
even be gone (disconnected, for instance due to a hardware failure).
Or the drive can be so
With the modified design (in order to support the devive replace
procedure) it is necessary to alloc the page array dynamically.
The reason is that pages are reused. At first a page is used for
the bio to read the data from the filesystem, then the same page
is reused for the bio that writes the
This adds a new file to the sources together with the header file
and the changes to ioctl.h that are required by the new C source
file.
Signed-off-by: Stefan Behrens sbehr...@giantdisaster.de
---
fs/btrfs/dev-replace.c | 843 +
Make the target disk of a running device replace operation
available for reading. This is only used as a last ressort for
the defect repair procedure. And it is dependent on the location
of the data block to read, because during an ongoing device
replace operation, the target drive is only
During a running dev replace operation, all write requests to
the live filesystem are duplicated to also write to the target
drive. Therefore btrfs_map_block() is changed to duplicate
stripes that are written to the source disk of a device replace
procedure to be written to the target disk as
The device replace procedure makes use of the scrub code. The scrub
code is the most efficient code to read the allocated data of a disk,
i.e. it reads sequentially in order to avoid disk head movements, it
skips unallocated blocks, it uses read ahead mechanisms, and it
contains all the code to
In the scrub repair code, the code is changed to handle memory
allocation errors a little bit smarter. The change is to handle
it just like a read error. This simplifies the code and removes
a couple of lines of code, since the code to handle read errors
is there anyway.
Signed-off-by: Stefan
It is desirable to be able to configure the device replace
procedure to avoid reading the source drive (the one to be
copied) whenever possible. This is useful when the number of
read errors on this disk is high, because it would delay the
copy procedure alot. Therefore there is an option to avoid
This is the user mode part of the device replace patch series.
The command group btrfs replace is added with three commands:
- btrfs replace start mount_point srcdev|srcdevid targetdev [-Bfr]
- btrfs replace status mount_point [-1]
- btrfs replace cancel mount_point
Signed-off-by: Stefan Behrens
On 11/06/2012 19:17, Bart Noordervliet wrote:
Great new feature Stefan, thanks a lot! Going to give it a spin right
away. While compiling I got this (probably superfluous) error that you
might want to prevent:
fs/btrfs/dev-replace.c: In function ‘btrfs_dev_replace_start’:
On Tue, Nov 06, 2012 at 07:57:47PM +0100, Stefan Behrens wrote:
On 11/06/2012 19:17, Bart Noordervliet wrote:
Great new feature Stefan, thanks a lot! Going to give it a spin right
away. While compiling I got this (probably superfluous) error that you
might want to prevent:
tree: git://github.com/ablock84/linux-btrfs.git btrfs-far
head: f9a5bb450a8cc7aa5fd4f11d0306b3f48cf2771d
commit: 29aefeaaf482ab396ff53c2bbf5c35ce237b91c0 [19/20] fs: add libfarstream
support
config: make ARCH=s390 allmodconfig
All error/warnings:
In file included from
We missed to add the default subvolume, because it has no ROOT_BACKREF_ITEM.
This made get_parent always fail for direct decendants of the default
subvolume, resulting in lots of full streams where incremental streams were
requested.
Signed-off-by: Jan Schmidt list.bt...@jan-o-sch.net
Unfortunately, the command line options for btrfs send were misnamed. The
-i option should not be used to give clone sources, we'll be using -c
instead.
Compatibily note: -i option was broken anyway, which makes it less critical
renaming it. For potential users of the old option style, we emit a
After sending v1 some days ago, some onlist and offlist discussion has
brought us to the following conclusions:
- we should fix it as soon as possible
- we should stick to the -p option (parent)
- we should rename the -i option (because it actually means
clone
tree: git://github.com/ablock84/linux-btrfs.git btrfs-far
head: f9a5bb450a8cc7aa5fd4f11d0306b3f48cf2771d
commit: f9a5bb450a8cc7aa5fd4f11d0306b3f48cf2771d [20/20] Btrfs: use
libfarstream for btrfs send
sparse warnings:
+ fs/btrfs/send.c:1683:51: sparse: incorrect type in argument 5
On Tue, Nov 6, 2012 at 9:51 PM, kbuild test robot
fengguang...@intel.com wrote:
tree: git://github.com/ablock84/linux-btrfs.git btrfs-far
head: f9a5bb450a8cc7aa5fd4f11d0306b3f48cf2771d
commit: f9a5bb450a8cc7aa5fd4f11d0306b3f48cf2771d [20/20] Btrfs: use
libfarstream for btrfs send
On Mon, Oct 29, 2012 at 12:30:44PM +0800, zwu.ker...@gmail.com wrote:
+/* Frees the entire hot_range_tree. */
+static void hot_inode_item_free(struct kref *kref)
+{
+ struct hot_comm_item *comm_item = container_of(kref,
+ struct hot_comm_item, refs);
+ struct
On Mon, Oct 29, 2012 at 12:30:45PM +0800, zwu.ker...@gmail.com wrote:
--- a/fs/hot_tracking.c
+++ b/fs/hot_tracking.c
+struct hot_inode_item
+*hot_inode_item_find(struct hot_info *root, u64 ino)
+{
+ struct hot_inode_item *he;
+ int ret;
+
+again:
+ spin_lock(root-lock);
+
On Mon, Oct 29, 2012 at 12:30:45PM +0800, zwu.ker...@gmail.com wrote:
From: Zhi Yong Wu wu...@linux.vnet.ibm.com
Add some util helpers to update access frequencies
for one file or its range.
Signed-off-by: Zhi Yong Wu wu...@linux.vnet.ibm.com
---
fs/hot_tracking.c| 179
Yes, this happens on 32 bit builds, not on 64 bit builds. If you
look at the source code, the compiler is obviously wrong (or I am
blind).
ret = btrfs_dev_replace_find_srcdev(root, args-start.srcdevid,
args-start.srcdev_name,
On Mon, Oct 29, 2012 at 12:30:47PM +0800, zwu.ker...@gmail.com wrote:
--- a/mm/readahead.c
+++ b/mm/readahead.c
@@ -19,6 +19,7 @@
#include linux/pagemap.h
#include linux/syscalls.h
#include linux/file.h
+#include linux/hot_tracking.h
/*
* Initialise a struct file's readahead
On Mon, Oct 29, 2012 at 12:30:52PM +0800, zwu.ker...@gmail.com wrote:
+static struct hot_func_type *hot_func_get(const char *name)
+{
+ struct hot_func_type *f, *h = hot_func_def;
+
+ spin_lock(hot_func_list_lock);
+ list_for_each_entry(f, hot_func_list, list) {
+ if
On Mon, Oct 29, 2012 at 12:30:52PM +0800, zwu.ker...@gmail.com wrote:
From: Zhi Yong Wu wu...@linux.vnet.ibm.com
Introduce one framwork to enable that specific FS
can register its own hot tracking functions.
Signed-off-by: Zhi Yong Wu wu...@linux.vnet.ibm.com
---
fs/hot_tracking.c
On Mon, Oct 29, 2012 at 12:30:54PM +0800, zwu.ker...@gmail.com wrote:
+static int ioctl_heat_info(struct file *file, void __user *argp)
+{
+ struct inode *inode = file-f_dentry-d_inode;
+ struct hot_heat_info *heat_info;
+ struct hot_inode_item *he;
+ int ret = 0;
+
+
On Mon, Oct 29, 2012 at 12:30:56PM +0800, zwu.ker...@gmail.com wrote:
+static int hot_range_seq_show(struct seq_file *seq, void *v)
+{
+ struct hot_range_item *hr = v;
+ struct hot_inode_item *he = hr-hot_inode;
+ struct hot_freq_data *freq_data = hr-hot_range.hot_freq_data;
+
+
On Mon, Oct 29, 2012 at 12:30:58PM +0800, zwu.ker...@gmail.com wrote:
From: Zhi Yong Wu wu...@linux.vnet.ibm.com
Introduce one new mount option '-o hot_track',
and add its parsing support.
Its usage looks like:
mount -o hot_track
mount -o nouser,hot_track
mount -o
On Tue, Nov 06, 2012 at 09:57:47PM +0100, Alexander Block wrote:
On Tue, Nov 6, 2012 at 9:51 PM, kbuild test robot
fengguang...@intel.com wrote:
tree: git://github.com/ablock84/linux-btrfs.git btrfs-far
head: f9a5bb450a8cc7aa5fd4f11d0306b3f48cf2771d
commit:
(2012/11/07 1:38), Stefan Behrens wrote:
The device replace procedure makes use of the scrub code. The scrub
code is the most efficient code to read the allocated data of a disk,
i.e. it reads sequentially in order to avoid disk head movements, it
skips unallocated blocks, it uses read ahead
(2012/11/07 1:38), Stefan Behrens wrote:
This patch series adds support for replacing disks at runtime.
It replaces the following steps in case a disk was lost:
mount ... -o degraded
btrfs device add new_disk
btrfs device delete missing
Or in case a disk just needs to be
On Wed, Nov 7, 2012 at 6:24 AM, David Sterba d...@jikos.cz wrote:
On Mon, Oct 29, 2012 at 12:30:44PM +0800, zwu.ker...@gmail.com wrote:
+/* Frees the entire hot_range_tree. */
+static void hot_inode_item_free(struct kref *kref)
+{
+ struct hot_comm_item *comm_item = container_of(kref,
+
On Wed, Nov 7, 2012 at 6:37 AM, David Sterba d...@jikos.cz wrote:
On Mon, Oct 29, 2012 at 12:30:45PM +0800, zwu.ker...@gmail.com wrote:
--- a/fs/hot_tracking.c
+++ b/fs/hot_tracking.c
+struct hot_inode_item
+*hot_inode_item_find(struct hot_info *root, u64 ino)
+{
+ struct hot_inode_item
On Wed, Nov 7, 2012 at 6:51 AM, David Sterba d...@jikos.cz wrote:
On Mon, Oct 29, 2012 at 12:30:47PM +0800, zwu.ker...@gmail.com wrote:
--- a/mm/readahead.c
+++ b/mm/readahead.c
@@ -19,6 +19,7 @@
#include linux/pagemap.h
#include linux/syscalls.h
#include linux/file.h
+#include
On Wed, Nov 7, 2012 at 7:14 AM, David Sterba d...@jikos.cz wrote:
On Mon, Oct 29, 2012 at 12:30:52PM +0800, zwu.ker...@gmail.com wrote:
+static struct hot_func_type *hot_func_get(const char *name)
+{
+ struct hot_func_type *f, *h = hot_func_def;
+
+ spin_lock(hot_func_list_lock);
+
On Wed, Nov 7, 2012 at 7:30 AM, David Sterba d...@jikos.cz wrote:
On Mon, Oct 29, 2012 at 12:30:54PM +0800, zwu.ker...@gmail.com wrote:
+static int ioctl_heat_info(struct file *file, void __user *argp)
+{
+ struct inode *inode = file-f_dentry-d_inode;
+ struct hot_heat_info
On Wed, Nov 7, 2012 at 7:45 AM, David Sterba d...@jikos.cz wrote:
On Mon, Oct 29, 2012 at 12:30:56PM +0800, zwu.ker...@gmail.com wrote:
+static int hot_range_seq_show(struct seq_file *seq, void *v)
+{
+ struct hot_range_item *hr = v;
+ struct hot_inode_item *he = hr-hot_inode;
+
61 matches
Mail list logo