lkml.org 
[lkml]   [2014]   [Oct]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFC PATCH] coredump: fix incomplete core file created when dump_skip was used last
On 10/21, Victor Kamensky wrote:
>
> +static int dump_write_last_byte(struct coredump_params *cprm)
> +{
> + char lastbyte = 0;
> + struct file *file = cprm->file;
> +
> + if (file->f_op->llseek && file->f_op->llseek != no_llseek) {
> + if (dump_interrupted() ||
> + file->f_op->llseek(file, -1, SEEK_CUR) < 0)
> + return 0;
> + if (!dump_emit(cprm, &lastbyte, 1))
> + return 0;
> + }
> + return 1;
> +}

Perhaps do_truncate(cprm.file->f_path.dentry, ->f_pos) makes more sense?

and unless I missed something cprm->last_op_status can be avoided, we can
simply check f_pos != i_size_read() at the end?

Oleg.



\
 
 \ /
  Last update: 2014-10-22 20:21    [W:0.061 / U:0.152 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site