summaryrefslogtreecommitdiffstats
path: root/fs/binfmt_misc.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2015-04-26 18:48:49 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2015-04-26 20:22:07 -0400
commit9ec3a646fe09970f801ab15e0f1694060b9f19af (patch)
tree697058ca7e1671eda180a3ccc62445686fbc1a31 /fs/binfmt_misc.c
parentc8b3fd0ce313443731e8fd6d5a541085eb465f99 (diff)
parent3cab989afd8d8d1bc3d99fef0e7ed87c31e7b647 (diff)
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
Pull fourth vfs update from Al Viro: "d_inode() annotations from David Howells (sat in for-next since before the beginning of merge window) + four assorted fixes" * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: RCU pathwalk breakage when running into a symlink overmounting something fix I_DIO_WAKEUP definition direct-io: only inc/dec inode->i_dio_count for file systems fs/9p: fix readdir() VFS: assorted d_backing_inode() annotations VFS: fs/inode.c helpers: d_inode() annotations VFS: fs/cachefiles: d_backing_inode() annotations VFS: fs library helpers: d_inode() annotations VFS: assorted weird filesystems: d_inode() annotations VFS: normal filesystems (and lustre): d_inode() annotations VFS: security/: d_inode() annotations VFS: security/: d_backing_inode() annotations VFS: net/: d_inode() annotations VFS: net/unix: d_backing_inode() annotations VFS: kernel/: d_inode() annotations VFS: audit: d_backing_inode() annotations VFS: Fix up some ->d_inode accesses in the chelsio driver VFS: Cachefiles should perform fs modifications on the top layer only VFS: AF_UNIX sockets should call mknod on the top layer only
Diffstat (limited to 'fs/binfmt_misc.c')
-rw-r--r--fs/binfmt_misc.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/fs/binfmt_misc.c b/fs/binfmt_misc.c
index 9dcb05409ba7..78f005f37847 100644
--- a/fs/binfmt_misc.c
+++ b/fs/binfmt_misc.c
@@ -591,7 +591,7 @@ static void kill_node(Node *e)
591 write_unlock(&entries_lock); 591 write_unlock(&entries_lock);
592 592
593 if (dentry) { 593 if (dentry) {
594 drop_nlink(dentry->d_inode); 594 drop_nlink(d_inode(dentry));
595 d_drop(dentry); 595 d_drop(dentry);
596 dput(dentry); 596 dput(dentry);
597 simple_release_fs(&bm_mnt, &entry_count); 597 simple_release_fs(&bm_mnt, &entry_count);
@@ -638,11 +638,11 @@ static ssize_t bm_entry_write(struct file *file, const char __user *buffer,
638 case 3: 638 case 3:
639 /* Delete this handler. */ 639 /* Delete this handler. */
640 root = dget(file->f_path.dentry->d_sb->s_root); 640 root = dget(file->f_path.dentry->d_sb->s_root);
641 mutex_lock(&root->d_inode->i_mutex); 641 mutex_lock(&d_inode(root)->i_mutex);
642 642
643 kill_node(e); 643 kill_node(e);
644 644
645 mutex_unlock(&root->d_inode->i_mutex); 645 mutex_unlock(&d_inode(root)->i_mutex);
646 dput(root); 646 dput(root);
647 break; 647 break;
648 default: 648 default:
@@ -675,14 +675,14 @@ static ssize_t bm_register_write(struct file *file, const char __user *buffer,
675 return PTR_ERR(e); 675 return PTR_ERR(e);
676 676
677 root = dget(sb->s_root); 677 root = dget(sb->s_root);
678 mutex_lock(&root->d_inode->i_mutex); 678 mutex_lock(&d_inode(root)->i_mutex);
679 dentry = lookup_one_len(e->name, root, strlen(e->name)); 679 dentry = lookup_one_len(e->name, root, strlen(e->name));
680 err = PTR_ERR(dentry); 680 err = PTR_ERR(dentry);
681 if (IS_ERR(dentry)) 681 if (IS_ERR(dentry))
682 goto out; 682 goto out;
683 683
684 err = -EEXIST; 684 err = -EEXIST;
685 if (dentry->d_inode) 685 if (d_really_is_positive(dentry))
686 goto out2; 686 goto out2;
687 687
688 inode = bm_get_inode(sb, S_IFREG | 0644); 688 inode = bm_get_inode(sb, S_IFREG | 0644);
@@ -711,7 +711,7 @@ static ssize_t bm_register_write(struct file *file, const char __user *buffer,
711out2: 711out2:
712 dput(dentry); 712 dput(dentry);
713out: 713out:
714 mutex_unlock(&root->d_inode->i_mutex); 714 mutex_unlock(&d_inode(root)->i_mutex);
715 dput(root); 715 dput(root);
716 716
717 if (err) { 717 if (err) {
@@ -754,12 +754,12 @@ static ssize_t bm_status_write(struct file *file, const char __user *buffer,
754 case 3: 754 case 3:
755 /* Delete all handlers. */ 755 /* Delete all handlers. */
756 root = dget(file->f_path.dentry->d_sb->s_root); 756 root = dget(file->f_path.dentry->d_sb->s_root);
757 mutex_lock(&root->d_inode->i_mutex); 757 mutex_lock(&d_inode(root)->i_mutex);
758 758
759 while (!list_empty(&entries)) 759 while (!list_empty(&entries))
760 kill_node(list_entry(entries.next, Node, list)); 760 kill_node(list_entry(entries.next, Node, list));
761 761
762 mutex_unlock(&root->d_inode->i_mutex); 762 mutex_unlock(&d_inode(root)->i_mutex);
763 dput(root); 763 dput(root);
764 break; 764 break;
765 default: 765 default: