Skip to content

Commit

Permalink
/proc/vmcore: fix seeking
Browse files Browse the repository at this point in the history
Commit 73296bc ("procfs: Use generic_file_llseek in /proc/vmcore")
broke seeking on /proc/vmcore.  This changes it back to use default_llseek
in order to restore the original behaviour.

The problem with generic_file_llseek is that it only allows seeks up to
inode->i_sb->s_maxbytes, which is zero on procfs and some other virtual
file systems.  We should merge generic_file_llseek and default_llseek some
day and clean this up in a proper way, but for 2.6.35/36, reverting vmcore
is the safer solution.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Reported-by: CAI Qian <caiqian@redhat.com>
Tested-by: CAI Qian <caiqian@redhat.com>
Cc: <stable@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
arndb authored and torvalds committed Sep 23, 2010
1 parent a9e3176 commit c227e69
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fs/proc/vmcore.c
Expand Up @@ -163,7 +163,7 @@ static ssize_t read_vmcore(struct file *file, char __user *buffer,

static const struct file_operations proc_vmcore_operations = {
.read = read_vmcore,
.llseek = generic_file_llseek,
.llseek = default_llseek,
};

static struct vmcore* __init get_new_element(void)
Expand Down

0 comments on commit c227e69

Please sign in to comment.