[PATCH] ext4: Use exclusive locking for ext4_readdir()

From: Jan Kara
Date: Tue Oct 04 2016 - 04:56:00 EST


We use file->private_data to track information for readdir calls. As
such we cannot allow two readdir calls to happen at the same time for
one struct file as they end up corrupting the information. For now just
revert back to the old behavior where readdirs are synchronized.

Signed-off-by: Jan Kara <jack@xxxxxxx>
---
fs/ext4/dir.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/ext4/dir.c b/fs/ext4/dir.c
index 67415e0e6af0..5ee86243620b 100644
--- a/fs/ext4/dir.c
+++ b/fs/ext4/dir.c
@@ -651,7 +651,7 @@ int ext4_check_all_de(struct inode *dir, struct buffer_head *bh, void *buf,
const struct file_operations ext4_dir_operations = {
.llseek = ext4_dir_llseek,
.read = generic_read_dir,
- .iterate_shared = ext4_readdir,
+ .iterate = ext4_readdir,
.unlocked_ioctl = ext4_ioctl,
#ifdef CONFIG_COMPAT
.compat_ioctl = ext4_compat_ioctl,
--
2.6.6


--LQksG6bCIzRHxTLp--