[Patch] pipe: use file_update_time() when hold i_mutex

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

Signed-off-by: WANG Cong <amwang@xxxxxxxxxx>
Cc: Al Viro <viro@xxxxxxxxxxxxxxxxxx>
Cc: Heiko Carstens <heiko.carstens@xxxxxxxxxx>
Cc: Miklos Szeredi <mszeredi@xxxxxxx>

---
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;
 }
 
--
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]
  Powered by Linux