From mboxrd@z Thu Jan 1 00:00:00 1970 From: Boaz Harrosh Subject: Re: exofs_file_fsync Date: Mon, 31 May 2010 16:43:48 +0300 Message-ID: <4C03BD14.5030004@panasas.com> References: <20100531100927.GA11149@lst.de> <4C038E0D.3010400@panasas.com> <20100531102706.GA11961@lst.de> <4C038FE5.8000504@panasas.com> <20100531103349.GA12196@lst.de> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: linux-fsdevel@vger.kernel.org To: Christoph Hellwig Return-path: Received: from daytona.panasas.com ([67.152.220.89]:62646 "EHLO daytona.int.panasas.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1755119Ab0EaNnv (ORCPT ); Mon, 31 May 2010 09:43:51 -0400 In-Reply-To: <20100531103349.GA12196@lst.de> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On 05/31/2010 01:33 PM, Christoph Hellwig wrote: > On Mon, May 31, 2010 at 01:31:01PM +0300, Boaz Harrosh wrote: >> OK, I was just looking at that. thanks you saved me some digging. >> should I just open-code the generic_file_fsync minus the blocks >> thing then? > > sync_mapping_buffers is a no-op for you so you can keep it. > The other difference is that you sync out the superblock at the > end of your fsync implementation. That is rather unusual, but I don't > know enough about exofs if you really need to update data in the > superblock to commit file data to disk. > >> I'm busy with the truncate stuff, but I'll do this next. >> Do you need this ASAP? > > I just noticed it while walking through the fsync implementations. > OK Chritoff I would need your help Please. It looks like what I need exactly is: write_inode_now(inode, sync) But write_inode_now() has one extra hunk over generic_file_fsync: if (sync) inode_sync_wait(inode); Do you think I can get in trouble calling it from ->fsync I don't like generic_file_fsync because it does not write my data since I don't have buffer_heads. OK, I'm totally lost what does ->fsync need to do? only write the inode or the pages as well? Boaz --- git diff --stat -p -M fs/exofs/file.c fs/exofs/file.c | 8 ++------ 1 files changed, 2 insertions(+), 6 deletions(-) diff --git a/fs/exofs/file.c b/fs/exofs/file.c index f9bfe2b..9b3555e 100644 --- a/fs/exofs/file.c +++ b/fs/exofs/file.c @@ -47,18 +47,14 @@ static int exofs_file_fsync(struct file *filp, int datasync) struct inode *inode = mapping->host; struct super_block *sb; - ret = filemap_write_and_wait(mapping); - if (ret) - return ret; - /* sync the inode attributes */ - ret = write_inode_now(inode, 1); + ret = write_inode_now(inode, datasync); /* This is a good place to write the sb */ /* TODO: Sechedule an sb-sync on create */ sb = inode->i_sb; if (sb->s_dirt) - exofs_sync_fs(sb, 1); + exofs_sync_fs(sb, datasync); return ret; }