summaryrefslogtreecommitdiffstats
path: root/fs/btrfs/inode.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2010-01-21 07:28:05 -0800
committerLinus Torvalds <torvalds@linux-foundation.org>2010-01-21 07:28:05 -0800
commit30a0f5e1fb510f17c25ff159a9fffbe01ae0f34e (patch)
tree3392e115d4d5767c8bdaeac8696a2465d65a1e91 /fs/btrfs/inode.c
parent88f5004430babb836cfce886d5d54c82166f8ba4 (diff)
parent11dfe35a0108097f2df1f042c485fa7f758c2cdf (diff)
downloadblackbird-obmc-linux-30a0f5e1fb510f17c25ff159a9fffbe01ae0f34e.tar.gz
blackbird-obmc-linux-30a0f5e1fb510f17c25ff159a9fffbe01ae0f34e.zip
Merge git://git.kernel.org/pub/scm/linux/kernel/git/mason/btrfs-unstable
* git://git.kernel.org/pub/scm/linux/kernel/git/mason/btrfs-unstable: Btrfs: fix possible panic on unmount Btrfs: deal with NULL acl sent to btrfs_set_acl Btrfs: fix regression in orphan cleanup Btrfs: Fix race in btrfs_mark_extent_written Btrfs, fix memory leaks in error paths Btrfs: align offsets for btrfs_ordered_update_i_size btrfs: fix missing last-entry in readdir(3)
Diffstat (limited to 'fs/btrfs/inode.c')
-rw-r--r--fs/btrfs/inode.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c
index 5440bab23635..b330e27c2d8b 100644
--- a/fs/btrfs/inode.c
+++ b/fs/btrfs/inode.c
@@ -3796,6 +3796,12 @@ struct inode *btrfs_lookup_dentry(struct inode *dir, struct dentry *dentry)
if (location.type == BTRFS_INODE_ITEM_KEY) {
inode = btrfs_iget(dir->i_sb, &location, root);
+ if (unlikely(root->clean_orphans) &&
+ !(inode->i_sb->s_flags & MS_RDONLY)) {
+ down_read(&root->fs_info->cleanup_work_sem);
+ btrfs_orphan_cleanup(root);
+ up_read(&root->fs_info->cleanup_work_sem);
+ }
return inode;
}
@@ -3995,7 +4001,11 @@ skip:
/* Reached end of directory/root. Bump pos past the last item. */
if (key_type == BTRFS_DIR_INDEX_KEY)
- filp->f_pos = INT_LIMIT(off_t);
+ /*
+ * 32-bit glibc will use getdents64, but then strtol -
+ * so the last number we can serve is this.
+ */
+ filp->f_pos = 0x7fffffff;
else
filp->f_pos++;
nopos:
OpenPOWER on IntegriCloud