From: Amerigo Wang <amwang@redhat.com>
To: linux-kernel@vger.kernel.org
Cc: Heiko Carstens <heiko.carstens@de.ibm.com>,
Amerigo Wang <amwang@redhat.com>,
linux-fsdevel@vger.kernel.org, akpm@linux-foundation.org,
Al Viro <viro@zeniv.linux.org.uk>,
Miklos Szeredi <mszeredi@suse.cz>
Subject: [Patch] pipe: use file_update_time() when hold i_mutex
Date: Mon, 6 Jul 2009 01:35:30 -0400 [thread overview]
Message-ID: <20090706053745.6338.50777.sendpatchset@localhost.localdomain> (raw)
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;
}
next reply other threads:[~2009-07-06 5:36 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-07-06 5:35 Amerigo Wang [this message]
2009-07-20 21:11 ` [Patch] pipe: use file_update_time() when hold i_mutex Andrew Morton
2009-07-21 10:07 ` Amerigo Wang
2009-07-21 11:09 ` Miklos Szeredi
2009-07-22 9:21 ` Amerigo Wang
2009-08-03 16:58 ` Miklos Szeredi
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20090706053745.6338.50777.sendpatchset@localhost.localdomain \
--to=amwang@redhat.com \
--cc=akpm@linux-foundation.org \
--cc=heiko.carstens@de.ibm.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mszeredi@suse.cz \
--cc=viro@zeniv.linux.org.uk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox