Re: Feature Req: "mkfs.btrfs -d dup" option on single device

2013-12-11 Thread Hugo Mills
On Tue, Dec 10, 2013 at 09:07:21PM -0700, Chris Murphy wrote: > > On Dec 10, 2013, at 8:19 PM, Imran Geriskovan > wrote: > > > > Now the question is, is it a good practice to use "-M" for large > > filesystems? > > Pros, Cons? What is the performance impact? Or any other possible impact? > >

Re: [PATCH] Btrfs: don't clear the default compression type

2013-12-11 Thread Liu Bo
On Fri, Nov 22, 2013 at 06:47:59PM +0800, Miao Xie wrote: > We met a oops caused by the wrong compression type: > [ 556.512356] BUG: unable to handle kernel NULL pointer dereference at > (null) > [ 556.512370] IP: [] __list_del_entry+0x1/0x98 > [SNIP] > [ 556.512490] [] ? list_del+0x

[PATCH] btrfs-progs: fix improper error prompt for defragment

2013-12-11 Thread Gui Hecheng
The error msg: "ERROR: defrag range ioctl not supported in this kernel, please try without any options." should only show up when failing to do a range defraging, not upon non-range defraging. Signed-off-by: Gui Hecheng --- cmds-filesystem.c | 4 ++-- 1 file changed, 2 insertion

btrfs/024 is unhappy on current HEAD

