Skip to contentSkip to conversation

Btrfs updates

GIT PULL Chris Mason 9 participants 10 messages Jan 17, 2011 – Mar 9, 2011 Btrfs file system

lore
Share & tools
lore
#0 lore raw

Hi everyone,

The for-linus branch of the btrfs-unstable git tree:

git://git.kernel.org/pub/scm/linux/kernel/git/mason/btrfs-unstable.git for-linus

Has our collection of features and fixes for 2.6.38-rc1. The git tree is actually against 2.6.36 and these commits have been tested against .36, .37 and Linus' current git. There's no particular reason for the .36 part, other than it's what one of my build boxes was running.

The highlights this time around are LZO compression from Li Zefan and a large collection of multi-device fixes from Miao Xie. Liubo kicked in the start of our forced-readonly support, which will be the building block for ripping out a big collection of BUG_ONs and replacing them with kinder gentler error messages.

Li Zefan also added readonly snapshot support, and I'll have the corresponding btrfs-progs changes integrated this week.

This pull does have a duplicate for the btrfs ctree.c build fix that Linus already has in his tree. Git merge seems to do magic on this one, it applies without doing a duplicate #include.

Li Zefan (9) commits (+1354/-542):
Btrfs: Add BTRFS_IOC_SUBVOL_GETFLAGS/SETFLAGS ioctls (+85/-0)
btrfs: Allow to specify compress method when defrag (+26/-2)
btrfs: Allow to add new compression algorithm (+473/-282)
btrfs: Extract duplicate decompress code (+115/-194)
Btrfs: Refactor btrfs_ioctl_snap_create() (+40/-44)
Btrfs: Add readonly snapshots support (+75/-10)
btrfs: Add lzo compression support (+527/-8)
btrfs: Fix error handling in zlib (+8/-0)
btrfs: Fix bugs in zlib workspace (+5/-2)

Miao Xie (6) commits (+695/-186):
btrfs: make the chunk allocator utilize the devices better (+300/-103)
btrfs: try to reclaim some space when chunk allocation fails (+7/-2)
btrfs: fix wrong free space information of btrfs (+286/-7)
btrfs: restructure find_free_dev_extent() (+91/-68)
btrfs: fix wrong calculation of stripe size (+8/-2)
btrfs: fix wrong data space statistics (+3/-4)

Jesper Juhl (2) commits (+5/-1):
btrfs: Don't pass NULL ptr to func that may deref it. (+2/-0)
btrfs: Mem leak in btrfs_get_acl() (+3/-1)

Tsutomu Itoh (2) commits (+17/-0):
btrfs: Fix memory leak in btrfs_read_fs_root_no_radix() (+1/-0)
btrfs: check NULL or not (+16/-0)

Stefan Schmidt (1) commits (+1/-0):
fs/btrfs: Fix build of ctree

Ben Hutchings (1) commits (+4/-0):
btrfs: Require CAP_SYS_ADMIN for filesystem rebalance

Chris Mason (1) commits (+2/-1):
Btrfs: fix off by one while setting block groups readonly

Dave Young (1) commits (+8/-4):
btrfs: mount failure return value fix

liubo (1) commits (+523/-2):
Btrfs: forced readonly mounts on errors

Josef Bacik (1) commits (+0/-5):
Btrfs: don't warn if we get ENOSPC in btrfs_block_rsv_check

Total: (25) commits (+2609/-741)

 fs/btrfs/Kconfig        |    2 +
 fs/btrfs/Makefile       |    2 +-
 fs/btrfs/acl.c          |    4 +-
 fs/btrfs/btrfs_inode.h  |    2 +-
 fs/btrfs/compression.c  |  329 ++++++++++++++++++++++++-
 fs/btrfs/compression.h  |   72 ++++--
 fs/btrfs/ctree.c        |    8 +
 fs/btrfs/ctree.h        |   49 ++++-
 fs/btrfs/disk-io.c      |  412 ++++++++++++++++++++++++++++++-
 fs/btrfs/disk-io.h      |    1 +
 fs/btrfs/extent-tree.c  |   90 ++++++-
 fs/btrfs/extent_io.c    |    7 +-
 fs/btrfs/extent_io.h    |   17 ++-
 fs/btrfs/extent_map.c   |    2 +
 fs/btrfs/extent_map.h   |    3 +-
 fs/btrfs/file.c         |   13 +
 fs/btrfs/inode.c        |   90 +++++---
 fs/btrfs/ioctl.c        |  220 +++++++++++++----
 fs/btrfs/ioctl.h        |   12 +-
 fs/btrfs/lzo.c          |  420 +++++++++++++++++++++++++++++++
 fs/btrfs/ordered-data.c |   18 ++-
 fs/btrfs/ordered-data.h |    8 +-
 fs/btrfs/super.c        |  281 ++++++++++++++++++++--
 fs/btrfs/transaction.c  |   11 +
 fs/btrfs/transaction.h  |    1 +
 fs/btrfs/volumes.c      |  626 ++++++++++++++++++++++++++++++++++-------------
 fs/btrfs/volumes.h      |   27 ++
 fs/btrfs/xattr.c        |   18 ++
 fs/btrfs/zlib.c         |  369 ++++++----------------------
 29 files changed, 2491 insertions(+), 623 deletions(-)
