[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20141022165530.GA30358@redhat.com>
Date: Wed, 22 Oct 2014 18:55:30 +0200
From: Oleg Nesterov <oleg@...hat.com>
To: Victor Kamensky <victor.kamensky@...aro.org>
Cc: Alexander Viro <viro@...iv.linux.org.uk>,
linux-fsdevel@...r.kernel.org,
Andrew Morton <akpm@...ux-foundation.org>,
Kees Cook <keescook@...omium.org>, linux-kernel@...r.kernel.org
Subject: Re: [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.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists