All of lore.kernel.org
 help / color / mirror / Atom feed
From: Boaz Harrosh <bharrosh@panasas.com>
To: Christoph Hellwig <hch@lst.de>
Cc: linux-fsdevel@vger.kernel.org, open-osd <osd-dev@open-osd.org>
Subject: Re: [PATCH] exofs: exofs_file_fsync correctness
Date: Tue, 01 Jun 2010 19:10:00 +0300	[thread overview]
Message-ID: <4C0530D8.8010401@panasas.com> (raw)
In-Reply-To: <20100601154718.GA16412@lst.de>

On 06/01/2010 06:47 PM, Christoph Hellwig wrote:
> On Tue, Jun 01, 2010 at 06:40:46PM +0300, Boaz Harrosh wrote:
>>>> +	struct writeback_control wbc = {
>>>> +		.sync_mode = WB_SYNC_ALL,
>>>> +		.nr_to_write = LONG_MAX,
>>>
>>> By setting a nr_to_write you still write out data (at least in theory).
>>>
>>
>> So when do I also sync the data? is that done for me at the VFS layer?
> 
> You never have to.  vfs_fsync_range does the data writeout for you.
> 
>>> I'd recommend just copying the code from generic_file_fsync..
>>>
>>
>> I was actually mimicking the code from nfs/write.c which has similar
>> semantics as mine.
> 
> nfs code has no good reason to do that, at least when called from
> ->fsync.
> 
>> And if so then I'll need to not reuse the above in .flush
> 
> I would recommend keeping the ->flush code separate.

OK, ... I think I got it this time. (I hope)

And you are totally right. The ->flush code is called without any
locks and the ->fsync is called with i_mutex held. So the previous
code was totally racy for ->flush.

Boaz

  reply	other threads:[~2010-06-01 16:10 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-05-31 10:09 exofs_file_fsync Christoph Hellwig
2010-05-31 10:23 ` exofs_file_fsync Boaz Harrosh
2010-05-31 10:27   ` exofs_file_fsync Christoph Hellwig
2010-05-31 10:31     ` exofs_file_fsync Boaz Harrosh
2010-05-31 10:33       ` exofs_file_fsync Christoph Hellwig
2010-05-31 13:43         ` exofs_file_fsync Boaz Harrosh
2010-05-31 13:46           ` exofs_file_fsync Boaz Harrosh
2010-06-01 10:05             ` exofs_file_fsync Christoph Hellwig
2010-06-01 10:04           ` exofs_file_fsync Christoph Hellwig
2010-06-01 15:29             ` exofs_file_fsync Boaz Harrosh
2010-06-01 15:30 ` [PATCH] exofs: exofs_file_fsync correctness Boaz Harrosh
2010-06-01 15:33   ` [osd-dev] " Boaz Harrosh
2010-06-01 15:34   ` Christoph Hellwig
2010-06-01 15:40     ` Boaz Harrosh
2010-06-01 15:47       ` Christoph Hellwig
2010-06-01 16:10         ` Boaz Harrosh [this message]
2010-06-01 16:11   ` [PATCH ver2] exofs: exofs_file_fsync and exofs_file_flush correctness Boaz Harrosh
2010-06-01 16:17     ` Christoph Hellwig
2010-06-01 16:36       ` Boaz Harrosh
2010-06-01 17:03   ` [PATCH ver3] " Boaz Harrosh

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=4C0530D8.8010401@panasas.com \
    --to=bharrosh@panasas.com \
    --cc=hch@lst.de \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=osd-dev@open-osd.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.