Skip to contentSkip to conversation

9p: return on mutex_lock_interruptible()

PATCH New Dan Carpenter 1 participant 1 message Mar 30, 2010

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 9p: return on mutex_lock_interruptible()

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

fs/9p/vfs_dir.c +2 -0
index d8a3afe..bbe00cf 100644
@@ -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,