From: Andrew Morton <akpm@osdl.org>
To: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
Cc: machida@sm.sony.co.jp, linux-kernel@vger.kernel.org,
David Howells <dhowells@redhat.com>
Subject: Re: [PATCH 1/2] miss-sync changes on attributes (Re: [PATCH 2/2][FAT] miss-sync issues on sync mount (miss-sync on utime))
Date: Tue, 11 Oct 2005 21:16:01 -0700 [thread overview]
Message-ID: <20051011211601.72a0f91c.akpm@osdl.org> (raw)
In-Reply-To: <87r7armlgz.fsf@ibmpc.myhome.or.jp>
OGAWA Hirofumi <hirofumi@mail.parknet.co.jp> wrote:
>
> Andrew Morton <akpm@osdl.org> writes:
>
> >> /**
> >> + * sync_inode_wodata - sync(write and wait) inode to disk, without it's data.
> >> + * @inode: the inode to sync
> >> + *
> >> + * sync_inode_wodata() will write an inode then wait. It will also
> >> + * correctly update the inode on its superblock's dirty inode lists
> >> + * and will update inode->i_state.
> >> + *
> >> + * The caller must have a ref on the inode.
> >> + */
> >> +int sync_inode_wodata(struct inode *inode)
> >> +{
> >> + struct writeback_control wbc = {
> >> + .sync_mode = WB_SYNC_ALL, /* wait */
> >> + .nr_to_write = 0,/* no data to be written */
> >> + };
> >> + return sync_inode(inode, &wbc);
> >> +}
> >> +
> >
> > I think this function duplicates write_inode_now()?
>
> write_inode_now() seems to write data pages, but this doesn't write
> (.nr_to_write = 0).
hm, OK.
However there's not much point in writing a brand-new function when
write_inode_now() almost does the right thing. We can share the
implementation within fs-writeback.c.
<looks>
Isn't write_inode_now() buggy? If !mapping_cap_writeback_dirty() we
should still write the inode itself?
diff -puN fs/fs-writeback.c~write_inode_now-write-inode-if-not-bdi_cap_no_writeback fs/fs-writeback.c
--- devel/fs/fs-writeback.c~write_inode_now-write-inode-if-not-bdi_cap_no_writeback 2005-10-11 21:13:25.000000000 -0700
+++ devel-akpm/fs/fs-writeback.c 2005-10-11 21:13:40.000000000 -0700
@@ -558,7 +558,7 @@ int write_inode_now(struct inode *inode,
};
if (!mapping_cap_writeback_dirty(inode->i_mapping))
- return 0;
+ wbc.nr_to_write = 0;
might_sleep();
spin_lock(&inode_lock);
_
next prev parent reply other threads:[~2005-10-12 4:16 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-09-14 20:39 [PATCH 2/2][FAT] miss-sync issues on sync mount (miss-sync on utime) Machida, Hiroyuki
2005-09-15 13:15 ` OGAWA Hirofumi
2005-09-15 13:58 ` Machida, Hiroyuki
2005-09-29 17:35 ` [PATCH 1/2] miss-sync changes on attributes (Re: [PATCH 2/2][FAT] miss-sync issues on sync mount (miss-sync on utime)) Machida, Hiroyuki
2005-09-29 17:49 ` [PATCH 2/2] replace ext2_sync_inode() with sync_inode_wodata( " Machida, Hiroyuki
2005-09-29 19:20 ` [PATCH 1/2] miss-sync changes on attributes " Machida, Hiroyuki
2005-10-11 21:26 ` Andrew Morton
2005-10-12 4:02 ` OGAWA Hirofumi
2005-10-12 4:16 ` Andrew Morton [this message]
2005-10-12 4:58 ` OGAWA Hirofumi
2005-10-12 5:47 ` OGAWA Hirofumi
2005-10-12 5:54 ` Machida, Hiroyuki
2005-10-12 6:10 ` Andrew Morton
2005-10-12 9:04 ` Machida, Hiroyuki
2005-10-12 6:21 ` OGAWA Hirofumi
2005-10-12 9:15 ` Machida, Hiroyuki
2005-10-14 13:01 ` [PATCH] generic_osync_inode() with OSYNC_INODE only passed (Re: [PATCH 1/2] miss-sync changes on attributes) Machida, Hiroyuki
2005-10-14 13:02 ` Machida, Hiroyuki
2005-10-29 8:42 ` [PATCH] Fix !mapping_cap_writeback_dirty(inode->i_mapping) OGAWA Hirofumi
2005-10-29 8:58 ` [PATCH] Don't use pdflush for filesystems has BDI_CAP_NO_WRITEBACK OGAWA Hirofumi
2005-10-30 17:15 ` OGAWA Hirofumi
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=20051011211601.72a0f91c.akpm@osdl.org \
--to=akpm@osdl.org \
--cc=dhowells@redhat.com \
--cc=hirofumi@mail.parknet.co.jp \
--cc=linux-kernel@vger.kernel.org \
--cc=machida@sm.sony.co.jp \
/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