#1 lore raw

Hi,

just slap me if the question is stupid, but when will all those new features be added to the btrfs-progs?

The last commit is at "git://git.kernel.org/pub/scm/linux/kernel/git/mason/btrfs-progs-unstable.git" is from oct. 2010?!?

Regards,
Felix

Quoted 107 lines · Chris Mason

Date: Mon, 17 Jan 2011 16:13:01 -0500
From: Chris Mason <[email protected]>
To: Linus Torvalds <[email protected]>, Linux Btrfs
<[email protected]>, linux-kernel <[email protected]>
Subject: [GIT PULL] Btrfs updates

Hi everyone,

The for-linus branch of the btrfs-unstable git tree:

git://git.kernel.org/pub/scm/linux/kernel/git/mason/btrfs-unstable.git for-linus

Has our collection of features and fixes for 2.6.38-rc1. The git tree is actually against 2.6.36 and these commits have been tested against .36, .37 and Linus' current git. There's no particular reason for the .36 part, other than it's what one of my build boxes was running.

The highlights this time around are LZO compression from Li Zefan and a large collection of multi-device fixes from Miao Xie. Liubo kicked in the start of our forced-readonly support, which will be the building block for ripping out a big collection of BUG_ONs and replacing them with kinder gentler error messages.

Li Zefan also added readonly snapshot support, and I'll have the corresponding btrfs-progs changes integrated this week.

This pull does have a duplicate for the btrfs ctree.c build fix that Linus already has in his tree. Git merge seems to do magic on this one, it applies without doing a duplicate #include.

Li Zefan (9) commits (+1354/-542):
Btrfs: Add BTRFS_IOC_SUBVOL_GETFLAGS/SETFLAGS ioctls (+85/-0)
btrfs: Allow to specify compress method when defrag (+26/-2)
btrfs: Allow to add new compression algorithm (+473/-282)
btrfs: Extract duplicate decompress code (+115/-194)
Btrfs: Refactor btrfs_ioctl_snap_create() (+40/-44)
Btrfs: Add readonly snapshots support (+75/-10)
btrfs: Add lzo compression support (+527/-8)
btrfs: Fix error handling in zlib (+8/-0)
btrfs: Fix bugs in zlib workspace (+5/-2)

Miao Xie (6) commits (+695/-186):
btrfs: make the chunk allocator utilize the devices better (+300/-103)
btrfs: try to reclaim some space when chunk allocation fails (+7/-2)
btrfs: fix wrong free space information of btrfs (+286/-7)
btrfs: restructure find_free_dev_extent() (+91/-68)
btrfs: fix wrong calculation of stripe size (+8/-2)
btrfs: fix wrong data space statistics (+3/-4)

Jesper Juhl (2) commits (+5/-1):
btrfs: Don't pass NULL ptr to func that may deref it. (+2/-0)
btrfs: Mem leak in btrfs_get_acl() (+3/-1)

Tsutomu Itoh (2) commits (+17/-0):
btrfs: Fix memory leak in btrfs_read_fs_root_no_radix() (+1/-0)
btrfs: check NULL or not (+16/-0)

Stefan Schmidt (1) commits (+1/-0):
fs/btrfs: Fix build of ctree

Ben Hutchings (1) commits (+4/-0):
btrfs: Require CAP_SYS_ADMIN for filesystem rebalance

Chris Mason (1) commits (+2/-1):
Btrfs: fix off by one while setting block groups readonly

Dave Young (1) commits (+8/-4):
btrfs: mount failure return value fix

liubo (1) commits (+523/-2):
Btrfs: forced readonly mounts on errors

Josef Bacik (1) commits (+0/-5):
Btrfs: don't warn if we get ENOSPC in btrfs_block_rsv_check

