Skip to content

Commit

Permalink
Simplify fifo_open() locking logic
Browse files Browse the repository at this point in the history
We don't do interruptible waits for the pipe mutex anywhere else any
more either, so don't do it in fifo_open() either.

Acked-by: Ingo Molnar <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
Linus Torvalds committed Mar 7, 2006
1 parent d11d9b2 commit d19e997
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions fs/fifo.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,7 @@ static int fifo_open(struct inode *inode, struct file *filp)
{
int ret;

ret = -ERESTARTSYS;
if (mutex_lock_interruptible(PIPE_MUTEX(*inode)))
goto err_nolock_nocleanup;

mutex_lock(PIPE_MUTEX(*inode));
if (!inode->i_pipe) {
ret = -ENOMEM;
if(!pipe_new(inode))
Expand Down Expand Up @@ -140,8 +137,6 @@ static int fifo_open(struct inode *inode, struct file *filp)

err_nocleanup:
mutex_unlock(PIPE_MUTEX(*inode));

err_nolock_nocleanup:
return ret;
}

Expand Down

0 comments on commit d19e997

Please sign in to comment.