Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs-2.6

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs-2.6:
fs/dcache: allow d_obtain_alias() to return unhashed dentries
Check for immutable/append flag in fallocate path
sysctl: the include of rcupdate.h is only needed in the kernel
fat: fix d_revalidate oopsen on NFS exports
jfs: fix d_revalidate oopsen on NFS exports
ocfs2: fix d_revalidate oopsen on NFS exports
gfs2: fix d_revalidate oopsen on NFS exports
fuse: fix d_revalidate oopsen on NFS exports
ceph: fix d_revalidate oopsen on NFS exports
reiserfs xattr ->d_revalidate() shouldn't care about RCU
/proc/self is never going to be invalidated...

+39 -41
+1 -1
fs/ceph/dir.c
··· 993 993 { 994 994 struct inode *dir; 995 995 996 - if (nd->flags & LOOKUP_RCU) 996 + if (nd && nd->flags & LOOKUP_RCU) 997 997 return -ECHILD; 998 998 999 999 dir = dentry->d_parent->d_inode;
+24 -2
fs/dcache.c
··· 1523 1523 } 1524 1524 EXPORT_SYMBOL(d_alloc_root); 1525 1525 1526 + static struct dentry * __d_find_any_alias(struct inode *inode) 1527 + { 1528 + struct dentry *alias; 1529 + 1530 + if (list_empty(&inode->i_dentry)) 1531 + return NULL; 1532 + alias = list_first_entry(&inode->i_dentry, struct dentry, d_alias); 1533 + __dget(alias); 1534 + return alias; 1535 + } 1536 + 1537 + static struct dentry * d_find_any_alias(struct inode *inode) 1538 + { 1539 + struct dentry *de; 1540 + 1541 + spin_lock(&inode->i_lock); 1542 + de = __d_find_any_alias(inode); 1543 + spin_unlock(&inode->i_lock); 1544 + return de; 1545 + } 1546 + 1547 + 1526 1548 /** 1527 1549 * d_obtain_alias - find or allocate a dentry for a given inode 1528 1550 * @inode: inode to allocate the dentry for ··· 1574 1552 if (IS_ERR(inode)) 1575 1553 return ERR_CAST(inode); 1576 1554 1577 - res = d_find_alias(inode); 1555 + res = d_find_any_alias(inode); 1578 1556 if (res) 1579 1557 goto out_iput; 1580 1558 ··· 1587 1565 1588 1566 1589 1567 spin_lock(&inode->i_lock); 1590 - res = __d_find_alias(inode, 0); 1568 + res = __d_find_any_alias(inode); 1591 1569 if (res) { 1592 1570 spin_unlock(&inode->i_lock); 1593 1571 dput(tmp);
+2 -2
fs/fat/namei_vfat.c
··· 43 43 44 44 static int vfat_revalidate(struct dentry *dentry, struct nameidata *nd) 45 45 { 46 - if (nd->flags & LOOKUP_RCU) 46 + if (nd && nd->flags & LOOKUP_RCU) 47 47 return -ECHILD; 48 48 49 49 /* This is not negative dentry. Always valid. */ ··· 54 54 55 55 static int vfat_revalidate_ci(struct dentry *dentry, struct nameidata *nd) 56 56 { 57 - if (nd->flags & LOOKUP_RCU) 57 + if (nd && nd->flags & LOOKUP_RCU) 58 58 return -ECHILD; 59 59 60 60 /*
+1 -1
fs/fuse/dir.c
··· 158 158 { 159 159 struct inode *inode; 160 160 161 - if (nd->flags & LOOKUP_RCU) 161 + if (nd && nd->flags & LOOKUP_RCU) 162 162 return -ECHILD; 163 163 164 164 inode = entry->d_inode;
+1 -1
fs/gfs2/dentry.c
··· 44 44 int error; 45 45 int had_lock = 0; 46 46 47 - if (nd->flags & LOOKUP_RCU) 47 + if (nd && nd->flags & LOOKUP_RCU) 48 48 return -ECHILD; 49 49 50 50 parent = dget_parent(dentry);
+1 -1
fs/jfs/namei.c
··· 1600 1600 1601 1601 static int jfs_ci_revalidate(struct dentry *dentry, struct nameidata *nd) 1602 1602 { 1603 - if (nd->flags & LOOKUP_RCU) 1603 + if (nd && nd->flags & LOOKUP_RCU) 1604 1604 return -ECHILD; 1605 1605 /* 1606 1606 * This is not negative dentry. Always valid.
+1 -1
fs/ocfs2/dcache.c
··· 56 56 int ret = 0; /* if all else fails, just return false */ 57 57 struct ocfs2_super *osb; 58 58 59 - if (nd->flags & LOOKUP_RCU) 59 + if (nd && nd->flags & LOOKUP_RCU) 60 60 return -ECHILD; 61 61 62 62 inode = dentry->d_inode;
+8
fs/open.c
··· 233 233 234 234 if (!(file->f_mode & FMODE_WRITE)) 235 235 return -EBADF; 236 + 237 + /* It's not possible punch hole on append only file */ 238 + if (mode & FALLOC_FL_PUNCH_HOLE && IS_APPEND(inode)) 239 + return -EPERM; 240 + 241 + if (IS_IMMUTABLE(inode)) 242 + return -EPERM; 243 + 236 244 /* 237 245 * Revalidate the write permissions, in case security policy has 238 246 * changed since the files were opened.
-30
fs/proc/base.c
··· 2620 2620 &proc_self_inode_operations, NULL, {}), 2621 2621 }; 2622 2622 2623 - /* 2624 - * Exceptional case: normally we are not allowed to unhash a busy 2625 - * directory. In this case, however, we can do it - no aliasing problems 2626 - * due to the way we treat inodes. 2627 - */ 2628 - static int proc_base_revalidate(struct dentry *dentry, struct nameidata *nd) 2629 - { 2630 - struct inode *inode; 2631 - struct task_struct *task; 2632 - 2633 - if (nd->flags & LOOKUP_RCU) 2634 - return -ECHILD; 2635 - 2636 - inode = dentry->d_inode; 2637 - task = get_proc_task(inode); 2638 - if (task) { 2639 - put_task_struct(task); 2640 - return 1; 2641 - } 2642 - d_drop(dentry); 2643 - return 0; 2644 - } 2645 - 2646 - static const struct dentry_operations proc_base_dentry_operations = 2647 - { 2648 - .d_revalidate = proc_base_revalidate, 2649 - .d_delete = pid_delete_dentry, 2650 - }; 2651 - 2652 2623 static struct dentry *proc_base_instantiate(struct inode *dir, 2653 2624 struct dentry *dentry, struct task_struct *task, const void *ptr) 2654 2625 { ··· 2656 2685 if (p->fop) 2657 2686 inode->i_fop = p->fop; 2658 2687 ei->op = p->op; 2659 - d_set_d_op(dentry, &proc_base_dentry_operations); 2660 2688 d_add(dentry, inode); 2661 2689 error = NULL; 2662 2690 out:
-2
fs/reiserfs/xattr.c
··· 978 978 979 979 static int xattr_hide_revalidate(struct dentry *dentry, struct nameidata *nd) 980 980 { 981 - if (nd->flags & LOOKUP_RCU) 982 - return -ECHILD; 983 981 return -EPERM; 984 982 } 985 983