Total: (25) commits (+2609/-741)

 fs/btrfs/Kconfig        |    2 +
 fs/btrfs/Makefile       |    2 +-
 fs/btrfs/acl.c          |    4 +-
 fs/btrfs/btrfs_inode.h  |    2 +-
 fs/btrfs/compression.c  |  329 ++++++++++++++++++++++++-
 fs/btrfs/compression.h  |   72 ++++--
 fs/btrfs/ctree.c        |    8 +
 fs/btrfs/ctree.h        |   49 ++++-
 fs/btrfs/disk-io.c      |  412 ++++++++++++++++++++++++++++++-
 fs/btrfs/disk-io.h      |    1 +
 fs/btrfs/extent-tree.c  |   90 ++++++-
 fs/btrfs/extent_io.c    |    7 +-
 fs/btrfs/extent_io.h    |   17 ++-
 fs/btrfs/extent_map.c   |    2 +
 fs/btrfs/extent_map.h   |    3 +-
 fs/btrfs/file.c         |   13 +
 fs/btrfs/inode.c        |   90 +++++---
 fs/btrfs/ioctl.c        |  220 +++++++++++++----
 fs/btrfs/ioctl.h        |   12 +-
 fs/btrfs/lzo.c          |  420 +++++++++++++++++++++++++++++++
 fs/btrfs/ordered-data.c |   18 ++-
 fs/btrfs/ordered-data.h |    8 +-
 fs/btrfs/super.c        |  281 ++++++++++++++++++++--
 fs/btrfs/transaction.c  |   11 +
 fs/btrfs/transaction.h  |    1 +
 fs/btrfs/volumes.c      |  626 ++++++++++++++++++++++++++++++++++-------------
 fs/btrfs/volumes.h      |   27 ++
 fs/btrfs/xattr.c        |   18 ++
 fs/btrfs/zlib.c         |  369 ++++++----------------------
 29 files changed, 2491 insertions(+), 623 deletions(-)
Quoted 4 lines

--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

---end quoted text---

#2 lore raw
Quoted 8 lines · Felix Blanke

Hi,

just slap me if the question is stupid, but when will all those new features be added to the btrfs-progs?

The last commit is at "git://git.kernel.org/pub/scm/linux/kernel/git/mason/btrfs-progs-unstable.git" is from oct. 2010?!?

i don't know about the readonly snapshots, but the LZO stuff is a mount option; should be in the pull.

and for the record, i'm totally stoked to run LZO on all my btrfs machines (esp. the netbooks/SSDs :-)

C Anthony

#3 lore raw
Quoted 10 lines · C Anthony Risinger
Quoted 8 lines · Felix Blanke

Hi,

just slap me if the question is stupid, but when will all those new features be added to the btrfs-progs?

The last commit is at "git://git.kernel.org/pub/scm/linux/kernel/git/mason/btrfs-progs-unstable.git" is from oct. 2010?!?

Quoted 7 lines

i don't know about the readonly snapshots, but the LZO stuff is a mount option; should be in the pull.

and for the record, i'm totally stoked to run LZO on all my btrfs machines (esp. the netbooks/SSDs :-)

C Anthony

There was also a patch submitted by Li Zefan for LZO support in btrfs-progs:

http://www.mail-archive.com/[email protected]/msg06931.html

If I recall correctly, btrfs-progs will throw out an error once you use LZO compression since btrfs-progs needs to be made aware of the INCOMPAT flag in the patch submitted above.

My local btrfs-progs git repository also incorporates patches to support mixed data+metadata (which also uses an INCOMPAT flag aleady in the kernel code) and for the filesystem diskinfo command.

A quick search for "btrfs-progs" in my Mailing List archive turns up a number of other btrfs-progs patch proposals since October.

#4 lore raw
Quoted 22 lines · Mitch Harder
Quoted 6 lines · C Anthony Risinger
Quoted 5 lines · Felix Blanke

Hi,

just slap me if the question is stupid, but when will all those new features be added to the btrfs-progs?

Quoted 6 lines
Quoted 3 lines

The last commit is at "git://git.kernel.org/pub/scm/linux/kernel/git/mason/btrfs-progs-unstable.git" is from oct. 2010?!?

i don't know about the readonly snapshots, but the LZO stuff is a mount option; should be in the pull.

There was also a patch submitted by Li Zefan for LZO support in btrfs-progs:

http://www.mail-archive.com/[email protected]/msg06931.html