2013-12-11 Thread Christoph Hellwig
btrfs/024 [ 159.416857] btrfs: device fsid c8802dbf-ca95-45c5-af67-18f13ef243ea devid 1 transid 4 /dev/vdc [ 159.430449] btrfs: setting nodatacow, compression disabled [ 159.431668] btrfs: disk space caching is enabled [ 159.439418] btrfs: creating UUID tree [ 159.466146] [ c

[PATCH 05/18] fs: make posix_acl_chmod more useful

2013-12-11 Thread Christoph Hellwig
Rename the current posix_acl_chmod to __posix_acl_chmod and add a fully featured ACL chmod helper that uses the ->set_acl inode operation. Signed-off-by: Christoph Hellwig Reviewed-by: Jan Kara --- fs/9p/acl.c |2 +- fs/btrfs/acl.c|2 +- fs/ext2/acl.c

[PATCH 03/18] fs: add a set_acl inode operation

2013-12-11 Thread Christoph Hellwig
This will allow moving all the Posix ACL handling into the VFS and clean up tons of cruft in the filesystems. Signed-off-by: Christoph Hellwig Reviewed-by: Jan Kara --- include/linux/fs.h |1 + 1 file changed, 1 insertion(+) diff --git a/include/linux/fs.h b/include/linux/fs.h index 121f11

[PATCH 11/18] jffs2: use generic posix ACL infrastructure

2013-12-11 Thread Christoph Hellwig
Also don't bother to set up a .get_acl method for symlinks as we do not support access control (ACLs or even mode bits) for symlinks in Linux. Signed-off-by: Christoph Hellwig --- fs/jffs2/acl.c | 141 fs/jffs2/acl.h |7 +-- fs/jf

[PATCH 02/18] fs: add get_acl helper

2013-12-11 Thread Christoph Hellwig
Factor out the code to get an ACL either from the inode or disk from check_acl, so that it can be used elsewhere later on. Signed-off-by: Christoph Hellwig Reviewed-by: Jan Kara --- fs/namei.c| 24 +++- fs/posix_acl.c| 26 +

[PATCH 04/18] fs: add generic xattr_acl handlers

2013-12-11 Thread Christoph Hellwig
With the ->set_acl inode operation we can implement the Posix ACL xattr handlers in generic code instead of duplicating them all over the tree. Signed-off-by: Christoph Hellwig Reviewed-by: Jan Kara --- fs/xattr_acl.c | 102 +++ include/linu

[PATCH 06/18] fs: make posix_acl_create more useful

2013-12-11 Thread Christoph Hellwig
Rename the current posix_acl_created to __posix_acl_create and add a fully featured helper to set up the ACLs on file creation that uses get_acl(). Signed-off-by: Christoph Hellwig Reviewed-by: Jan Kara --- fs/9p/acl.c |2 +- fs/btrfs/acl.c|2 +- fs/ext2/acl.c

[PATCH 14/18] xfs: use generic posix ACL infrastructure

2013-12-11 Thread Christoph Hellwig
Also don't bother to set up a .get_acl method for symlinks as we do not support access control (ACLs or even mode bits) for symlinks in Linux, and create inodes with the proper mode instead of fixing it up later. Signed-off-by: Christoph Hellwig Reviewed-by: Dave Chinner --- fs/xfs/xfs_acl.c

[PATCH 00/18] Consolidate Posix ACL implementation V2

2013-12-11 Thread Christoph Hellwig
This series consolidates the various cut'n'pasted Posix ACL implementations into a single common one based on the ->get_acl method Linus added a while ago and a new ->set_acl counterpart. This remove ~1800 lines of code and provides a single place to implement various nasty little gems of the sema

[PATCH 09/18] f2fs: use generic posix ACL infrastructure

2013-12-11 Thread Christoph Hellwig
f2fs has some weird mode bit handling, so still using the old chmod code for now. Signed-off-by: Christoph Hellwig Reviewed-by: Jaegeuk Kim --- fs/f2fs/acl.c | 174 ++- fs/f2fs/acl.h |7 +-- fs/f2fs/f2fs.h |4 ++ fs/f2fs/file.c

[PATCH 01/18] reiserfs: prefix ACL symbols with reiserfs_

2013-12-11 Thread Christoph Hellwig
Signed-off-by: Christoph Hellwig Reviewed-by: Jan Kara --- fs/reiserfs/xattr_acl.c | 20 ++-- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/fs/reiserfs/xattr_acl.c b/fs/reiserfs/xattr_acl.c index 06c04f7..6f721ea 100644 --- a/fs/reiserfs/xattr_acl.c +++ b/fs/r

[PATCH 15/18] jfs: use generic posix ACL infrastructure

2013-12-11 Thread Christoph Hellwig
Copy the scheme I introduced to btrfs many years ago to only use the xattr handler for ACLs, but pass plain attrs straight through. Signed-off-by: Christoph Hellwig Reviewed-by: Dave Kleikamp --- fs/jfs/acl.c | 105 -- fs/jfs/file.c |

[PATCH 07/18] btrfs: use generic posix ACL infrastructure

2013-12-11 Thread Christoph Hellwig
Also don't bother to set up a .get_acl method for symlinks as we do not support access control (ACLs or even mode bits) for symlinks in Linux. Signed-off-by: Christoph Hellwig --- fs/btrfs/acl.c | 142 +++--- fs/btrfs/ctree.h |7 +-- fs/btrf

[PATCH 12/18] ocfs2: use generic posix ACL infrastructure

2013-12-11 Thread Christoph Hellwig
This contains some major refactoring for the create path so that inodes are created with the right mode to start with instead of fixing it up later. Signed-off-by: Christoph Hellwig --- fs/ocfs2/acl.c | 234 ++- fs/ocfs2/acl.h | 13

[PATCH 08/18] ext2/3/4: use generic posix ACL infrastructure

2013-12-11 Thread Christoph Hellwig
Signed-off-by: Christoph Hellwig Reviewed-by: Jan Kara --- fs/ext2/acl.c | 188 -- fs/ext2/acl.h |8 +- fs/ext2/file.c |1 + fs/ext2/inode.c |2 +- fs/ext2/namei.c |2 + fs/ext2/xattr.c |8 +- fs/ext2/xattr.h |2 - fs/ext3

[PATCH 16/18] gfs2: use generic posix ACL infrastructure

2013-12-11 Thread Christoph Hellwig
This contains some major refactoring for the create path so that inodes are created with the right mode to start with instead of fixing it up later. Signed-off-by: Christoph Hellwig --- fs/gfs2/acl.c | 234 +++ fs/gfs2/acl.h |4 +- fs/

[PATCH 17/18] nfs: use generic posix ACL infrastructure for v3 Posix ACLs

2013-12-11 Thread Christoph Hellwig
Signed-off-by: Christoph Hellwig --- fs/nfs/inode.c |4 - fs/nfs/nfs3acl.c | 287 +--- fs/nfs/nfs3proc.c | 26 +++-- fs/nfs/nfs3super.c |3 + include/linux/nfs_fs.h | 10 +- 5 files changed, 76 insertions(+), 254 dele

[PATCH 10/18] hfsplus: use generic posix ACL infrastructure

2013-12-11 Thread Christoph Hellwig
Signed-off-by: Christoph Hellwig Reviewed-by: Vyacheslav Dubeyko --- fs/hfsplus/acl.h |9 +-- fs/hfsplus/dir.c |1 + fs/hfsplus/inode.c |3 +- fs/hfsplus/posix_acl.c | 168 +--- fs/hfsplus/xattr.c |5 +- fs/hfsplus/

[PATCH 13/18] reiserfs: use generic posix ACL infrastructure

2013-12-11 Thread Christoph Hellwig
Also don't bother to set up a .get_acl method for symlinks as we do not support access control (ACLs or even mode bits) for symlinks in Linux. Signed-off-by: Christoph Hellwig Reviewed-by: Jan Kara --- fs/reiserfs/acl.h |4 +- fs/reiserfs/file.c |1 + fs/reiserfs/namei.c

[PATCH 18/18] fs: remove generic_acl

2013-12-11 Thread Christoph Hellwig
And instead convert tmpfs to use the new generic ACL code, with two stub methods provided for in-memory filesystems. Signed-off-by: Christoph Hellwig --- fs/Kconfig |6 +- fs/Makefile |1 - fs/generic_acl.c| 184 --

Re: [Cluster-devel] [PATCH 16/18] gfs2: use generic posix ACL infrastructure

2013-12-11 Thread Steven Whitehouse
Hi, On Wed, 2013-12-11 at 02:42 -0800, Christoph Hellwig wrote: > plain text document attachment > (0016-gfs2-use-generic-posix-ACL-infrastructure.patch) > This contains some major refactoring for the create path so that > inodes are created with the right mode to start with instead of > fixing it

Re: Feature Req: "mkfs.btrfs -d dup" option on single device

2013-12-11 Thread Duncan
Chris Murphy posted on Tue, 10 Dec 2013 17:33:59 -0700 as excerpted: > On Dec 10, 2013, at 5:14 PM, Imran Geriskovan > wrote: > >>> Current btrfs-progs is v3.12. 0.19 is a bit old. But yes, looks like >>> the wiki also needs updating. >> >>> Anyway I just tried it on an 8GB stick and it works,

Re: btrfs/024 is unhappy on current HEAD

2013-12-11 Thread Miao Xie
This bug has been fixed by https://patchwork.kernel.org/patch/3222061/ Thanks Miao On wed, 11 Dec 2013 02:39:38 -0800, Christoph Hellwig wrote: > btrfs/024 [ 159.416857] btrfs: device fsid > c8802dbf-ca95-45c5-af67-18f13ef243ea devid 1 transid 4 /dev/vdc > [ 159.430449] btrfs: setting

Re: btrfs/024 is unhappy on current HEAD

2013-12-11 Thread Christoph Hellwig
On Wed, Dec 11, 2013 at 06:59:37PM +0800, Miao Xie wrote: > This bug has been fixed by > > https://patchwork.kernel.org/patch/3222061/ Would be good to get it out to Linus ASAP.. -- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to majord...@vger.

[PATCH] Btrfs-progs: make sure we are not opening a block device in open_file_or_dir()

2013-12-11 Thread Wang Shilong
Now, open_file_or_dir() will return successfully if we pass a block device for it, this is wrong, we should check if it is a block device before trying to open it. Before this patch: # btrfs sub list /dev/sda8 It will output the following message: ERROR: can't perform the search -Inappropriate i

[PATCH v2 1/2] Btrfs: fix an oops when doing balance relocation

2013-12-11 Thread Wang Shilong
I hit an oops when inserting reloc root into @reloc_root_tree(it can be easily triggered when forcing cow for relocation root) [ 866.494539] [] btrfs_init_reloc_root+0x79/0xb0 [btrfs] [ 866.495321] [] record_root_in_trans+0xb0/0x110 [btrfs] [ 866.496109] [] btrfs_record_root_in_trans+0x48/0x

[PATCH] Btrfs: make sure we cleanup all reloc roots if error happens

2013-12-11 Thread Wang Shilong
I hit an oops when merging reloc roots fails, the reason is that new reloc roots may be added and we should make sure we cleanup all reloc roots. Signed-off-by: Wang Shilong --- fs/btrfs/relocation.c | 7 +++ 1 file changed, 7 insertions(+) diff --git a/fs/btrfs/relocation.c b/fs/btrfs/relo

Re: Feature Req: "mkfs.btrfs -d dup" option on single device

2013-12-11 Thread Imran Geriskovan
> That's actually the reason btrfs defaults to SINGLE metadata mode on > single-device SSD-backed filesystems, as well. > > But as Imran points out, SSDs aren't all there is. There's still > spinning rust around. > > And defaults aside, even on SSDs it should be /possible/ to specify data- > dup m

Re: Feature Req: "mkfs.btrfs -d dup" option on single device

2013-12-11 Thread Martin
On 11/12/13 03:19, Imran Geriskovan wrote: SSDs: > What's more (in relation to our long term data integrity aim) > order of magnitude for their unpowered data retension period is > 1 YEAR. (Read it as 6months to 2-3 years. While powered they > refresh/shuffle the blocks) This makes SSDs > unsuita

Re: Feature Req: "mkfs.btrfs -d dup" option on single device

2013-12-11 Thread Imran Geriskovan
>> What's more (in relation to our long term data integrity aim) >> order of magnitude for their unpowered data retension period is >> 1 YEAR. (Read it as 6months to 2-3 years. > Does btrfs need to date-stamp each block/chunk to ensure that data is > rewritten before suffering flash memory bitrot?

Re: btrfs/024 is unhappy on current HEAD

2013-12-11 Thread Chris Mason
Quoting Christoph Hellwig (2013-12-11 06:00:07) > On Wed, Dec 11, 2013 at 06:59:37PM +0800, Miao Xie wrote: > > This bug has been fixed by > > > > https://patchwork.kernel.org/patch/3222061/ > > Would be good to get it out to Linus ASAP.. My new devel boxes are up and running now, so I'm startin

btrfs-progs integration branch versioning

2013-12-11 Thread WorMzy Tykashi
Hi, It's not a big deal, but I've just noticed that the most recent unstable-integration btrfs tools (built from [1]) are still reporting their version as v0.20-rc1-638-g8e44385, rather than v3.12-xxx-. I believe this is because the master branch in the devel repository has not been tagged

Re: BTRFS doesn't handle USB device disconnect

2013-12-11 Thread Alan Stern
On Tue, 10 Dec 2013, Sarah Sharp wrote: > In order to stress test the uas driver (next-gen USB storage driver), I > decided to run some tests with a USB 3.0 storage device with four 10GB > partitions: BTRFS, ext3, ext4, and fat32. > > It seems that BTRFS doesn't handle unexpected USB disconnect v

Re: Feature Req: "mkfs.btrfs -d dup" option on single device

2013-12-11 Thread Chris Murphy
On Dec 11, 2013, at 1:09 AM, Hugo Mills wrote: > That documentation needs tweaking. You need --mixed/-M for larger > filesystems than that. It's hard to say exactly where the optimal > boundary is, but somewhere around 16 GiB seems to be the dividing > point (8 GiB is in the "mostly going to c

Re: BTRFS doesn't handle USB device disconnect

2013-12-11 Thread Hugo Mills
On Wed, Dec 11, 2013 at 11:03:09AM -0500, Alan Stern wrote: > On Tue, 10 Dec 2013, Sarah Sharp wrote: > > > In order to stress test the uas driver (next-gen USB storage driver), I > > decided to run some tests with a USB 3.0 storage device with four 10GB > > partitions: BTRFS, ext3, ext4, and fat3

[PATCH] Btrfs-progs: reset balance before reiniting extent root

2013-12-11 Thread Josef Bacik
When we re-init the extent root we make it completely empty, so when we reset a pending balance we will fail to find refs for any blocks we may cow, which will result in errors and we will exit out. We need to reset the balance first so the normal cow stuff doesn't freak out and then we can re-ini

[PATCH] Btrfs-progs: deal with invalid key orderings and bad orphan items

2013-12-11 Thread Josef Bacik
A user had a fs where the objectid of an orphan item was not the actual orphan item objectid. This screwed up fsck because the block has keys in the wrong order, also the fs scanning stuff will freak out because we have an inode with nlink 0 and no orphan item. So this patch is pretty big but is

Re: btrfs-progs integration branch versioning

2013-12-11 Thread David Sterba
On Wed, Dec 11, 2013 at 03:59:48PM +, WorMzy Tykashi wrote: > It's not a big deal, but I've just noticed that the most recent > unstable-integration btrfs tools (built from [1]) are still reporting > their version as v0.20-rc1-638-g8e44385, rather than > v3.12-xxx-. I believe this is be

Re: btrfs-progs integration branch versioning

2013-12-11 Thread WorMzy Tykashi
On 11 December 2013 16:37, David Sterba wrote: > > Sorry, I haven't pushed the tags, fixed now. The repos are mostly > identical to increase availability. > > david Cheers for that. WorMzy -- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to majo

Re: Feature Req: "mkfs.btrfs -d dup" option on single device

2013-12-11 Thread Duncan
Hugo Mills posted on Wed, 11 Dec 2013 08:09:02 + as excerpted: > On Tue, Dec 10, 2013 at 09:07:21PM -0700, Chris Murphy wrote: >> >> On Dec 10, 2013, at 8:19 PM, Imran Geriskovan >> wrote: >> > >> > Now the question is, is it a good practice to use "-M" for large >> > filesystems? >> >> Un

BTRFS extended attributes mounted on a non-extended-attributes compiled kernel

2013-12-11 Thread Martin
What happens if... I have a btrfs that has utilised posix ACLs / extended attributes and I then subsequently mount that onto a system that does not have the kernel modules compiled for those features? Crash and burn? Or are the extra filesystem features benignly ignored until remounted on the o

Re: Feature Req: "mkfs.btrfs -d dup" option on single device

2013-12-11 Thread Duncan
Imran Geriskovan posted on Wed, 11 Dec 2013 15:19:29 +0200 as excerpted: > Now, there is one open issue: > In its current form "-d dup" interferes with "-M". Is it constraint of > design? > Or an arbitrary/temporary constraint. What will be the situation if > there is tunable duplicates? I believ

Re: BTRFS extended attributes mounted on a non-extended-attributes compiled kernel

2013-12-11 Thread Hugo Mills
On Wed, Dec 11, 2013 at 05:51:06PM +, Martin wrote: > What happens if... > > I have a btrfs that has utilised posix ACLs / extended attributes and I > then subsequently mount that onto a system that does not have the kernel > modules compiled for those features? > > > Crash and burn? > > Or

Re: clone syscall fails for bedup-deduplicated files

2013-12-11 Thread David Sterba
On Sat, Dec 07, 2013 at 10:31:30PM +0100, Pascal Germroth wrote: > Running a 3.8 kernel I've been using bedup to deduplicate some files, > for example two identical 500MB files A & B now share data chunks. > Running a 3.11 kernel, I wanted to clone some more files, but those > previously deduplicat

Updated btrfs-next

2013-12-11 Thread Josef Bacik
Hello, I just updated and pushed btrfs-next, if it is missing something let me know. I had to kick out the printk formatting patch because it didn't compile and I didn't take Miao's background enospc flushing stuff since some of it didn't apply and 5/5 hasn't been updated to force waiting on

Re: BTRFS extended attributes mounted on a non-extended-attributes compiled kernel

2013-12-11 Thread Chris Mason
Quoting Hugo Mills (2013-12-11 14:01:04) > On Wed, Dec 11, 2013 at 05:51:06PM +, Martin wrote: > > What happens if... > > > > I have a btrfs that has utilised posix ACLs / extended attributes and I > > then subsequently mount that onto a system that does not have the kernel > > modules compile

Re: BTRFS doesn't handle USB device disconnect

2013-12-11 Thread Sarah Sharp
On Wed, Dec 11, 2013 at 11:03:09AM -0500, Alan Stern wrote: > On Tue, 10 Dec 2013, Sarah Sharp wrote: > > On 3.13-rc1, the btrfs partion from the disconnected USB device > > continues to be listed as mounted. Yanking the cable produces some > > additional oops messages. It also produced a couple

Re: SSD data retention, was: "mkfs.btrfs -d dup" option on single device

2013-12-11 Thread Chris Murphy
On Dec 11, 2013, at 7:07 AM, Martin wrote: > On 11/12/13 03:19, Imran Geriskovan wrote: > > SSDs: > >> What's more (in relation to our long term data integrity aim) >> order of magnitude for their unpowered data retension period is >> 1 YEAR. (Read it as 6months to 2-3 years. While powered the

[PATCH 1/7] btrfs: subpagesize-blocksize: Define extent_buffer_head

2013-12-11 Thread Chandra Seetharaman
In order to handle multiple extent buffers per page, first we need to create a way to handle all the extent buffers that are attached to a page. This patch creates a new data structure eb_head, and moves fields that are common to all extent buffers in a page from extent buffer to eb_head. This al

[PATCH 4/7] btrfs: subpagesize-blocksize: Handle iosize properly in submit_extent_page()

2013-12-11 Thread Chandra Seetharaman
For the subpagesize-blocksize case make sure that the IO submitted through submit_extent_page() is at least of PAGE_CACHE_SIZE Signed-off-by: Chandra Seetharaman --- fs/btrfs/extent_io.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/extent_io.c index e199

[PATCH 0/7] Patches to support subpagesize blocksize

2013-12-11 Thread Chandra Seetharaman
In btrfs, blocksize, the basic IO size of the filesystem, has been more than PAGE_SIZE. But, some 64 bit architures, like PPC64 and ARM64 have the default PAGE_SIZE as 64K, which means the filesystems handled in these architectures are with a blocksize of 64K. This works fine as long as you creat

[PATCH 3/7] btrfs: subpagesize-blocksize: Handle small extent maps properly

2013-12-11 Thread Chandra Seetharaman
This patch makes sure that the size extent maps handles are at least PAGE_CACHE_SIZE for the subpagesize-blocksize case. Signed-off-by: Chandra Seetharaman --- fs/btrfs/inode.c | 8 +++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c index c7

[PATCH 2/7] btrfs: subpagesize-blocksize: Use a global alignment for size

2013-12-11 Thread Chandra Seetharaman
In order to handle a blocksize that is smaller than the PAGE_SIZE, we need align all IOs to PAGE_SIZE. This patch defines a new macro btrfs_align_size() that calculates the alignment size based on the sectorsize and uses it at appropriate places. Signed-off-by: Chandra Seetharaman --- fs/btrfs/

[PATCH 5/7] btrfs: subpagesize-blocksize: handle checksum calculations properly

2013-12-11 Thread Chandra Seetharaman
With subpagesize-blocksize, the IO is done in pages but checksums are calculated in blocks. This patch makes sure the checksums are calculated, stored, and verfied from proper indexes in the page. Signed-off-by: Chandra Seetharaman --- fs/btrfs/file-item.c | 45 +

[PATCH 6/7] btrfs: subpagesize-blocksize: Handle relocation clusters appropriately

2013-12-11 Thread Chandra Seetharaman
For relocation clusters boundaries are at blocks, hence in the case of subpagesize-blocksize, we need to make sure the data in the page is handled correctly with the cluster boundary. This patch does that. Signed-off-by: Chandra Seetharaman --- fs/btrfs/relocation.c | 6 -- 1 file changed,

[PATCH 7/7] btrfs: subpagesize-blocksize: Allow mounting filesystems where sectorsize != PAGE_SIZE

2013-12-11 Thread Chandra Seetharaman
This is the final patch of the series that allows filesystems with blocksize smaller than the PAGE_SIZE. Signed-off-by: Chandra Seetharaman --- fs/btrfs/disk-io.c | 6 -- 1 file changed, 6 deletions(-) diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c index ca1526d..d9bd450 100644 --- a/

[PATCH v2 8/16] btrfs-progs: fix resource leak in scrub_start()

2013-12-11 Thread Wang Shilong
From: Eric Sandeen Resolves-Coverity-CID: 1125934 Resolves-Coverity-CID: 1125935 Resolves-Coverity-CID: 1125936 Signed-off-by: Eric Sandeen Signed-off-by: Wang Shilong --- v1->v2: make sure we are returning right value --- cmds-scrub.c | 6 +- 1 file changed, 5 insertions(+), 1 del

[PATCH v2] Btrfs-progs: make sure we are opening a file or dir with open_file_or_dir()

2013-12-11 Thread Wang Shilong
Previously, open_file_or_dir() will open block device successfully, however, we should enhance such checks to make sure we are really opening a file or dir. Signed-off-by: Wang Shilong --- v1->v2: this is more nature to fix the problem. --- utils.c | 13 ++--- 1 file changed, 10

[PATCH] Btrfs-progs: add sanity checks for btrfs device operations

2013-12-11 Thread Wang Shilong
Make sure we are a block device firstly, this can avoid some unnecessary ioctls operations. Signed-off-by: Wang Shilong --- cmds-device.c | 18 ++ 1 file changed, 18 insertions(+) diff --git a/cmds-device.c b/cmds-device.c index bc4a8dc..ea20919 100644 --- a/cmds-device.c +++ b/