All of lore.kernel.org
 help / color / mirror / Atom feed
* [patch] 9p: return on mutex_lock_interruptible()
@ 2010-03-30  9:41 ` Dan Carpenter
  0 siblings, 0 replies; 2+ messages in thread
From: Dan Carpenter @ 2010-03-30  9:41 UTC (permalink / raw)
  To: Eric Van Hensbergen
  Cc: Ron Minnich, Latchesar Ionkov, Sripathi Kodi, Jim Garlick,
	Martin Stava, Aneesh Kumar K.V, v9fs-developer, linux-kernel,
	kernel-janitors

If "err" is -EINTR here the original code calls mutex_unlock() and then
returns, but it should just return directly.

Signed-off-by: Dan Carpenter <error27@gmail.com>

diff --git a/fs/9p/vfs_dir.c b/fs/9p/vfs_dir.c
index d8a3afe..bbe00cf 100644
--- a/fs/9p/vfs_dir.c
+++ b/fs/9p/vfs_dir.c
@@ -130,6 +130,8 @@ static int v9fs_dir_readdir(struct file *filp, void *dirent, filldir_t filldir)
 	rdir = (struct p9_rdir *) fid->rdir;
 
 	err = mutex_lock_interruptible(&rdir->mutex);
+	if (err)
+		return err;
 	while (err == 0) {
 		if (rdir->tail == rdir->head) {
 			err = v9fs_file_readn(filp, rdir->buf, NULL,

^ permalink raw reply	[flat|nested] 2+ messages in thread

* [patch] 9p: return on mutex_lock_interruptible()
@ 2010-03-30  9:41 ` Dan Carpenter
  0 siblings, 0 replies; 2+ messages in thread
From: Dan Carpenter @ 2010-03-30  9:41 UTC (permalink / raw)
  To: Eric Van Hensbergen
  Cc: Ron Minnich, Latchesar Ionkov, Sripathi Kodi, Jim Garlick,
	Martin Stava, Aneesh Kumar K.V, v9fs-developer, linux-kernel,
	kernel-janitors

If "err" is -EINTR here the original code calls mutex_unlock() and then
returns, but it should just return directly.

Signed-off-by: Dan Carpenter <error27@gmail.com>

diff --git a/fs/9p/vfs_dir.c b/fs/9p/vfs_dir.c
index d8a3afe..bbe00cf 100644
--- a/fs/9p/vfs_dir.c
+++ b/fs/9p/vfs_dir.c
@@ -130,6 +130,8 @@ static int v9fs_dir_readdir(struct file *filp, void *dirent, filldir_t filldir)
 	rdir = (struct p9_rdir *) fid->rdir;
 
 	err = mutex_lock_interruptible(&rdir->mutex);
+	if (err)
+		return err;
 	while (err = 0) {
 		if (rdir->tail = rdir->head) {
 			err = v9fs_file_readn(filp, rdir->buf, NULL,

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-03-30  9:41 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-03-30  9:41 [patch] 9p: return on mutex_lock_interruptible() Dan Carpenter
2010-03-30  9:41 ` Dan Carpenter

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.