If I recall correctly, btrfs-progs will throw out an error once you use LZO compression since btrfs-progs needs to be made aware of the INCOMPAT flag in the patch submitted above.

Quoted 6 lines

My local btrfs-progs git repository also incorporates patches to support mixed data+metadata (which also uses an INCOMPAT flag aleady in the kernel code) and for the filesystem diskinfo command.

A quick search for "btrfs-progs" in my Mailing List archive turns up a number of other btrfs-progs patch proposals since October.

ah, indeed. should probably include all that before .38 then... and maybe even cut a .20 btrfs-progs "release" so everyone is on the same page :-) there have been several questions regarding that alone.

C Anthony

#8 lore raw
In reply to Felix Blanke

Hi Chris,

there are a lot of patches related to the btrfs-progs[*]. Do you think that it is reasonable that you find a bit of time to care about that ?

Regards
G.Baroncelli

[*] For example see my email "[REPOST][BTRFS-PROGS] Repost of some patches" dated 2010-12-05.

Quoted 133 lines · Felix Blanke

Hi,

just slap me if the question is stupid, but when will all those new features be added to the btrfs-progs?

The last commit is at "git://git.kernel.org/pub/scm/linux/kernel/git/mason/btrfs-progs-unstable.git" is from oct. 2010?!?

Regards,
Felix

Quoted 107 lines · Chris Mason

Date: Mon, 17 Jan 2011 16:13:01 -0500
From: Chris Mason <[email protected]>
To: Linus Torvalds <[email protected]>, Linux Btrfs
<[email protected]>, linux-kernel <[email protected]>
Subject: [GIT PULL] Btrfs updates

Hi everyone,

The for-linus branch of the btrfs-unstable git tree:

git://git.kernel.org/pub/scm/linux/kernel/git/mason/btrfs-unstable.git for-linus

Has our collection of features and fixes for 2.6.38-rc1. The git tree is actually against 2.6.36 and these commits have been tested against .36, .37 and Linus' current git. There's no particular reason for the .36 part, other than it's what one of my build boxes was running.

The highlights this time around are LZO compression from Li Zefan and a large collection of multi-device fixes from Miao Xie. Liubo kicked in the start of our forced-readonly support, which will be the building block for ripping out a big collection of BUG_ONs and replacing them with kinder gentler error messages.

Li Zefan also added readonly snapshot support, and I'll have the corresponding btrfs-progs changes integrated this week.

This pull does have a duplicate for the btrfs ctree.c build fix that Linus already has in his tree. Git merge seems to do magic on this one, it applies without doing a duplicate #include.

Li Zefan (9) commits (+1354/-542):
Btrfs: Add BTRFS_IOC_SUBVOL_GETFLAGS/SETFLAGS ioctls (+85/-0)
btrfs: Allow to specify compress method when defrag (+26/-2)
btrfs: Allow to add new compression algorithm (+473/-282)
btrfs: Extract duplicate decompress code (+115/-194)
Btrfs: Refactor btrfs_ioctl_snap_create() (+40/-44)
Btrfs: Add readonly snapshots support (+75/-10)
btrfs: Add lzo compression support (+527/-8)
btrfs: Fix error handling in zlib (+8/-0)
btrfs: Fix bugs in zlib workspace (+5/-2)

Miao Xie (6) commits (+695/-186):
btrfs: make the chunk allocator utilize the devices better (+300/-103)
btrfs: try to reclaim some space when chunk allocation fails (+7/-2)
btrfs: fix wrong free space information of btrfs (+286/-7)
btrfs: restructure find_free_dev_extent() (+91/-68)
btrfs: fix wrong calculation of stripe size (+8/-2)
btrfs: fix wrong data space statistics (+3/-4)

Jesper Juhl (2) commits (+5/-1):
btrfs: Don't pass NULL ptr to func that may deref it. (+2/-0)
btrfs: Mem leak in btrfs_get_acl() (+3/-1)

Tsutomu Itoh (2) commits (+17/-0):
btrfs: Fix memory leak in btrfs_read_fs_root_no_radix() (+1/-0)
btrfs: check NULL or not (+16/-0)

Stefan Schmidt (1) commits (+1/-0):
fs/btrfs: Fix build of ctree

Ben Hutchings (1) commits (+4/-0):
btrfs: Require CAP_SYS_ADMIN for filesystem rebalance

Chris Mason (1) commits (+2/-1):
Btrfs: fix off by one while setting block groups readonly

Dave Young (1) commits (+8/-4):
btrfs: mount failure return value fix

