Message ID | 1243893048-17031-22-git-send-email-ebiederm@xmission.com (mailing list archive) |
---|---|
State | Not Applicable, archived |
Headers | show |
diff --git a/mm/fadvise.c b/mm/fadvise.c index 54a0f80..d7f1fba 100644 --- a/mm/fadvise.c +++ b/mm/fadvise.c @@ -38,6 +38,11 @@ SYSCALL_DEFINE(fadvise64_64)(int fd, loff_t offset, loff_t len, int advice) if (!file) return -EBADF; + ret = -EIO; + if (!file_hotplug_read_trylock(file)) + goto out_fput; + + ret = 0; if (S_ISFIFO(file->f_path.dentry->d_inode->i_mode)) { ret = -ESPIPE; goto out; @@ -123,6 +128,8 @@ SYSCALL_DEFINE(fadvise64_64)(int fd, loff_t offset, loff_t len, int advice) ret = -EINVAL; } out: + file_hotplug_read_unlock(file); +out_fput: fput(file); return ret; }