Re: [PATCH 4/9] staging/lustre: clean up and remove libcfs/linux/linux-fs.c

2013-06-04 Thread Peng Tao
On Tue, Jun 4, 2013 at 4:32 PM, Dan Carpenter dan.carpen...@oracle.com wrote: On Mon, Jun 03, 2013 at 09:58:17PM +0800, Peng Tao wrote: int libcfs_kkuc_msg_put(struct file *filp, void *payload) { struct kuc_hdr *kuch = (struct kuc_hdr *)payload; + ssize_t count = kuch-kuc_msglen;

Re: [PATCH 4/9] staging/lustre: clean up and remove libcfs/linux/linux-fs.c

2013-06-04 Thread Peng Tao
On Tue, Jun 4, 2013 at 6:23 PM, Peng Tao bergw...@gmail.com wrote: On Tue, Jun 4, 2013 at 4:32 PM, Dan Carpenter dan.carpen...@oracle.com wrote: On Mon, Jun 03, 2013 at 09:58:17PM +0800, Peng Tao wrote: int libcfs_kkuc_msg_put(struct file *filp, void *payload) { struct kuc_hdr *kuch

Re: [PATCH 0/2] introduce list_for_each_entry_del

2013-06-04 Thread Christoph Hellwig
On Mon, Jun 03, 2013 at 03:55:55PM -0400, J??rn Engel wrote: Actually, when I compare the two invocations, I prefer the list_for_each_entry_del() variant over list_pop_entry(). while ((ref = list_pop_entry(prefs, struct __prelim_ref, list))) { list_for_each_entry_del(ref,

Re: [PATCH 0/2] introduce list_for_each_entry_del

2013-06-04 Thread Chris Mason
Quoting Christoph Hellwig (2013-06-04 10:48:56) On Mon, Jun 03, 2013 at 03:55:55PM -0400, J??rn Engel wrote: Actually, when I compare the two invocations, I prefer the list_for_each_entry_del() variant over list_pop_entry(). while ((ref = list_pop_entry(prefs, struct

wait_block_group_cache_progress() waits forever in case of drive failure

2013-06-04 Thread Alex Lyakas
Greetings all, when testing drive failures, I occasionally hit the following hang: # Block group is being cached-in by caching_thread() # caching_thread() experiences an error, e.g., in btrfs_search_slot, because of drive failure: ret = btrfs_search_slot(NULL, extent_root, key, path, 0,

Re: [PATCH 0/2] introduce list_for_each_entry_del

2013-06-04 Thread Arne Jansen
On 06/04/13 16:53, Chris Mason wrote: Quoting Christoph Hellwig (2013-06-04 10:48:56) On Mon, Jun 03, 2013 at 03:55:55PM -0400, J??rn Engel wrote: Actually, when I compare the two invocations, I prefer the list_for_each_entry_del() variant over list_pop_entry(). while ((ref =

Re: [PATCH 0/2] introduce list_for_each_entry_del

2013-06-04 Thread Jörn Engel
On Tue, 4 June 2013 22:09:13 +0200, Arne Jansen wrote: On 06/04/13 16:53, Chris Mason wrote: Quoting Christoph Hellwig (2013-06-04 10:48:56) On Mon, Jun 03, 2013 at 03:55:55PM -0400, J??rn Engel wrote: Actually, when I compare the two invocations, I prefer the list_for_each_entry_del()

[PATCH] Btrfs-progs: fix incorrect root backref errors in fsck

2013-06-04 Thread Josef Bacik
A user reported that fsck was complaining about unresolved refs for some snapshots. You can reproduce this by doing mkfs.btrfs /dev/sdb mount /dev/sdb /mnt btrfs subvol snap /mnt/ /mnt/a btrfs subvol snap /mnt/ /mnt/b btrfs subvol del /mnt/a umount /mnt btrfsck /dev/sdb and you'd get this

Recovering from btrfsck --init-csum-tree

2013-06-04 Thread Robin Kreis
Hello, how can I recover from running btrfsck --init-csum-tree on my 2TB btrfs? Every attempt to read a file results in no checksum being found, followed by a checksum mismatch which leads to the data block being zeroed out (see label zeroit in inode.c). My current fix is simply skipping the

[PATCH 0/6] fix INT_MAX readdir hang, plus cleanups

2013-06-04 Thread Zach Brown
Hi gang, I finally sat down to fix that readdir hang that has been in the back of my mind for a while. I *hope* that the fix is pretty simple: just don't manufacture a fake f_pos, I *think* we can abuse f_version as an indicator that we shouldn't return entries. Does this look reasonable? We

[PATCH 1/6] btrfs: set readdir f_pos only after filldir

2013-06-04 Thread Zach Brown
The only time we need to advance f_pos is after we've successfully given a result to userspace via filldir. This simplification gets rid of the is_curr variable used to update f_pos for the delayed item readdir entries. Signed-off-by: Zach Brown z...@redhat.com --- fs/btrfs/delayed-inode.c | 5

[PATCH 2/6] btrfs: fix readdir hang with offsets past INT_MAX

2013-06-04 Thread Zach Brown
To work around bugs in userspace btrfs_real_readdir() sets f_pos to an offset that will prevent any future entries from being returned once the last entry is hit. Over time this supposedly impossible offset was decreased from the initial U64_MAX to INT_MAX to appease 32bit userspace.

[PATCH 4/6] btrfs: simplify finding next/prev delayed items

2013-06-04 Thread Zach Brown
I'd like to use the currently unused next/prev arguments to __btrfs_lookup_delayed_item() in a future patch. I noticed that the code could be simplified. We don't need to use rb_next() or rb_prev() to walk back up the tree once we've failed to find the key at a leaf. We can record the most

[PATCH 5/6] btrfs: add helper to get delayed item root

2013-06-04 Thread Zach Brown
This just moves some duplicated code into a helper. I couldn't bring myself to add another copy in an upcoming patch. The delayed_root BUG() in __btrfs_remove_delayed_item() wasn't needed. The pointer deref will oops later if its null. And now the remaining BUG() is in one place! :)

[PATCH 3/6] btrfs: trivial delayed item readdir list cleanups

2013-06-04 Thread Zach Brown
Just call btrfs_put_delayed_items() for each list rather than having two list arguments and duplicated code. list_for_each_entry_safe() can handle an empty list. We don't have to conditionally use and tear down the lists if we always initialize them to be empty. They're only populated when

[PATCH 6/6] btrfs: get fewer delayed item refs during readdir

2013-06-04 Thread Zach Brown
On every readdir call all the delayed items for the dir are put on a private list with a held reference. If they're outside the f_pos values that this readdir call ends up using they're just dropped and removed from the list. We can make some tiny changes to cut down on this overhead. First,

Re: [PATCH 0/6] fix INT_MAX readdir hang, plus cleanups

2013-06-04 Thread Chris Mason
Quoting Zach Brown (2013-06-04 18:17:54) Hi gang, I finally sat down to fix that readdir hang that has been in the back of my mind for a while. I *hope* that the fix is pretty simple: just don't manufacture a fake f_pos, I *think* we can abuse f_version as an indicator that we shouldn't

Re: [PATCH 0/6] fix INT_MAX readdir hang, plus cleanups

2013-06-04 Thread Zach Brown
On Tue, Jun 04, 2013 at 07:16:53PM -0400, Chris Mason wrote: Quoting Zach Brown (2013-06-04 18:17:54) Hi gang, I finally sat down to fix that readdir hang that has been in the back of my mind for a while. I *hope* that the fix is pretty simple: just don't manufacture a fake f_pos, I

Re: [PATCH 1/6] btrfs: set readdir f_pos only after filldir

2013-06-04 Thread Miao Xie
On tue, 4 Jun 2013 15:17:55 -0700, Zach Brown wrote: The only time we need to advance f_pos is after we've successfully given a result to userspace via filldir. This simplification gets rid of the is_curr variable used to update f_pos for the delayed item readdir entries.

Re: [PATCH 0/6] fix INT_MAX readdir hang, plus cleanups

2013-06-04 Thread Miao Xie
On tue, 4 Jun 2013 16:26:57 -0700, Zach Brown wrote: On Tue, Jun 04, 2013 at 07:16:53PM -0400, Chris Mason wrote: Quoting Zach Brown (2013-06-04 18:17:54) Hi gang, I finally sat down to fix that readdir hang that has been in the back of my mind for a while. I *hope* that the fix is

[PATCH 1/2] list: add while_list_drain_entry

2013-06-04 Thread Jörn Engel
I have seen a lot of boilerplate code that either follows the pattern of while (!list_empty(head)) { pos = list_entry(head-next, struct foo, list); list_del(pos-list); ... } or some variant thereof. With this patch in, people can use

[PATCH 2/2] btrfs: use while_list_drain_entry

2013-06-04 Thread Jörn Engel
Signed-off-by: Joern Engel jo...@logfs.org --- fs/btrfs/backref.c | 15 +++ fs/btrfs/compression.c |4 +--- fs/btrfs/disk-io.c |6 +- fs/btrfs/extent-tree.c | 17 +++-- fs/btrfs/extent_io.c|8 ++-- fs/btrfs/inode.c| 16

Re: [PATCH 0/2] introduce list_for_each_entry_del

2013-06-04 Thread Jörn Engel
On Tue, 4 June 2013 14:44:35 -0400, Jörn Engel wrote: Or while_list_drain? Not sure if the silence is approval or lack of interest, but a new set of patches is posted. By playing around with the implementation a bit, I have actually found a variant that makes the object code shrink. Not one

v3.9 bug at /fs/btrfs/free-space-cache.c:1567 after powercycle

2013-06-04 Thread Sage Weil
Hi- I'm pretty reliably triggering the following bug after powercycling an active btrfs + ceph workload and then trying to remount. Is this a known issue? sage 2013-06-04T18:54:28.532988-07:00 plana71 kernel: [ 39.311120] [ cut here ]