lkml.org 
[lkml]   [2009]   [Jul]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[Patch] pipe: use file_update_time() when hold i_mutex

file_update_time() should be called with i_mutex held,
move it before mutex_unlock().

Signed-off-by: WANG Cong <amwang@redhat.com>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
Cc: Miklos Szeredi <mszeredi@suse.cz>

---
diff --git a/fs/pipe.c b/fs/pipe.c
index f7dd21a..724b035 100644
--- a/fs/pipe.c
+++ b/fs/pipe.c
@@ -602,13 +602,14 @@ redo2:
pipe->waiting_writers--;
}
out:
+ if (ret > 0)
+ file_update_time(filp);
+
mutex_unlock(&inode->i_mutex);
if (do_wakeup) {
wake_up_interruptible_sync(&pipe->wait);
kill_fasync(&pipe->fasync_readers, SIGIO, POLL_IN);
}
- if (ret > 0)
- file_update_time(filp);
return ret;
}


\
 
 \ /
  Last update: 2009-07-06 07:39    [W:0.082 / U:0.036 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site