Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 113467
b: refs/heads/master
c: 89a52e1
h: refs/heads/master
i:
  113465: 38d0d81
  113463: f370699
v: v3
  • Loading branch information
Sukadev Bhattiprolu authored and Linus Torvalds committed Oct 13, 2008
1 parent 5ac1661 commit 7a72335
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 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: 527b3e4773628b30d03323a2cb5fb0d84441990f
refs/heads/master: 89a52e109e2e2fe8bbd4e316cdb910774519c029
11 changes: 8 additions & 3 deletions trunk/fs/devpts/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,7 @@ int devpts_pty_new(struct inode *ptmx_inode, struct tty_struct *tty)
dev_t device = MKDEV(driver->major, driver->minor_start+number);
struct dentry *dentry;
struct inode *inode = new_inode(devpts_mnt->mnt_sb);
char s[12];

/* We're supposed to be given the slave end of a pty */
BUG_ON(driver->type != TTY_DRIVER_TYPE_PTY);
Expand All @@ -235,9 +236,13 @@ int devpts_pty_new(struct inode *ptmx_inode, struct tty_struct *tty)
init_special_inode(inode, S_IFCHR|config.mode, device);
inode->i_private = tty;

dentry = get_node(number);
if (!IS_ERR(dentry) && !dentry->d_inode) {
d_instantiate(dentry, inode);
sprintf(s, "%d", number);

mutex_lock(&devpts_root->d_inode->i_mutex);

dentry = d_alloc_name(devpts_root, s);
if (!IS_ERR(dentry)) {
d_add(dentry, inode);
fsnotify_create(devpts_root->d_inode, dentry);
}

Expand Down

0 comments on commit 7a72335

Please sign in to comment.