Skip to contentSkip to conversation

Kernel: mutex_lock_killable

PATCH In review Liam R. Howlett 1 participant 1 message Nov 28, 2007 VFS

lore
Share & tools
lore
#0 lore raw

PATCH 2/2 Kernel: mutex_lock_killable

Use mutex_lock_killable in vfs_readdir

---
 fs/readdir.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)
fs/readdir.c +4 -1
index efe52e6..4aee2c9 100644
@@ -30,7 +30,10 @@ int vfs_readdir(struct file *file, filldir_t filler, void *buf)
 	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);
Signature · 1 line
1.5.2.5