From: "Liam R. Howlett" Signed-off-by: Liam R. Howlett Acked-by: Matthew Wilcox Cc: Trond Myklebust Cc: "J. Bruce Fields" Cc: Ingo Molnar Cc: Peter Zijlstra Cc: Al Viro Cc: Christoph Hellwig Signed-off-by: Andrew Morton --- fs/readdir.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff -puN fs/readdir.c~vfs-use-mutex_lock_killable-in-vfs_readdir fs/readdir.c --- a/fs/readdir.c~vfs-use-mutex_lock_killable-in-vfs_readdir +++ a/fs/readdir.c @@ -30,7 +30,10 @@ int vfs_readdir(struct file *file, filld if (res) goto out; - mutex_lock(&inode->i_mutex); + res = -EINTR; + if (mutex_lock_killable(&inode->i_mutex)) + goto out; + res = -ENOENT; if (!IS_DEADDIR(inode)) { res = file->f_op->readdir(file, buf, filler); _