liubo (1) commits (+523/-2):
Btrfs: forced readonly mounts on errors

Josef Bacik (1) commits (+0/-5):
Btrfs: don't warn if we get ENOSPC in btrfs_block_rsv_check

Total: (25) commits (+2609/-741)

 fs/btrfs/Kconfig        |    2 +
 fs/btrfs/Makefile       |    2 +-
 fs/btrfs/acl.c          |    4 +-
 fs/btrfs/btrfs_inode.h  |    2 +-
 fs/btrfs/compression.c  |  329 ++++++++++++++++++++++++-
 fs/btrfs/compression.h  |   72 ++++--
 fs/btrfs/ctree.c        |    8 +
 fs/btrfs/ctree.h        |   49 ++++-
 fs/btrfs/disk-io.c      |  412 ++++++++++++++++++++++++++++++-
 fs/btrfs/disk-io.h      |    1 +
 fs/btrfs/extent-tree.c  |   90 ++++++-
 fs/btrfs/extent_io.c    |    7 +-
 fs/btrfs/extent_io.h    |   17 ++-
 fs/btrfs/extent_map.c   |    2 +
 fs/btrfs/extent_map.h   |    3 +-
 fs/btrfs/file.c         |   13 +
 fs/btrfs/inode.c        |   90 +++++---
 fs/btrfs/ioctl.c        |  220 +++++++++++++----
 fs/btrfs/ioctl.h        |   12 +-
 fs/btrfs/lzo.c          |  420 +++++++++++++++++++++++++++++++
 fs/btrfs/ordered-data.c |   18 ++-
 fs/btrfs/ordered-data.h |    8 +-
 fs/btrfs/super.c        |  281 ++++++++++++++++++++--
 fs/btrfs/transaction.c  |   11 +
 fs/btrfs/transaction.h  |    1 +
 fs/btrfs/volumes.c      |  626 ++++++++++++++++++++++++++++++++++-------------
 fs/btrfs/volumes.h      |   27 ++
 fs/btrfs/xattr.c        |   18 ++
 fs/btrfs/zlib.c         |  369 ++++++----------------------
 29 files changed, 2491 insertions(+), 623 deletions(-)
Quoted 4 lines

--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

---end quoted text---
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
.

#5 lore raw
In reply to C Anthony Risinger
Quoted 9 lines · C Anthony Risinger

On Tue, Jan 18, 2011 at 4:14 AM, Felix Blanke<[email protected]> wrote:

i don't know about the readonly snapshots, but the LZO stuff is a mount option; should be in the pull.

and for the record, i'm totally stoked to run LZO on all my btrfs machines (esp. the netbooks/SSDs :-)

Excuse the newbie question: how does Btrfs deal with the compressed data not being block aligned anymore?
E.g. suppose you have a LZO compressed file, then a program rewrites some data which is in the middle of the file, and suppose the newly written data is less compressible.

Btrfs is a copy-on-write FS so this simplifies things a bit, nevertheless it has to support the fact that after the rewrite there will in general be 2 or 3 blocks in the middle of the file which are not completely full: probably the one where old data ends and new data starts will be truncated, a few new blocks will be allocated for newly written data (which won't in general end at a block bounday so this is the second block which is not completely full) and then the place where old data restarts will again be not a full block. Is btrfs capable of that? If yes, calculating offsets in files for random reads is going to be quite a bit slower...

Also, if yes, this could significantly impact data deduplication, in both positive and negative ways:
positive: (with a lot of work) btrfs could detect and merge equal parts at different offsets in different files, even not block aligned.
negative: (without a lot of work) if for some reason one of the first blocks in a file gets truncated and all the rest of the file gets hence shifted forward (but this could probably happen only during the first write of that file, maybe if lzo was turned on and then off again), data deduplication won't probably work for that file... ok this might not be big issue.

#6 lore raw
Quoted 3 lines

E.g. suppose you have a LZO compressed file, then a program rewrites some data which is in the middle of the file, and suppose the newly written data is less compressible.

Any idea how this is handled? I would be interested in the answer as well.

Thank you in advance, Clemens

#7 lore raw
Quoted 7 lines · Clemens Eisserer
Quoted 3 lines

E.g. suppose you have a LZO compressed file, then a program rewrites some data which is in the middle of the file, and suppose the newly written data is less compressible.

Any idea how this is handled? I would be interested in the answer as well.

Thank you in advance, Clemens

The same way any write is handled: the data is written elsewhere. Compression isn't special in this regard.