Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 21059
b: refs/heads/master
c: 5466eb5
h: refs/heads/master
i:
  21057: 72bce08
  21055: e73c900
v: v3
  • Loading branch information
Linus Torvalds committed Mar 16, 2006
1 parent 495ad6e commit f880149
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 20 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 4333298965cd62585bec891a6a5c9f4c806fc6bd
refs/heads/master: 5466eb5d0ad5e9d4238da71a2a9bd216985a4849
28 changes: 12 additions & 16 deletions trunk/fs/ext2/dir.c
Original file line number Diff line number Diff line change
Expand Up @@ -256,11 +256,10 @@ ext2_readdir (struct file * filp, void * dirent, filldir_t filldir)
unsigned long npages = dir_pages(inode);
unsigned chunk_mask = ~(ext2_chunk_size(inode)-1);
unsigned char *types = NULL;
int need_revalidate = (filp->f_version != inode->i_version);
int ret;
int need_revalidate = filp->f_version != inode->i_version;

if (pos > inode->i_size - EXT2_DIR_REC_LEN(1))
goto success;
return 0;

if (EXT2_HAS_INCOMPAT_FEATURE(sb, EXT2_FEATURE_INCOMPAT_FILETYPE))
types = ext2_filetype_table;
Expand All @@ -275,12 +274,15 @@ ext2_readdir (struct file * filp, void * dirent, filldir_t filldir)
"bad page in #%lu",
inode->i_ino);
filp->f_pos += PAGE_CACHE_SIZE - offset;
ret = -EIO;
goto done;
return -EIO;
}
kaddr = page_address(page);
if (need_revalidate) {
offset = ext2_validate_entry(kaddr, offset, chunk_mask);
if (unlikely(need_revalidate)) {
if (offset) {
offset = ext2_validate_entry(kaddr, offset, chunk_mask);
filp->f_pos = (n<<PAGE_CACHE_SHIFT) + offset;
}
filp->f_version = inode->i_version;
need_revalidate = 0;
}
de = (ext2_dirent *)(kaddr+offset);
Expand All @@ -289,9 +291,8 @@ ext2_readdir (struct file * filp, void * dirent, filldir_t filldir)
if (de->rec_len == 0) {
ext2_error(sb, __FUNCTION__,
"zero-length directory entry");
ret = -EIO;
ext2_put_page(page);
goto done;
return -EIO;
}
if (de->inode) {
int over;
Expand All @@ -306,19 +307,14 @@ ext2_readdir (struct file * filp, void * dirent, filldir_t filldir)
le32_to_cpu(de->inode), d_type);
if (over) {
ext2_put_page(page);
goto success;
return 0;
}
}
filp->f_pos += le16_to_cpu(de->rec_len);
}
ext2_put_page(page);
}

success:
ret = 0;
done:
filp->f_version = inode->i_version;
return ret;
return 0;
}

/*
Expand Down
5 changes: 2 additions & 3 deletions trunk/fs/namespace.c
Original file line number Diff line number Diff line change
Expand Up @@ -1338,7 +1338,7 @@ struct namespace *dup_namespace(struct task_struct *tsk, struct fs_struct *fs)

new_ns = kmalloc(sizeof(struct namespace), GFP_KERNEL);
if (!new_ns)
goto out;
return NULL;

atomic_set(&new_ns->count, 1);
INIT_LIST_HEAD(&new_ns->list);
Expand All @@ -1352,7 +1352,7 @@ struct namespace *dup_namespace(struct task_struct *tsk, struct fs_struct *fs)
if (!new_ns->root) {
up_write(&namespace_sem);
kfree(new_ns);
goto out;
return NULL;
}
spin_lock(&vfsmount_lock);
list_add_tail(&new_ns->list, &new_ns->root->mnt_list);
Expand Down Expand Up @@ -1393,7 +1393,6 @@ struct namespace *dup_namespace(struct task_struct *tsk, struct fs_struct *fs)
if (altrootmnt)
mntput(altrootmnt);

out:
return new_ns;
}

Expand Down

0 comments on commit f880149

Please sign in to comment.