[PATCH] Btrfs: turn to readonly when btrfs_start_ioctl_transaction() fails
When btrfs_start_ioctl_transaction() fails, we should call btrfs_std_error() properly for filesystem to readonly. Signed-off-by: Tsutomu Itoh --- This patch needs btrfs_abort_transaction function. fs/btrfs/ioctl.c |4 +++- 1 files changed, 3 insertions(+), 1 deletions(-) diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c index b793d11..119a126 100644 --- a/fs/btrfs/ioctl.c +++ b/fs/btrfs/ioctl.c @@ -2498,8 +2498,10 @@ static long btrfs_ioctl_trans_start(struct file *file) ret = -ENOMEM; trans = btrfs_start_ioctl_transaction(root); - if (IS_ERR(trans)) + if (IS_ERR(trans)) { + btrfs_abort_transaction(root, ret); goto out_drop; + } file->private_data = trans; return 0; -- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH] Btrfs: turn to readonly when btrfs_join_transaction() fails
When btrfs_join_transaction()/btrfs_join_transaction_nolock() fails, we should call btrfs_std_error() properly for filesystem to readonly. Signed-off-by: Tsutomu Itoh --- This patch is dependent on http://marc.info/?l=linux-btrfs&m=130761239706076&w=2 (it is necessary to define btrfs_abort_transaction function) fs/btrfs/delayed-inode.c |4 +++- fs/btrfs/disk-io.c |8 ++-- fs/btrfs/extent-tree.c | 17 + fs/btrfs/inode.c | 14 +++--- fs/btrfs/ioctl.c |7 ++- fs/btrfs/relocation.c| 13 + fs/btrfs/transaction.c |1 + 7 files changed, 49 insertions(+), 15 deletions(-) diff --git a/fs/btrfs/delayed-inode.c b/fs/btrfs/delayed-inode.c index 6462c29..f829d6a 100644 --- a/fs/btrfs/delayed-inode.c +++ b/fs/btrfs/delayed-inode.c @@ -1131,8 +1131,10 @@ static void btrfs_async_run_delayed_node_done(struct btrfs_work *work) root = delayed_node->root; trans = btrfs_join_transaction(root); - if (IS_ERR(trans)) + if (IS_ERR(trans)) { + btrfs_abort_transaction(root, PTR_ERR(trans)); goto free_path; + } ret = btrfs_insert_delayed_items(trans, path, root, delayed_node); if (!ret) diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c index 9f68c68..00312c3 100644 --- a/fs/btrfs/disk-io.c +++ b/fs/btrfs/disk-io.c @@ -2478,14 +2478,18 @@ int btrfs_commit_super(struct btrfs_root *root) up_write(&root->fs_info->cleanup_work_sem); trans = btrfs_join_transaction(root); - if (IS_ERR(trans)) + if (IS_ERR(trans)) { + btrfs_abort_transaction(root, PTR_ERR(trans)); return PTR_ERR(trans); + } ret = btrfs_commit_transaction(trans, root); BUG_ON(ret); /* run commit again to drop the original snapshot */ trans = btrfs_join_transaction(root); - if (IS_ERR(trans)) + if (IS_ERR(trans)) { + btrfs_abort_transaction(root, PTR_ERR(trans)); return PTR_ERR(trans); + } btrfs_commit_transaction(trans, root); ret = btrfs_write_and_wait_transaction(NULL, root); BUG_ON(ret); diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c index b42efc2..2f556b9 100644 --- a/fs/btrfs/extent-tree.c +++ b/fs/btrfs/extent-tree.c @@ -3068,8 +3068,10 @@ again: alloc: alloc_target = btrfs_get_alloc_profile(root, 1); trans = btrfs_join_transaction(root); - if (IS_ERR(trans)) + if (IS_ERR(trans)) { + btrfs_abort_transaction(root, PTR_ERR(trans)); return PTR_ERR(trans); + } ret = do_chunk_alloc(trans, root->fs_info->extent_root, bytes + 2 * 1024 * 1024, @@ -3104,8 +3106,10 @@ commit_trans: !atomic_read(&root->fs_info->open_ioctl_trans)) { committed = 1; trans = btrfs_join_transaction(root); - if (IS_ERR(trans)) + if (IS_ERR(trans)) { + btrfs_abort_transaction(root, PTR_ERR(trans)); return PTR_ERR(trans); + } ret = btrfs_commit_transaction(trans, root); if (ret) return ret; @@ -3483,8 +3487,10 @@ again: ret = -ENOSPC; trans = btrfs_join_transaction(root); - if (IS_ERR(trans)) + if (IS_ERR(trans)) { + btrfs_abort_transaction(root, PTR_ERR(trans)); goto out; + } ret = btrfs_commit_transaction(trans, root); if (!ret) { trans = NULL; @@ -6568,7 +6574,10 @@ int btrfs_set_block_group_ro(struct btrfs_root *root, BUG_ON(cache->ro); trans = btrfs_join_transaction(root); - BUG_ON(IS_ERR(trans)); + if (IS_ERR(trans)) { + btrfs_abort_transaction(root, PTR_ERR(trans)); + return PTR_ERR(trans); + } alloc_flags = update_block_group_flags(root, cache->flags); if (alloc_flags != cache->flags) diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c index c15636b..bfe6970 100644 --- a/fs/btrfs/inode.c +++ b/fs/btrfs/inode.c @@ -4274,8 +4274,10 @@ int btrfs_write_inode(struct inode *inode, struct writeback_control *wbc) trans = btrfs_join_transaction_nolock(root); else trans = btrfs_join_transaction(root); - if (IS_ERR(trans)) + if (IS_ERR(trans)) { + btrfs_abort_transaction(root, PTR_ERR(trans)); return PTR_ERR(trans); + } if (nolock) ret = btrfs_end_transaction_noloc
Re: [PATCH] Btrfs: use the normal checksumming infrastructure for free space cache
Chris Mason wrote: > Excerpts from Li Zefan's message of 2011-06-12 21:52:32 -0400: >> Josef Bacik wrote: >>> We used to store the checksums of the space cache directly in the space >>> cache, >>> however that doesn't work out too well if we have more space than we can >>> fit the >>> checksums into the first page. So instead use the normal checksumming >>> infrastructure. There were problems with doing this originally but those >>> problems don't exist now so this works out fine. Thanks, >>> >> >> This looks great, so I'll drop my patch that extends the original code to >> allow more than 1 crc page. > > I do like them a lot, but what happens when a special case crc kernel > mounts a free space cache created by this patch? > The generation number will be checked, and then we'll get this warning: "btrfs: space cache generation xx does not match inode yy" If xx happens to be equal to yy, crcs will be checked and this warning will pop up: "btrfs: crc mismatch for page zz" but it won't crash (not tested). -- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH] Btrfs: use the normal checksumming infrastructure for free space cache
Li Zefan wrote: > Chris Mason wrote: >> Excerpts from Li Zefan's message of 2011-06-12 21:52:32 -0400: >>> Josef Bacik wrote: We used to store the checksums of the space cache directly in the space cache, however that doesn't work out too well if we have more space than we can fit the checksums into the first page. So instead use the normal checksumming infrastructure. There were problems with doing this originally but those problems don't exist now so this works out fine. Thanks, >>> >>> This looks great, so I'll drop my patch that extends the original code to >>> allow more than 1 crc page. >> >> I do like them a lot, but what happens when a special case crc kernel >> mounts a free space cache created by this patch? >> > > So we need a check, like the one in load_free_space_cache(): > oh I misunderstood your question.. -- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [GIT PULL] Btrfs updates
09:02, Andi Kleen wrote: > Chris Mason writes: > >> Hi everyone, >> >> The for-linus branch of the btrfs unstable tree: >> >> git://git.kernel.org/pub/scm/linux/kernel/git/mason/btrfs-unstable.git >> for-linus > >> >> Has our current queue of fixes. Josef's is the biggest pile, mostly in >> the allocator. Josef and I both managed to merge his patch to avoid >> mapping the extent buffer if skip_locking was set, git merge is just a >> little too easy sometimes (I double checked the resulting code). > > The new in 3.0 btrfs warnings on every build are still there: > > fs/btrfs/sysfs.c:76: warning: ‘btrfs_root_attrs’ defined but not used > fs/btrfs/sysfs.c:97: warning: ‘btrfs_super_attrs’ defined but not used > fs/btrfs/sysfs.c:153: warning: ‘btrfs_super_release’ defined but not used > fs/btrfs/sysfs.c:160: warning: ‘btrfs_root_release’ defined but not used > > These are not even used inside any ifdef. It's unclear to me: were > these supposed to be used or removed? > > Probably better to remove since they seem to be untested, unless > it was a merge error? > -- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH] Btrfs: use the normal checksumming infrastructure for free space cache
Chris Mason wrote: > Excerpts from Li Zefan's message of 2011-06-12 21:52:32 -0400: >> Josef Bacik wrote: >>> We used to store the checksums of the space cache directly in the space >>> cache, >>> however that doesn't work out too well if we have more space than we can >>> fit the >>> checksums into the first page. So instead use the normal checksumming >>> infrastructure. There were problems with doing this originally but those >>> problems don't exist now so this works out fine. Thanks, >>> >> >> This looks great, so I'll drop my patch that extends the original code to >> allow more than 1 crc page. > > I do like them a lot, but what happens when a special case crc kernel > mounts a free space cache created by this patch? > So we need a check, like the one in load_free_space_cache(): @@ -2650,6 +2650,11 @@ int load_free_ino_cache(struct btrfs_fs_info *fs_info, st if (IS_ERR(inode)) goto out; + if (BTRFS_I(inode)->flags & BTRFS_INODE_NODATASUM) { + printk(KERN_INFO "Old style space inode found, converting.\n"); + BTRFS_I(inode)->flags &= ~BTRFS_INODE_NODATASUM; + } + if (root_gen != BTRFS_I(inode)->generation) goto out_put; then we'll not trying to load the cache from disk but reconstruct the cache by searching the fs tree. -- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH] Btrfs: use the normal checksumming infrastructure for free space cache
Excerpts from Li Zefan's message of 2011-06-12 21:52:32 -0400: > Josef Bacik wrote: > > We used to store the checksums of the space cache directly in the space > > cache, > > however that doesn't work out too well if we have more space than we can > > fit the > > checksums into the first page. So instead use the normal checksumming > > infrastructure. There were problems with doing this originally but those > > problems don't exist now so this works out fine. Thanks, > > > > This looks great, so I'll drop my patch that extends the original code to > allow more than 1 crc page. I do like them a lot, but what happens when a special case crc kernel mounts a free space cache created by this patch? -chris -- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [GIT PULL] Btrfs updates
Excerpts from Andi Kleen's message of 2011-06-12 21:02:54 -0400: > Chris Mason writes: > > > Hi everyone, > > > > The for-linus branch of the btrfs unstable tree: > > > > git://git.kernel.org/pub/scm/linux/kernel/git/mason/btrfs-unstable.git > > for-linus > > > > > Has our current queue of fixes. Josef's is the biggest pile, mostly in > > the allocator. Josef and I both managed to merge his patch to avoid > > mapping the extent buffer if skip_locking was set, git merge is just a > > little too easy sometimes (I double checked the resulting code). > > The new in 3.0 btrfs warnings on every build are still there: > > fs/btrfs/sysfs.c:76: warning: ‘btrfs_root_attrs’ defined but not used > fs/btrfs/sysfs.c:97: warning: ‘btrfs_super_attrs’ defined but not used > fs/btrfs/sysfs.c:153: warning: ‘btrfs_super_release’ defined but not used > fs/btrfs/sysfs.c:160: warning: ‘btrfs_root_release’ defined but not used > > These are not even used inside any ifdef. It's unclear to me: were > these supposed to be used or removed? > > Probably better to remove since they seem to be untested, unless > it was a merge error? Right, I've been trying to decide how much of the sysfs interface to rip out. We're not using it the way I had planned to, and Kay's proposed udev changes are better than my original plans for sysfs. One way or another I'll kill these off in the next rc. -chris -- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH] Btrfs: use the normal checksumming infrastructure for free space cache
Josef Bacik wrote: > We used to store the checksums of the space cache directly in the space cache, > however that doesn't work out too well if we have more space than we can fit > the > checksums into the first page. So instead use the normal checksumming > infrastructure. There were problems with doing this originally but those > problems don't exist now so this works out fine. Thanks, > This looks great, so I'll drop my patch that extends the original code to allow more than 1 crc page. one comment below: ... > @@ -879,11 +802,7 @@ int __btrfs_write_out_cache(struct btrfs_root *root, > struct inode *inode, > > ret = 1; > > -out_free: > - kfree(checksums); > - kfree(pages); > - leak memory by removing kfree(pages). -- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [GIT PULL] Btrfs updates
Chris Mason writes: > Hi everyone, > > The for-linus branch of the btrfs unstable tree: > > git://git.kernel.org/pub/scm/linux/kernel/git/mason/btrfs-unstable.git > for-linus > > Has our current queue of fixes. Josef's is the biggest pile, mostly in > the allocator. Josef and I both managed to merge his patch to avoid > mapping the extent buffer if skip_locking was set, git merge is just a > little too easy sometimes (I double checked the resulting code). The new in 3.0 btrfs warnings on every build are still there: fs/btrfs/sysfs.c:76: warning: ‘btrfs_root_attrs’ defined but not used fs/btrfs/sysfs.c:97: warning: ‘btrfs_super_attrs’ defined but not used fs/btrfs/sysfs.c:153: warning: ‘btrfs_super_release’ defined but not used fs/btrfs/sysfs.c:160: warning: ‘btrfs_root_release’ defined but not used These are not even used inside any ifdef. It's unclear to me: were these supposed to be used or removed? Probably better to remove since they seem to be untested, unless it was a merge error? -Andi -- a...@linux.intel.com -- Speaking for myself only -- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 4/5][REPOST][BTRFS-PROGS] Avoid to scan cdrom and floppy
Goffredo - As with the other patch, this is missing S-o-B, and has some damage from line wrapping. If you fix and re-send, I'll pull into my integration branch. Hugo. On Sun, Dec 05, 2010 at 06:47:15PM +0100, Goffredo Baroncelli wrote: > Hi all, > > the commands "btrfs filesystem show" and "btrfs device scan" look at the /dev > directory (and it subdirectories) for every block devices. > This is a slow process because floppy and cdrom are also checked. Moreover, > as highlighted by Helmut, if udev is not used, the /dev directory is populated > by high number of non-existant devices, which slow the process. > > My patch changes the behaviour of these commands. The list of the devices are > extracted from /proc/partitions, and on the basis of the file > /etc/btrfs.devices some devices may be skipped. > > The file /etc/btrfs.devices contains a list of devices which have to be > skipped > (if the line starts with '!') or to be evaluated. Shell wildcard may be used. > > If the file doesn't exists the default is to skip cdroms (/dev/cdrom*) and > floppies (/dev/fd*). > > To revert to the old behaviour use the switch '--all-devices'. > > Below the patch, but it is possible to pull the changes from: > > http://cassiopea.homelinux.net/git/btrfs-progs-unstable.git > > branch > > device-checklist > > Comment are welcome. > > Regards > G.Baroncelli > > > btrfs.c| 10 +- > btrfs.devices | 24 ++ > btrfs_cmds.c | 39 +-- > man/btrfs.8.in | 22 -- > utils.c| 196 +++- > utils.h|5 + > 6 files changed, 279 insertions(+), 17 deletions(-) > > > > diff --git a/btrfs.c b/btrfs.c > index 46314cf..d850e60 100644 > --- a/btrfs.c > +++ b/btrfs.c > @@ -83,9 +83,10 @@ static struct Command commands[] = { > "will occupe all available space on the device." > }, > { do_show_filesystem, 999, > - "filesystem show", "[|]\n" > + "filesystem show", "[--all-devices][|]\n" > "Show the info of a btrfs filesystem. If no or \n" > - "is passed, info of all the btrfs filesystem are shown." > + "is passed, info of all the btrfs filesystem are shown.\n" > + "If --all-devices is passed, all devices are scanned." > }, > { do_df_filesystem, 1, > "filesystem df", "\n" > @@ -96,9 +97,10 @@ static struct Command commands[] = { > "Balance the chunks across the device." > }, > { do_scan, > - 999, "device scan", "[ [..]\n" > + 999, "device scan", "[--all-devices| [..]\n" > "Scan all device for or the passed device for a btrfs\n" > - "filesystem." > + "filesystem.\n" > + "If --all-devices is passed, all devices are scanned." > }, > { do_add_volume, -2, > "device add", " [..] \n" > diff --git a/btrfs.devices b/btrfs.devices > new file mode 100644 > index 000..ffeb8b6 > --- /dev/null > +++ b/btrfs.devices > @@ -0,0 +1,24 @@ > +# > +#This file lists the devices which have to be skipped or not > +#during the command 'btrfs filesystem show' and 'btrfs device scan' > +# > +#These lines may contain a shell wildcard pattern (*,?,[]). > +# > +#If a line starts with "!" and matches a device, the device is skipped > +#If a line matches a device, the device is evaluated > +#If a device is not matched by any line, the device is evaluated. > +# > +#The lines starting with "#" are comments. The lines empty are > +#ignored > +# > + > + > + > +# There are two default rules which are added automatically > +# > +# skip floppy > +# !/dev/fd* > +# > +# skip cdrom > +# !/dev/sr* > +# > diff --git a/btrfs_cmds.c b/btrfs_cmds.c > index 8031c58..a573008 100644 > --- a/btrfs_cmds.c > +++ b/btrfs_cmds.c > @@ -529,11 +529,25 @@ int do_fssync(int argc, char **argv) > int do_scan(int argc, char **argv) > { > int i, fd; > - if(argc<=1){ > + int checklist = 1; > + int devstart = 1; > + > + if( argc >= 2 && !strcmp(argv[1],"--all-devices")){ > + > + if( argc >2 ){ > + fprintf(stderr, "ERROR: too may arguments\n"); > +return 22; > +} > + > + checklist = 0; > + devstart += 1; > + } > + > + if(argc<=devstart){ > int ret; > > printf("Scanning for Btrfs filesystems\n"); > - ret = btrfs_scan_one_dir("/dev", 1); > + ret = btrfs_scan_block_devices(1, checklist); > if (ret){ > fprintf(stderr, "ERROR: error %d while scanning\n", > ret); > return 18; > @@ -547,7 +561,7 @@ int do_scan(int argc, char **argv) > return 10; > } > > - for( i = 1 ; i < argc ; i++ ){ > + for( i = devstart ; i < argc ; i++ ){ > struct btrf
Re: [PATCH 2/5][REPOST][BTRFS-PROGS] Be more verbose when a ioctl returns an error
Goffredo - This is missing a S-o-B, and is damaged with line-wrapping. If you fix it up and re-send, I can pull into my integration branch so it doesn't get forgotten... Hugo. On Sun, Dec 05, 2010 at 06:47:38PM +0100, Goffredo Baroncelli wrote: > Hi all, > > this patch makes the command "btrfs" more verbose when a btrfs ioctl return > an > error. The error code is printed as text message by the strerror(errno) > function. > > Example: > > # btrfs subvol create /tmp/1 > Create subvolume '/tmp/1' > # btrfs subvol create /tmp/1/2 > Create subvolume '/tmp/1/2' > # btrfs subvol delete > $ sudo btrfs subvol delete /tmp/1 > Delete subvolume '/tmp/1' > ERROR: cannot delete '/tmp/1' - Directory not empty > > You can pull the patch also from > http://cassiopea.homelinux.net/git/btrfs-progs-unstable.git > branch > strerror > > Comments are welcome. > > Reagrds > G.Baroncelli > > diff --git a/btrfs-list.c b/btrfs-list.c > index 93766a8..abcc2f4 100644 > --- a/btrfs-list.c > +++ b/btrfs-list.c > @@ -265,7 +265,7 @@ static int resolve_root(struct root_lookup *rl, struct > root_info *ri) > static int lookup_ino_path(int fd, struct root_info *ri) > { > struct btrfs_ioctl_ino_lookup_args args; > - int ret; > + int ret, e; > > if (ri->path) > return 0; > @@ -275,9 +275,11 @@ static int lookup_ino_path(int fd, struct root_info *ri) > args.objectid = ri->dir_id; > > ret = ioctl(fd, BTRFS_IOC_INO_LOOKUP, &args); > + e = errno; > if (ret) { > - fprintf(stderr, "ERROR: Failed to lookup path for root > %llu\n", > - (unsigned long long)ri->ref_tree); > + fprintf(stderr, "ERROR: Failed to lookup path for root %llu - > %s\n", > + (unsigned long long)ri->ref_tree, > + strerror(e)); > return ret; > } > > @@ -320,15 +322,18 @@ static u64 find_root_gen(int fd) > unsigned long off = 0; > u64 max_found = 0; > int i; > + int e; > > memset(&ino_args, 0, sizeof(ino_args)); > ino_args.objectid = BTRFS_FIRST_FREE_OBJECTID; > > /* this ioctl fills in ino_args->treeid */ > ret = ioctl(fd, BTRFS_IOC_INO_LOOKUP, &ino_args); > + e = errno; > if (ret) { > - fprintf(stderr, "ERROR: Failed to lookup path for dirid > %llu\n", > - (unsigned long long)BTRFS_FIRST_FREE_OBJECTID); > + fprintf(stderr, "ERROR: Failed to lookup path for dirid %llu - > %s\n", > + (unsigned long long)BTRFS_FIRST_FREE_OBJECTID, > + strerror(e)); > return 0; > } > > @@ -351,8 +356,10 @@ static u64 find_root_gen(int fd) > > while (1) { > ret = ioctl(fd, BTRFS_IOC_TREE_SEARCH, &args); > + e = errno; > if (ret < 0) { > - fprintf(stderr, "ERROR: can't perform the search\n"); > + fprintf(stderr, "ERROR: can't perform the search - > %s\n", > + strerror(e)); > return 0; > } > /* the ioctl returns the number of item it found in nr_items > */ > @@ -407,14 +414,16 @@ static char *__ino_resolve(int fd, u64 dirid) > struct btrfs_ioctl_ino_lookup_args args; > int ret; > char *full; > + int e; > > memset(&args, 0, sizeof(args)); > args.objectid = dirid; > > ret = ioctl(fd, BTRFS_IOC_INO_LOOKUP, &args); > + e = errno; > if (ret) { > - fprintf(stderr, "ERROR: Failed to lookup path for dirid > %llu\n", > - (unsigned long long)dirid); > + fprintf(stderr, "ERROR: Failed to lookup path for dirid %llu - > %s\n", > + (unsigned long long)dirid, strerror(e) ); > return ERR_PTR(ret); > } > > @@ -472,6 +481,7 @@ static char *ino_resolve(int fd, u64 ino, u64 > *cache_dirid, char > **cache_name) > struct btrfs_ioctl_search_header *sh; > unsigned long off = 0; > int namelen; > + int e; > > memset(&args, 0, sizeof(args)); > > @@ -490,8 +500,10 @@ static char *ino_resolve(int fd, u64 ino, u64 > *cache_dirid, char > **cache_name) > sk->nr_items = 1; > > ret = ioctl(fd, BTRFS_IOC_TREE_SEARCH, &args); > + e = errno; > if (ret < 0) { > - fprintf(stderr, "ERROR: can't perform the search\n"); > + fprintf(stderr, "ERROR: can't perform the search - %s\n", > + strerror(e)); > return NULL; > } > /* the ioctl returns the number of item it found in nr_items */ > @@ -550,6 +562,7 @@ int list_subvols(int fd) > char *name; > u64 dir_id; > int i; > + int e; > > root_lookup_init(&root_lookup); > > @@ -578,8 +591,10 @@ int list_subvols(int fd) >
Re: btrfs-progs -- all the patches in one place
On Sun, Jun 12, 2011 at 10:40:47PM +0100, Hugo Mills wrote: >I've just spent the last few hours hoovering up all of the > uncommitted user-space patches I could find on the mailing list since > November, and applying them all into one git branch. It's on my git > repo[1] [1] http://git.darksatanic.net/repo/btrfs-progs-unstable.git/ integration-20110611 ... I just *knew* I'd forget it. Hugo. -- === Hugo Mills: hugo@... carfax.org.uk | darksatanic.net | lug.org.uk === PGP key: 515C238D from wwwkeys.eu.pgp.net or http://www.carfax.org.uk --- My doctor tells me that I have a malformed public-duty gland, --- and a natural deficiency in moral fibre. signature.asc Description: Digital signature
btrfs-progs -- all the patches in one place
I've just spent the last few hours hoovering up all of the uncommitted user-space patches I could find on the mailing list since November, and applying them all into one git branch. It's on my git repo[1], in the "integration-20110611" branch. I was pretty uncritical about what I picked up, so there may be some lemons in there. It passes a basic "make" smoketest, but I've not tested any further than that yet. Highlights include: * support for scrub * support for read-only snapshots * support for balance management * fix for chunk allocation in mixed data/meta filesystems I've also integrated a bunch of fixes and tweaks from other people. The full shortlog is below. I'll try to keep a branch updated with any userspace patches that hit the list from now on. Hugo. Andreas Philipp (5): Added support for an additional ioctl. Add support for read-only subvolumes. Support the new parameters in do_clone(int argc, char** argv). Test the additional ioctl. Updated manpage for btrfs subvolume snapshot. Anton Blanchard (1): btrfs-progs: cast u64 to long long to avoid printf warnings Arne Jansen (3): btrfs-map-logical: usage update btrfs progs: fix extra metadata chunk allocation in --mixed case btrfs-map-logical: segfaults when no output file is given Chris Ball (1): Fix unused-but-set errors in gcc-4.6 Fajar A. Nugraha (1): make "btrfs filesystem label" command actually work Hubert Kario (2): add advanced use of --help to help message add detailed help messages to btrfs command Hugo Mills (9): btrfs-progs: Fix over-sized limit on buffer Balance progress monitoring. Add --monitor option to btrfs balance progress. User-space tool for cancelling balance operations. Run userspace tool in background for balances. Initial implementation of userspace interface for filtered balancing. Balance filter by device ID Balance filter for virtual address range Interface for device range balance filter Jan Schmidt (6): mkfs should initialize unused fields properly commands added scrub ioctls added check_mounted_where scrub userland implementation scrub added to manpage Sergei Trofimovich (8): btrfs-convert: fix typo: 'all inode' -> 'all inodes' mkfs.btrfs: fail on scandir error (-r mode) mkfs.btrfs: return some defined value instead of garbage when lookup checksum mkfs.btrfs: fix symlink names writing mkfs.btrfs: write zeroes instead on uninitialized data. mkfs.btrfs: free buffers allocated by pretty_sizes mkfs.btrfs: fix memory leak caused by 'scandir()' calls mkfs.btrfs: fix error text in '-r' mode Tsutomu Itoh (1): btrfs-progs: setting of time to the root directory -- === Hugo Mills: hugo@... carfax.org.uk | darksatanic.net | lug.org.uk === PGP key: 515C238D from wwwkeys.eu.pgp.net or http://www.carfax.org.uk --- My doctor tells me that I have a malformed public-duty gland, --- and a natural deficiency in moral fibre. signature.asc Description: Digital signature
[PATCH] btrfs-progs: Fix over-sized limit on buffer
gcc-4.4 complains (rightly) that the strncpy has a limit too large for the array it's copying into. Use the correct array length. Signed-off-by: Hugo Mills --- btrfs_cmds.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/btrfs_cmds.c b/btrfs_cmds.c index 7de28b6..9d94f6f 100644 --- a/btrfs_cmds.c +++ b/btrfs_cmds.c @@ -427,7 +427,7 @@ int do_clone(int argc, char **argv) } args.fd = fd; - strncpy(args.name, newname, BTRFS_PATH_NAME_MAX); + strncpy(args.name, newname, BTRFS_SUBVOL_NAME_MAX); res = ioctl(fddst, BTRFS_IOC_SNAP_CREATE_V2, &args); e = errno; -- 1.7.2.5 -- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [GIT PULL] Btrfs updates
On Sun, Jun 12, 2011 at 4:57 AM, Chris Mason wrote: > > The for-linus branch of the btrfs unstable tree: Chris, this is getting ridiculous. You guys need to start honoring the merge window. None of these big pulls afterwards. If the code wasn't ready, it damn well shouldn't have been pushed to me in the first place. I pulled this round, but next pull request had better make it very clear that it's only minimal *regression* fixes. Nothing more. Linus -- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[GIT PULL] Btrfs updates
Hi everyone, The for-linus branch of the btrfs unstable tree: git://git.kernel.org/pub/scm/linux/kernel/git/mason/btrfs-unstable.git for-linus Has our current queue of fixes. Josef's is the biggest pile, mostly in the allocator. Josef and I both managed to merge his patch to avoid mapping the extent buffer if skip_locking was set, git merge is just a little too easy sometimes (I double checked the resulting code). We've also got some fixes for the new scrub code, and a regression fix for the new use of current->journal_info in nested transactions. Josef Bacik (9) commits (+178/-65): Btrfs: don't commit the transaction if we dont have enough pinned bytes (+7/-0) Btrfs: don't map extent buffer if path->skip_locking is set (+7/-3) Btrfs: cache bitmaps when searching for a cluster (+49/-5) Btrfs: noinline the cluster searching functions (+10/-8) Btrfs: unlock the trans lock properly (+1/-1) Btrfs: fix the allocator loop logic (+25/-23) Btrfs: fix duplicate checking logic (+3/-3) Btrfs: fix bitmap regression (+69/-19) Arne Jansen (3) commits (+39/-32): btrfs: remove unneeded includes from scrub.c (+0/-6) btrfs: scrub: errors in tree enumeration (+34/-23) btrfs: reinitialize scrub workers (+5/-3) Li Zefan (2) commits (+15/-10): Btrfs: use join_transaction in btrfs_evict_inode() (+1/-1) Btrfs: avoid stack bloat in btrfs_ioctl_fs_info() (+14/-9) Chris Mason (1) commits (+5/-4): Btrfs: make sure to recheck for bitmaps in clusters Sage Weil (1) commits (+4/-1): Btrfs: clear current->journal_info on async transaction commit Ilya Dryomov (1) commits (+2/-6): Btrfs - use %pU to print fsid Jan Schmidt (1) commits (+1/-1): Btrfs: fix extent state leak on failed nodatasum reads David Sterba (1) commits (+1/-2): btrfs: fix unlocked access of delalloc_inodes richard kennedy (1) commits (+1/-1): btrfs: remove 64bit alignment padding to allow extent_buffer to fit into one fewer cacheline Total: (20) commits (+246/-122) fs/btrfs/ctree.c| 10 ++- fs/btrfs/disk-io.c |5 +- fs/btrfs/extent-tree.c | 55 +-- fs/btrfs/extent_io.h|2 +- fs/btrfs/free-space-cache.c | 163 ++- fs/btrfs/inode.c|4 +- fs/btrfs/ioctl.c| 23 --- fs/btrfs/scrub.c| 69 ++ fs/btrfs/transaction.c |7 ++- fs/btrfs/volumes.c |8 +-- 10 files changed, 233 insertions(+), 113 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: cannot remove files: No space left on device
On 12.06.2011 10:27, Mike Fleetwood wrote: Check out the btrfs FAQ about space usage: https://btrfs.wiki.kernel.org/index.php/FAQ#Why_are_there_so_many_ways_to_check_the_amount_of_free_space.3F and try these command too: btrfs filesystem df /mnt/btrfs btrfs filesystem show /dev/sdb4 I'm no btrfs expert but it's worth trying to delete one file and syncing the fs, then repeating. Yes, I know this FAQ. I've deleted around 40 GB files, but still occasionally see "No space left on device" when removing files, or when copying new files to btrfs filesystem (i.e. copying one file fails with "No space left on the device", while there is ~70 GB free on btrfs filesystem; and copying some other files, with similar or bigger size, succeeds). -- Tomasz Chmielewski http://wpkg.org -- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: cannot remove files: No space left on device
On 12 June 2011 00:32, Tomasz Chmielewski wrote: > I'm trying to remove some files on a btrfs filesystem which has 26 GB free: > > /dev/sdb4 336G 310G 26G 93% /mnt/btrfs > > > Unfortunately, removing some of the files fails, due to "No space left on > device": > > root@dom:/mnt/btrfs# rm -rfv postgresql-noindex > removed `postgresql-noindex/postgresql/8.4/main/base/16384/16508.6' > removed `postgresql-noindex/postgresql/8.4/main/base/16384/16508.7' > rm: cannot remove > `postgresql-noindex/postgresql/8.4/main/base/16384/16508.8': No space left on > device > removed `postgresql-noindex/postgresql/8.4/main/base/16384/16508.9' > removed `postgresql-noindex/postgresql/8.4/main/base/16384/16508_fsm' > removed `postgresql-noindex/postgresql/8.4/main/base/16384/16511' > removed `postgresql-noindex/postgresql/8.4/main/base/16384/16513' > removed `postgresql-noindex/postgresql/8.4/main/base/16384/16516' > removed `postgresql-noindex/postgresql/8.4/main/base/16384/16516_fsm' > removed `postgresql-noindex/postgresql/8.4/main/base/16384/16521' > > This is a snapshot of a different directory (with some changes). > > Is it expected? I'm running 2.6.39.1 kernel. > > -- > Tomasz Chmielewski Check out the btrfs FAQ about space usage: https://btrfs.wiki.kernel.org/index.php/FAQ#Why_are_there_so_many_ways_to_check_the_amount_of_free_space.3F and try these command too: btrfs filesystem df /mnt/btrfs btrfs filesystem show /dev/sdb4 I'm no btrfs expert but it's worth trying to delete one file and syncing the fs, then repeating. Mike -- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html