ENOSPC error when we still have
some free space in the fs.
Signed-off-by: Miao Xie mi...@cn.fujitsu.com
---
Changelog v1 - v2:
- modify the changelog and make it more clear and stringency.
---
fs/btrfs/ctree.h | 7 ---
fs/btrfs/disk-io.c | 18 ++
fs/btrfs/extent-tree.c
We need not use a global lock to protect the delalloc_bytes of the
inode, just use its own lock. In this way, we can reduce the lock
contention and -delalloc_lock will just protect delalloc inode
list.
Signed-off-by: Miao Xie mi...@cn.fujitsu.com
---
Changelog v1 - v2:
- none.
---
fs/btrfs
There is no lock to protect
fs_info-avail_{data, metadata, system}_alloc_bits,
it may introduce some problem, such as the wrong profile
information, so we add a seqlock to protect them.
Signed-off-by: Zhao Lei zhao...@cn.fujitsu.com
Signed-off-by: Miao Xie mi...@cn.fujitsu.com
---
Changelog v1
add other flags,
the above problem will happen to a certainty.
Now we use bit operation for it to fix the above problem.
In this way, we can make the code more robust and be easy to
add new flags.
Signed-off-by: Miao Xie mi...@cn.fujitsu.com
---
Changelog v1 - v2:
- modify the changelog and make
Hi, everyone.
About 1 years ago, we implemented the chunk tree recover function,
but it has not been applied till now because that implementation
need change the disk format.
(http://marc.info/?l=linux-btrfsm=129914269932543w=2
http://marc.info/?l=linux-btrfsm=130976668006281w=2
If the checks at the beginning of btrfs_file_aio_write() fail, we needn't
decrease -sync_writers, because we have not increased it. Fix it.
Signed-off-by: Miao Xie mi...@cn.fujitsu.com
---
fs/btrfs/file.c |3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/fs/btrfs/file.c
When we fail to start a transaction, we need to release the reserved free space
and qgroup space, fix it.
Signed-off-by: Miao Xie mi...@cn.fujitsu.com
---
fs/btrfs/transaction.c | 27 +++
1 files changed, 19 insertions(+), 8 deletions(-)
diff --git a/fs/btrfs
, such as mkdir(), we just use the transaction mechanism, when
we start a transaction, we will check the subvolume is R/O or not.
Signed-off-by: Miao Xie mi...@cn.fujitsu.com
---
fs/btrfs/ctree.h | 18 +-
fs/btrfs/disk-io.c | 36
fs/btrfs
On mon, 28 Jan 2013 13:03:46 +0100, Jan Schmidt wrote:
When start_transaction() returns ENOSPC after btrfs_qgroup_reserve(), we
must call btrfs_qgroup_free() to avoid the qgroup counters increasing when
there's actually no data being written.
Signed-off-by: Jan Schmidt
On thu, 24 Jan 2013 10:53:17 +0200, Alex Lyakas wrote:
Hi Chen,
with all due respect, what do you mean by I see and OK for users?
The semantics of the fallocate API with/without the
FALLOC_FL_PUNCH_HOLE flag is not defined by me or you. As far as I
understand, the file system *must* adhere to
On thu, 24 Jan 2013 11:58:13 +, Hugo Mills wrote:
On Thu, Jan 24, 2013 at 07:39:17PM +0800, Miao Xie wrote:
On thu, 24 Jan 2013 10:53:17 +0200, Alex Lyakas wrote:
Hi Chen,
with all due respect, what do you mean by I see and OK for users?
The semantics of the fallocate API
On thu, 24 Jan 2013 18:20:06 +0200, Alex Lyakas wrote:
- Is there something that user-space can do to avoid flushing the
delalloc during snap-commit? For example, if the user-space stops the
IO and does a normal commit, this will not call
btrfs_start_delalloc_inodes(), but this should ensure
On wed, 23 Jan 2013 16:17:53 +0800, Liu Bo wrote:
On Wed, Jan 23, 2013 at 02:33:27PM +0800, Miao Xie wrote:
On wed, 23 Jan 2013 14:06:21 +0800, Liu Bo wrote:
On Wed, Jan 23, 2013 at 12:44:49PM +0800, Miao Xie wrote:
No, we can't. The other tasks which flush the delalloc data may remove
On Wed, 23 Jan 2013 17:52:14 +0800, Liu Bo wrote:
On Wed, Jan 23, 2013 at 04:58:27PM +0800, Miao Xie wrote:
On wed, 23 Jan 2013 16:17:53 +0800, Liu Bo wrote:
On Wed, Jan 23, 2013 at 02:33:27PM +0800, Miao Xie wrote:
On wed, 23 Jan 2013 14:06:21 +0800, Liu Bo wrote:
On Wed, Jan 23, 2013 at 12
, Jan 23, 2013 at 12:20 PM, Miao Xie mi...@cn.fujitsu.com wrote:
On Wed, 23 Jan 2013 17:52:14 +0800, Liu Bo wrote:
On Wed, Jan 23, 2013 at 04:58:27PM +0800, Miao Xie wrote:
On wed, 23 Jan 2013 16:17:53 +0800, Liu Bo wrote:
On Wed, Jan 23, 2013 at 02:33:27PM +0800, Miao Xie wrote:
On wed, 23 Jan
On mon, 21 Jan 2013 20:37:57 +0200, Alex Lyakas wrote:
Greetings all,
I see the following issue during snap creation under IO:
Transaction commit calls btrfs_start_delalloc_inodes() that locks the
delalloc_inodes list, fetches the first inode, unlocks the list,
triggers
with before, it will fetch the same inode. As a result, this function
allocates a huge amount of btrfs_delalloc_work structures, and OOM happens.
Fix this problem by splice this delalloc list.
Reported-by: Alex Lyakas alex.bt...@zadarastorage.com
Signed-off-by: Miao Xie mi...@cn.fujitsu.com
---
fs
We forget to check the return value of btrfs_start_delalloc_inodes(), fix it.
Signed-off-by: Miao Xie mi...@cn.fujitsu.com
---
fs/btrfs/dev-replace.c |6 +-
fs/btrfs/transaction.c |4 +++-
2 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/fs/btrfs/dev-replace.c b/fs
We forget to check the return value of btrfs_run_ordered_operations() when
flushing all the pending stuffs, fix it.
Signed-off-by: Miao Xie mi...@cn.fujitsu.com
---
fs/btrfs/transaction.c |4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/fs/btrfs/transaction.c b/fs
btrfs_start_delalloc_inodes() needn't traverse and flush the delalloc inodes
repeatedly. It is because we can regard the data that the users write after
we start delalloc inodes flush as the one which is after the delalloc inodes
flush is done, and we can flush it next time.
Signed-off-by: Miao
btrfs_run_ordered_operations() needn't traverse the ordered operation list
repeatedly, it is because the transaction commiter will invoke it again when
there is no other writer in this transaction, it can ensure that no one can
add new objects into the ordered operation list.
Signed-off-by: Miao
On Tue, 22 Jan 2013 22:24:15 +0800, Liu Bo wrote:
On Tue, Jan 22, 2013 at 06:49:00PM +0800, Miao Xie wrote:
btrfs_start_delalloc_inodes() locks the delalloc_inodes list, fetches the
first inode, unlocks the list, triggers btrfs_alloc_delalloc_work/
btrfs_queue_worker for this inode
On wed, 23 Jan 2013 11:56:55 +0800, Liu Bo wrote:
On Wed, Jan 23, 2013 at 10:54:39AM +0800, Miao Xie wrote:
On Tue, 22 Jan 2013 22:24:15 +0800, Liu Bo wrote:
On Tue, Jan 22, 2013 at 06:49:00PM +0800, Miao Xie wrote:
btrfs_start_delalloc_inodes() locks the delalloc_inodes list, fetches
On wed, 23 Jan 2013 14:06:21 +0800, Liu Bo wrote:
On Wed, Jan 23, 2013 at 12:44:49PM +0800, Miao Xie wrote:
No, we can't. The other tasks which flush the delalloc data may remove the
inode
from the delalloc list/splice list. If we release the lock, we will meet the
race
between list
On wed, 16 Jan 2013 11:03:13 +0800, Liu Bo wrote:
This adds a leak decoder callback so that slab destruction
can use to generate debugging output for the allocated objects.
Callers like btrfs are using their own leak tracking which will
manage allocated objects in a list(or something else),
On tue, 15 Jan 2013 12:03:03 +0800, Liu Bo wrote:
On Mon, Jan 14, 2013 at 03:50:31PM +0800, Miao Xie wrote:
On thu, 10 Jan 2013 18:57:35 +0100, David Sterba wrote:
On Thu, Jan 10, 2013 at 08:51:59PM +0800, Miao Xie wrote:
There is no lock to protect fs_info-fs_state, it will introduce some
We may access and update transaction-aborted on the different CPUs without
lock, so we need ACCESS_ONCE() wrapper to prevent the compiler from creating
unsolicited accesses and make sure we can get the right value.
Signed-off-by: Miao Xie mi...@cn.fujitsu.com
---
Changelog v1 - v2:
- modify
threads to
flush the space cache and inode cache. Those threads also allocate some
transaction
handles and may set transaction-aborted if some serious error happens.
So we need more check for -aborted when committing the transaction. Fix it.
Signed-off-by: Miao Xie mi...@cn.fujitsu.com
On thu, 10 Jan 2013 18:38:00 +0100, David Sterba wrote:
On Thu, Jan 10, 2013 at 08:53:03PM +0800, Miao Xie wrote:
We may access and update transaction-abort on the different CPUs without
lock,
so we need ACCESS_ONCE() wrapper to make sure we can get the new value.
ACCESS_ONCE
fs_info-generation is a 64bit variant, we might get a wrong number on
the 32bit machines if there is no lock or other methods to protect it.
Signed-off-by: Zhao Lei zhao...@cn.fujitsu.com
Signed-off-by: Miao Xie mi...@cn.fujitsu.com
---
fs/btrfs/ctree.c | 7 ---
fs/btrfs/ctree.h
fs_info-last_trans_committed is a 64bits variant, we might get a wrong
value on the 32bit machines if we access it directly. Fix it by atomic
operation.
Signed-off-by: Zhao Lei zhao...@cn.fujitsu.com
Signed-off-by: Miao Xie mi...@cn.fujitsu.com
---
fs/btrfs/ctree.h| 2 +-
fs/btrfs/disk
fs_info-last_trans_log_full_commit is a 64bits variant, we might get a
wrong value on the 32bit machines if we access it directly. Fix it by atomic
operation.
Signed-off-by: Zhao Lei zhao...@cn.fujitsu.com
Signed-off-by: Miao Xie mi...@cn.fujitsu.com
---
fs/btrfs/ctree.h | 2 +-
fs/btrfs
We need not add anything to protect fs_info-max_inline, but we need a comment
to
explain why we don't add a lock to protect it.
Signed-off-by: Miao Xie mi...@cn.fujitsu.com
---
fs/btrfs/ctree.h | 6 ++
1 file changed, 6 insertions(+)
diff --git a/fs/btrfs/ctree.h b/fs/btrfs/ctree.h
index
of them.
Signed-off-by: Zhao Lei zhao...@cn.fujitsu.com
Signed-off-by: Miao Xie mi...@cn.fujitsu.com
---
fs/btrfs/ctree.h | 10 ++
fs/btrfs/super.c | 4
2 files changed, 14 insertions(+)
diff --git a/fs/btrfs/ctree.h b/fs/btrfs/ctree.h
index 3e672916..201be7d 100644
--- a/fs/btrfs
-dirty_metadata_bytes is accessed very frequently, so use percpu counter
instead of the u64 variant to reduce the contention of the lock.
Signed-off-by: Miao Xie mi...@cn.fujitsu.com
---
fs/btrfs/ctree.h | 9
fs/btrfs/disk-io.c | 64
fs_info-delalloc_bytes is accessed very frequently, so use percpu counter
instead of the u64 variant for it to reduce the lock contention.
Signed-off-by: Miao Xie mi...@cn.fujitsu.com
---
fs/btrfs/ctree.h | 7 ---
fs/btrfs/disk-io.c | 18 ++
fs/btrfs/extent-tree.c
We need not use a global lock to protect the delalloc_bytes of the inode, just
use its own lock. In this way, we can reduce the lock contention and
-delalloc_lock will just protect delalloc inode list.
Signed-off-by: Miao Xie mi...@cn.fujitsu.com
---
fs/btrfs/btrfs_inode.h | 1 +
fs/btrfs/disk
There is no lock to protect fs_info-avail_{data, metadata, system}_alloc_bits,
it may introduce some problem, such as the wrong profile information, so we add
a seqlock to protect them.
Signed-off-by: Zhao Lei zhao...@cn.fujitsu.com
Signed-off-by: Miao Xie mi...@cn.fujitsu.com
---
fs/btrfs
There is no lock to protect fs_info-fs_state, it will introduce some problems,
such as the value may be covered by the other task when several tasks modify
it. Now we use bit operation for it to fix the above problem.
Signed-off-by: Miao Xie mi...@cn.fujitsu.com
---
fs/btrfs/ctree.h | 4
We may access and update transaction-abort on the different CPUs without lock,
so we need ACCESS_ONCE() wrapper to make sure we can get the new value.
Signed-off-by: Miao Xie mi...@cn.fujitsu.com
---
fs/btrfs/super.c | 2 +-
fs/btrfs/transaction.c | 9 -
2 files changed, 5
Hi, Arne
On Wed, 19 Dec 2012 12:40:25 +0100, Arne Jansen wrote:
On 19.12.2012 12:25, Miao Xie wrote:
As we know, there is no backup function for qgroup. when the problem
occurs, the users must recover qgroup configuration manually, it is not
convenient. And besides that, some users might want
On Fri, 28 Dec 2012 15:33:38 +0100, David Sterba wrote:
On Thu, Dec 20, 2012 at 06:09:35PM +0800, Miao Xie wrote:
--- a/fs/fs-writeback.c
+++ b/fs/fs-writeback.c
@@ -1314,7 +1314,6 @@ void writeback_inodes_sb_nr(struct super_block *sb,
bdi_queue_work(sb-s_bdi, work
from r/w to r/o.
because the filesystem should guarantee all the dirty pages have been written
into the disk after it becomes readonly, so the sync operation will do nothing
if the filesystem is already readonly. Though it may waste lots of time,
as a corner case, we needn't care.
Signed-off-by: Miao
writeback_inodes_sb(_nr)_if_idle().
The name of these two functions is cumbersome, so rename them to
try_to_writeback_inodes_sb(_nr).
This idea came from Christoph Hellwig.
Some code is from the patch of Kamal Mostafa.
Signed-off-by: Miao Xie mi...@cn.fujitsu.com
---
Changelog v1 - v2:
- do not remove
from r/w to r/o.
because the filesystem should guarantee all the dirty pages have been written
into the disk after it becomes readonly, so the sync operation will do nothing
if the filesystem is already readonly. Though it may waste lots of time,
as a corner case, we needn't care.
Signed-off-by: Miao
Use wrapper page_offset to get byte-offset into filesystem object for page.
Signed-off-by: Liu Bo liubo2...@cn.fujitsu.com
Signed-off-by: Miao Xie mi...@cn.fujitsu.com
---
fs/btrfs/disk-io.c| 2 +-
fs/btrfs/extent_io.c | 24 +++-
fs/btrfs/inode.c | 5 ++---
fs
We forget to give up the write access after we find some device operation
is going on. Fix it.
Signed-off-by: Miao Xie mi...@cn.fujitsu.com
---
fs/btrfs/ioctl.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c
index 7624212..679b82c
We should not resize a readonly device, fix it.
Signed-off-by: Miao Xie mi...@cn.fujitsu.com
---
fs/btrfs/ioctl.c | 6 --
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c
index 679b82c..668475c 100644
--- a/fs/btrfs/ioctl.c
+++ b/fs/btrfs
This patch fixes the following problem:
- improper return value
- unnecessary read-only check
Signed-off-by: Miao Xie mi...@cn.fujitsu.com
---
fs/btrfs/ioctl.c | 13 +++--
1 file changed, 7 insertions(+), 6 deletions(-)
diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c
index 668475c
On Fri, 21 Dec 2012 11:22:52 +0100, Stefan Behrens wrote:
On Fri, 21 Dec 2012 17:19:20 +0800, Miao Xie wrote:
-pr_info(btrfs: dev add/delete/balance/replace/resize operation
in progress\n);
+pr_info(btrfs: dev add/delete/balance/replace/resize operation
From: Miao Xie mi...@cn.fujitsu.com
We may try to flush some dirty pages when there is no enough space to reserve.
But it is possible that this operation fails, in order to get enough space to
reserve successfully, we will sync all the delalloc file. This operation is
safe, we needn't worry about
Locking and unlocking delayed ref mutex are in the different functions,
and the name of lock functions is not uniform, so the readability is not
so good, this patch optimizes the lock logic and makes it more readable.
Signed-off-by: Miao Xie mi...@cn.fujitsu.com
---
fs/btrfs/delayed-ref.c | 8
Hi, everyone.
As we know, there is no backup function for qgroup. when the problem
occurs, the users must recover qgroup configuration manually, it is not
convenient. And besides that, some users might want to import an existed
qgroup configuration into a new filesystem. Btrfs does not have such
On wed, 19 Dec 2012 10:02:59 -0500, Josef Bacik wrote:
On Tue, Dec 18, 2012 at 06:58:33PM -0700, Miao Xie wrote:
On tue, 18 Dec 2012 15:51:57 -0500, Josef Bacik wrote:
We're deleting the stupid thing, no sense in updating the inode for the new
size. We're running into having 50-100
On Wed, 19 Dec 2012 12:40:25 +0100, Arne Jansen wrote:
On 19.12.2012 12:25, Miao Xie wrote:
Hi, everyone.
As we know, there is no backup function for qgroup. when the problem
occurs, the users must recover qgroup configuration manually, it is not
convenient. And besides that, some users
On tue, 18 Dec 2012 15:30:51 +0800, Liu Bo wrote:
On Mon, Dec 17, 2012 at 11:13:25PM -0800, cli...@linux.vnet.ibm.com wrote:
From: Wade Cline cli...@linux.vnet.ibm.com
v1 - v2:
- Added Signed-off-by tag (it's kind of important).
This patch is only an RFC. My internship is ending and I was
The delayed item commit code in several functions is similar, so
cleanup it.
Signed-off-by: Miao Xie mi...@cn.fujitsu.com
---
fs/btrfs/delayed-inode.c | 83 +---
1 file changed, 37 insertions(+), 46 deletions(-)
diff --git a/fs/btrfs/delayed-inode.c b
-by: Josef Bacik jba...@fusionio.com
Signed-off-by: Miao Xie mi...@cn.fujitsu.com
---
fs/btrfs/delayed-inode.c | 90 +---
fs/btrfs/delayed-inode.h | 1 +
fs/btrfs/inode.c | 11 +++---
3 files changed, 85 insertions(+), 17 deletions(-)
diff --git
On mon, 17 Dec 2012 19:22:11 +0800, Jeff Liu wrote:
Introduce a new ioctl BTRFS_IOC_SET_FSLABEL to change the label of a mounted
file system.
Signed-off-by: Jie Liu jeff@oracle.com
Signed-off-by: Anand Jain anand.j...@oracle.com
Cc: Miao Xie mi...@cn.fujitsu.com
---
fs/btrfs
On mon, 17 Dec 2012 19:22:02 +0800, Jeff Liu wrote:
Introduce a new ioctl BTRFS_IOC_GET_FSLABEL to fetch the label of a mounted
file system.
Signed-off-by: Jie Liu jeff@oracle.com
Signed-off-by: Anand Jain anand.j...@oracle.com
Cc: Miao Xie mi...@cn.fujitsu.com
Reviewed-by: Miao
On mon, 17 Dec 2012 18:34:41 +0100, Goffredo Baroncelli wrote:
On 12/17/2012 02:30 PM, Jeff Liu wrote:
On 12/17/2012 07:57 PM, Miao Xie wrote:
On mon, 17 Dec 2012 19:22:11 +0800, Jeff Liu wrote:
Introduce a new ioctl BTRFS_IOC_SET_FSLABEL to change the label of a
mounted file system
On Tue, 18 Dec 2012 11:06:07 +0800, Jeff Liu wrote:
Introduce a new ioctl BTRFS_IOC_SET_FSLABEL to change the label of a mounted
file system.
Signed-off-by: Jie Liu jeff@oracle.com
Signed-off-by: Anand Jain anand.j...@oracle.com
Cc: Miao Xie mi...@cn.fujitsu.com
Cc: Goffredo
On fri, 14 Dec 2012 12:51:06 -0500, Josef Bacik wrote:
On Mon, Nov 26, 2012 at 02:28:13AM -0700, Miao Xie wrote:
If we remount the fs to close the auto defragment or make the fs R/O, we
should
stop the auto defragment.
Signed-off-by: Miao Xie mi...@cn.fujitsu.com
I'm dropping
On wed, 12 Dec 2012 23:26:02 -0500, Sylvain Alain wrote:
Hi guys, I noticed that now my snapshot take a long time to process :
sylvain@gentootux ~ $ df -h
Sys. de fichiers Taille Utilisé Dispo Uti% Monté sur
rootfs 112G4,0G 103G 4% /
/dev/sda4 112G4,0G 103G
Any comment about this patch?
On mon, 26 Nov 2012 16:51:36 +0800, Miao Xie wrote:
Without this patch, we can add a device into the R/O fs.
Steps to reproduce:
# mkfs.btrfs -d single -m single disk0 disk1
# mount -o ro disk0 mnt0
# mount -o ro disk0 mnt1
# mount -o remount,rw mnt0
Hi, Liu
On wed, 12 Dec 2012 08:22:28 +0800, Jeff Liu wrote:
Add a new ioctl BTRFS_FS_SETLABEL to change the label of a mounted filesystem.
Signed-off-by: Jie Liu jeff@oracle.com
Signed-off-by: Anand Jain anand.j...@oracle.com
---
fs/btrfs/ioctl.c | 14 ++
On Wed, 12 Dec 2012 11:22:49 +0800, Jeff Liu wrote:
Signed-off-by: Jie Liu jeff@oracle.com
Signed-off-by: Anand Jain anand.j...@oracle.com
---
fs/btrfs/ioctl.c | 14 ++
fs/btrfs/ioctl.h |2 ++
2 files changed, 16 insertions(+)
diff --git a/fs/btrfs/ioctl.c
On wed, 12 Dec 2012 11:23:00 +0800, Jeff Liu wrote:
Add a new ioctl BTRFS_FS_SETLABEL to change the label of a mounted filesystem.
Signed-off-by: Jie Liu jeff@oracle.com
Signed-off-by: Anand Jain anand.j...@oracle.com
---
fs/btrfs/ioctl.c | 34 ++
The patchset enhanced btrfs qgroup show command.
Firstly, we restructure show_qgroups, make it easy to add new features.
And then we add '-p' '-c', '-l',and '-e' options to print the parent
qgroup id, child qgroup id, max referenced size and max exclusive size
of qgroup respectively, add '-F'
...@cn.fujitsu.com
Signed-off-by: Miao Xie mi...@cn.fujitsu.com
---
cmds-qgroup.c | 96 +--
ctree.h | 11 ++
qgroup.c | 509 ++
qgroup.h | 9 ++
4 files changed, 530 insertions(+), 95 deletions(-)
diff --git a/cmds
From: Wang Shilong wangsl-f...@cn.fujitsu.com
This patch introduces '-l' option to print max referenced size of qgroups.
You may use it like:
btrfs qgroup show -l path
Signed-off-by: Wang Shilong wangsl-f...@cn.fujitsu.com
Signed-off-by: Miao Xie mi...@cn.fujitsu.com
---
cmds
From: Wang Shilong wangsl-f...@cn.fujitsu.com
This patch introduce '-e' option to print max exclusive size of qgroups.
You may use it like this:
btrfs qgroup -e path
Signed-off-by: Wang Shilong wangsl-f...@cn.fujitsu.com
Signed-off-by: Miao Xie mi...@cn.fujitsu.com
---
cmds
-- -- 1/0,1/1
Signed-off-by: Wang Shilong wangsl-f...@cn.fujitsu.com
Signed-off-by: Miao Xie mi...@cn.fujitsu.com
---
cmds-qgroup.c | 9 +++--
qgroup.c | 22 ++
qgroup.h | 1 +
3 files changed, 30 insertions(+), 2 deletions(-)
diff --git a/cmds-qgroup.c b/cmds
-by: Wang shilong wangsl-f...@cn.fujitsu.com
Signed-off-by: Miao Xie mi...@cn.fujitsu.com
---
cmds-qgroup.c | 25 --
qgroup.c | 239 +-
qgroup.h | 27 ++-
3 files changed, 281 insertions(+), 10 deletions(-)
diff --git a/cmds
-by: Miao Xie mi...@cn.fujitsu.com
---
cmds-qgroup.c | 14 --
qgroup.c | 16 +++-
qgroup.h | 1 +
3 files changed, 28 insertions(+), 3 deletions(-)
diff --git a/cmds-qgroup.c b/cmds-qgroup.c
index b6cdb53..9447179 100644
--- a/cmds-qgroup.c
+++ b/cmds-qgroup.c
to combine sort items, you do it like that:
btrfs qgroup show --sort=-qgroupid,+rfer,max_rfer,excl path
Signed-off-by: Wang Shilong wangsl-f...@cn.fujitsu.com
Signed-off-by: Miao Xie mi...@cn.fujitsu.com
---
cmds-qgroup.c | 26 +-
qgroup.c | 254
1289752576 0 ---
1/0 0 0 10999511627776 2/0,3/0
2/0 0 0 0 ---
3/0 0 0 0 ---
Signed-off-by: Wang shilong wangsl-f...@cn.fujitsu.com
Signed-off-by: Miao Xie mi...@cn.fujitsu.com
---
cmds
If we runt the direct IO, we should not run auto defrag, because it may
introduce buffered IO vs direcIO problem, and make direct IO slow down.
Signed-off-by: Miao Xie mi...@cn.fujitsu.com
---
fs/btrfs/inode.c | 3 ---
1 file changed, 3 deletions(-)
diff --git a/fs/btrfs/inode.c b/fs/btrfs
We forget to release the reserved space in the error path of delalloc
reservatiom, fix it.
Signed-off-by: Miao Xie mi...@cn.fujitsu.com
---
fs/btrfs/extent-tree.c | 7 +++
1 file changed, 7 insertions(+)
diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c
index 3d3e2c1..1cd71b2
reserved the space twice.
In fact, we needn't truncate the page if it is beyond the end of the file, just
release the allocated space in that range. Fix the above problem by this way.
Signed-off-by: Miao Xie mi...@cn.fujitsu.com
---
fs/btrfs/file.c | 16 +---
1 file changed, 9 insertions
command
changes the file size, we must run several commands to reclaim the space if we
don't want to change the file size, so it is not a good choice.
Signed-off-by: Miao Xie mi...@cn.fujitsu.com
---
fs/btrfs/file.c | 22 --
1 file changed, 12 insertions(+), 10 deletions(-)
diff
ret variant may be set to 0 if we read page successfully, but it might be
released before we lock it again. On this case, if we fail to allocate a
new page, we will return 0, it is wrong, fix it.
Signed-off-by: Miao Xie mi...@cn.fujitsu.com
---
fs/btrfs/inode.c | 3 +--
1 file changed, 1
On wed, 28 Nov 2012 18:02:56 +0800, Anand Jain wrote:
On 11/28/2012 11:05 AM, Miao Xie wrote:
On wed, 28 Nov 2012 02:29:17 +0800, Anand jain wrote:
/*
@@ -2441,6 +2443,14 @@ static inline bool btrfs_root_readonly(struct
btrfs_root *root)
{
return (root-root_item.flags
The kernel developers have implemented some often-used align macros, we should
use them instead of the complex code.
Signed-off-by: Miao Xie mi...@cn.fujitsu.com
---
fs/btrfs/file.c | 8
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/fs/btrfs/file.c b/fs/btrfs/file.c
alloc_end is not the real end of the current extent, it is the start of the
next adjoining extent. So we needn't +1 when calculating the size the space
that is about to be reserved.
Signed-off-by: Miao Xie mi...@cn.fujitsu.com
---
fs/btrfs/file.c | 4 ++--
1 file changed, 2 insertions(+), 2
On wed, 28 Nov 2012 02:29:17 +0800, Anand jain wrote:
/*
@@ -2441,6 +2443,14 @@ static inline bool btrfs_root_readonly(struct
btrfs_root *root)
{
return (root-root_item.flags cpu_to_le64(BTRFS_ROOT_SUBVOL_RDONLY))
!= 0;
}
+static inline char * btrfs_root_label(struct
it RFC.
We can pull this patchset from the URL
git://github.com/miaoxie/linux-btrfs.git readonly
Thanks
Miao
---
Miao Xie (9):
Btrfs: pass root object into btrfs_ioctl_{start, wait}_sync()
Btrfs: don't start a new transaction when starting sync
Btrfs: fix wrong return value
Since we have gotten the root in the caller, just pass it into
btrfs_ioctl_{start, wait}_sync() directly.
Signed-off-by: Miao Xie mi...@cn.fujitsu.com
---
fs/btrfs/ioctl.c | 12 ++--
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c
index
If there is no running transaction in the fs, we needn't start a new one when
we want to start sync.
Signed-off-by: Miao Xie mi...@cn.fujitsu.com
---
fs/btrfs/ioctl.c | 14 ++
fs/btrfs/transaction.c | 13 -
2 files changed, 18 insertions(+), 9 deletions(-)
diff
If the id of the existed transaction is more than the one we specified, it
means the specified transaction was commited, so we should return 0, not
EINVAL.
Signed-off-by: Miao Xie mi...@cn.fujitsu.com
---
fs/btrfs/transaction.c | 15 ---
1 file changed, 8 insertions(+), 7 deletions
When wen want to set the default subvolume, we must get write access, or
we will change the R/O file system.
Signed-off-by: Miao Xie mi...@cn.fujitsu.com
---
fs/btrfs/ioctl.c | 40
1 file changed, 28 insertions(+), 12 deletions(-)
diff --git a/fs/btrfs
, because the kernel may set the
R/O flag only for the mount point. We need invoke mnt_want_write_file() to
do a full check.
Signed-off-by: Miao Xie mi...@cn.fujitsu.com
---
fs/btrfs/ioctl.c | 13 -
1 file changed, 8 insertions(+), 5 deletions(-)
diff --git a/fs/btrfs/ioctl.c b/fs/btrfs
of the super block object. It is not enough, because the kernel
may set the R/O flag only for the mount point. We need invoke
mnt_want_write_file()
to do a full check.
Signed-off-by: Miao Xie mi...@cn.fujitsu.com
---
fs/btrfs/ioctl.c | 11 +++
1 file changed, 7 insertions(+), 4 deletions
We need get write access for scrub, or we will modify the R/O fs.
Signed-off-by: Miao Xie mi...@cn.fujitsu.com
---
fs/btrfs/ioctl.c | 16 +---
1 file changed, 13 insertions(+), 3 deletions(-)
diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c
index 5921bb9..a7afafa 100644
--- a/fs
We need get write access for qgroup operations, or we will modify the R/O fs.
Signed-off-by: Miao Xie mi...@cn.fujitsu.com
---
fs/btrfs/ioctl.c | 73 +---
1 file changed, 48 insertions(+), 25 deletions(-)
diff --git a/fs/btrfs/ioctl.c b/fs
is based on a seed filesystem
immediately after it is created, needn't do remount/umount-mount.
Signed-off-by: Miao Xie mi...@cn.fujitsu.com
---
fs/btrfs/ioctl.c | 81 ++
fs/btrfs/super.c | 5 ++--
fs/btrfs/volumes.c | 26
The auto defrag allocation is in the fast path of the IO, so use slabs
to improve the speed of the allocation.
And besides that, it can do check for leaked objects when the module is removed.
Signed-off-by: Miao Xie mi...@cn.fujitsu.com
---
fs/btrfs/ctree.h | 2 ++
fs/btrfs/file.c | 28
We forget to get the defrag lock when we re-add the defragable inode,
Fix it.
Signed-off-by: Miao Xie mi...@cn.fujitsu.com
---
fs/btrfs/file.c | 70 -
1 file changed, 55 insertions(+), 15 deletions(-)
diff --git a/fs/btrfs/file.c b/fs
This patch restructure btrfs_run_defrag_inodes() and make the code of the auto
defragment more readable.
Signed-off-by: Miao Xie mi...@cn.fujitsu.com
---
fs/btrfs/ctree.h | 1 +
fs/btrfs/disk-io.c | 2 +-
fs/btrfs/file.c| 197 +
3
If we freeze the fs, the auto defragment should not run. Fix it.
Signed-off-by: Miao Xie mi...@cn.fujitsu.com
---
fs/btrfs/file.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/fs/btrfs/file.c b/fs/btrfs/file.c
index 6ca2b46..40b17d0 100644
--- a/fs/btrfs/file.c
+++ b/fs/btrfs/file.c
501 - 600 of 1023 matches
Mail list logo