linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Oleg Nesterov <oleg@redhat.com>
To: Victor Kamensky <victor.kamensky@linaro.org>
Cc: Alexander Viro <viro@zeniv.linux.org.uk>,
	linux-fsdevel@vger.kernel.org,
	Andrew Morton <akpm@linux-foundation.org>,
	Kees Cook <keescook@chromium.org>,
	linux-kernel@vger.kernel.org
Subject: Re: [RFC PATCH] coredump: fix incomplete core file created when dump_skip was used last
Date: Wed, 22 Oct 2014 18:55:30 +0200	[thread overview]
Message-ID: <20141022165530.GA30358@redhat.com> (raw)
In-Reply-To: <1413932228-27642-2-git-send-email-victor.kamensky@linaro.org>

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.

  reply	other threads:[~2014-10-22 16:55 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-21 22:57 [RFC PATCH] coredump: fix incomplete core file created when dump_skip was used last Victor Kamensky
2014-10-21 22:57 ` Victor Kamensky
2014-10-22 16:55   ` Oleg Nesterov [this message]
2014-10-22 23:21     ` Victor Kamensky
2014-10-23 16:39       ` Oleg Nesterov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20141022165530.GA30358@redhat.com \
    --to=oleg@redhat.com \
    --cc=akpm@linux-foundation.org \
    --cc=keescook@chromium.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=victor.kamensky@linaro.org \
    --cc=viro@zeniv.linux.org.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).