Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 84727
b: refs/heads/master
c: 9261303
h: refs/heads/master
i:
  84725: 577772d
  84723: b3e6d59
  84719: df65d1d
v: v3
  • Loading branch information
Christoph Hellwig authored and Linus Torvalds committed Feb 8, 2008
1 parent 553ef8b commit 80edf80
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 8b88b0998e35d239e74446cc30f354bdab86df89
refs/heads/master: 9261303ab7589cda6a3b95f9f80c9063538dc335
10 changes: 8 additions & 2 deletions trunk/fs/libfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -634,7 +634,10 @@ ssize_t simple_attr_read(struct file *file, char __user *buf,
if (!attr->get)
return -EACCES;

mutex_lock(&attr->mutex);
ret = mutex_lock_interruptible(&attr->mutex);
if (ret)
return ret;

if (*ppos) { /* continued read */
size = strlen(attr->get_buf);
} else { /* first read */
Expand Down Expand Up @@ -666,7 +669,10 @@ ssize_t simple_attr_write(struct file *file, const char __user *buf,
if (!attr->set)
return -EACCES;

mutex_lock(&attr->mutex);
ret = mutex_lock_interruptible(&attr->mutex);
if (ret)
return ret;

ret = -EFAULT;
size = min(sizeof(attr->set_buf) - 1, len);
if (copy_from_user(attr->set_buf, buf, size))
Expand Down

0 comments on commit 80edf80

Please sign in to comment.