public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Dmitriy Monakhov <dmonakhov@sw.ru>
To: Jens Axboe <jens.axboe@oracle.com>
Cc: Dmitriy Monakhov <dmonakhov@sw.ru>, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] splice: partial write handling fix
Date: Thu, 15 Mar 2007 16:46:32 +0300	[thread overview]
Message-ID: <87fy86oc07.fsf@sw.ru> (raw)
In-Reply-To: <20070315122127.GO15400@kernel.dk> (Jens Axboe's message of "Thu, 15 Mar 2007 13:21:27 +0100")

Jens Axboe <jens.axboe@oracle.com> writes:

> On Wed, Mar 14 2007, Dmitriy Monakhov wrote:
>> currently if partial write has happened while ->commit_write() then page
>> wasn't marked as accessed and rebalanced. 
>
> The ->commit_write() return values aren't very well designed imho. Is
> your fix correct getting the pipe_to_file() return value correct now?
I think yes, after my patch this path look like follows:

        ret = mapping->a_ops->commit_write(file, page, offset, offset+this_len);
        if (ret) {
                if(ret == AOP_TRUNCATED_PAGE) {
                        page_cache_release(page);
                        goto find_page;
                }
                if (ret < 0)
                        goto out;
                /*
                 * Partial write has happened, so 'ret' already initialized by
                 * number of bytes written, Where is nothing we have to do here.
                 */
        } else
                ret = this_len;
        /*
         * Return the number of bytes written and mark page as
         * accessed, we are now done!
         */
        mark_page_accessed(page);
        balance_dirty_pages_ratelimited(mapping);
out:
        page_cache_release(page);
        unlock_page(page);
out_ret:
        return ret;
}

But off corse this patch does't fix issues spotted by Nick. 
>
> -- 
> Jens Axboe
>
> -
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/


      reply	other threads:[~2007-03-15 13:46 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-03-14 15:55 [PATCH] splice: partial write handling fix Dmitriy Monakhov
2007-03-15 12:21 ` Jens Axboe
2007-03-15 13:46   ` Dmitriy Monakhov [this message]

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=87fy86oc07.fsf@sw.ru \
    --to=dmonakhov@sw.ru \
    --cc=jens.axboe@oracle.com \
    --cc=linux-kernel@vger.kernel.org \
    /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