From: sougata santra <sougata@tuxera.com>
To: Vyacheslav Dubeyko <slava@dubeyko.com>
Cc: Andrew Morton <akpm@linux-foundation.org>, <hch@infradead.org>,
<linux-fsdevel@vger.kernel.org>,
Fabian Frederick <fabf@skynet.be>
Subject: Re: [PATCH 1/1] hfsplus: skip unnecessary volume header sync
Date: Sat, 19 Jul 2014 15:18:20 +0300 [thread overview]
Message-ID: <53CA620C.5060009@tuxera.com> (raw)
In-Reply-To: <7632517E-83B7-4956-BB50-9A2FD1E13A7B@dubeyko.com>
On 07/19/2014 01:58 PM, Vyacheslav Dubeyko wrote:
>
> On Jul 18, 2014, at 1:49 PM, Sougata Santra wrote:
>
>> On Fri, 2014-07-18 at 13:01 +0400, Vyacheslav Dubeyko wrote:
>>> On Fri, 2014-07-18 at 11:35 +0300, Sougata Santra wrote:
>>>
>>> [snip]
>>>> 2) Also, there was a error in error propagation. It it also fixed in
>>>> this patch.
>>>> -->snip<--
>>>> if (!error)
>>>> error2 = error;
>>>> -->snap<--
>>>>
>>>> 3) The disk is only flushed if there was no error. Previously it was
>>>> always flushed without checking the error.
>>>
>>> So, do you mean that filemap_write_and_wait() and hfsplus_submit_bio()
>>> doesn't request writing on a volume?
>> Yes it did, but it wrote in the page-cache ?.
>
> The hfsplus_submit_bio() makes bio allocation via bio_alloc() and, then,
> send request on write into elevator queue by means of submit_bio_wait().
> Moreover, submit_bio_wait() submits a bio, and wait until it completes.
> It means that we have changed block on volume after returning from
> hfsplus_submit_bio().
AFAIK, this is not always correct, we don't change the block on the
volume. The block device driver uses special command to initiate data
transfer with the disk controller. Then the disk controller uses DMA to
transfer the data and raises an interrupt that it is done with the data
transfer. That does not mean that the data is there is in the
non-volatile memory of the disk. If there is a write back cache in the
disk then the data is stored there. Then the disk controller uses its
own algorithm to write back data from its own cache to disk. The flush
operation sends an empty bio requesting flush of the write back cache.
My argument was when there was a problem of transferring the data into
disk cache, why bother to flush it. And if any data has already been
written to disk cache, the disk controller takes care and writes it
into non volatile memory, given that there is no power-off/plug-out
scenarios.
>
> The filemap_write_and_wait() calls do_writepages() finally. It calls
> mapping->a_ops->writepages(). So, it means that do_writepages() calls
> hfsplus_writepages(). As a result, finally, requests on write are placed in
> elevator queue. And, again, dirty pages of inode->i_mapping (page cache)
> will be on volume after returning from filemap_write_and_wait().
>
> This is my understanding of hfsplus_sync_fs() method's logic. Please,
> correct me if I am wrong.
>
> So, if you try to prevent from blkdev_issue_flush() then it doesn't mean
> that you prevent from writing special files and volume header on volume.
> I suppose that logic of writing in any case was special policy. Because
> fsck utility can help to us in some bad situations. This is my understanding
> of this method's logic.
Please don't get incorrect. I am not sure if should be done or not.
Obviously if it is not the best thing to do, we won't do it :-).
>
> Thanks,
> Vyacheslav Dubeyko.
>
Thanks a lot,
Sougata Santra
next prev parent reply other threads:[~2014-07-19 12:18 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-07-17 16:32 [PATCH 1/1] hfsplus: skip unnecessary volume header sync Sougata Santra
2014-07-17 20:59 ` Andrew Morton
2014-07-18 8:35 ` Sougata Santra
2014-07-18 9:01 ` Vyacheslav Dubeyko
2014-07-18 9:49 ` Sougata Santra
2014-07-19 10:58 ` Vyacheslav Dubeyko
2014-07-19 12:18 ` sougata santra [this message]
2014-07-18 8:28 ` Vyacheslav Dubeyko
2014-07-18 9:24 ` Sougata Santra
2014-07-19 11:23 ` Vyacheslav Dubeyko
2014-07-19 11:59 ` sougata santra
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=53CA620C.5060009@tuxera.com \
--to=sougata@tuxera.com \
--cc=akpm@linux-foundation.org \
--cc=fabf@skynet.be \
--cc=hch@infradead.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=slava@dubeyko.com \
/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).