From: Jan Kara <jack@suse•cz>
To: Stephen Rothwell <sfr@canb•auug.org.au>
Cc: Al Viro <viro@ZenIV•linux.org.uk>,
linux-next@vger•kernel.org, linux-kernel@vger•kernel.org,
Josef Bacik <josef@redhat•com>,
Lukas Czerner <lczerner@redhat•com>, Jan Kara <jack@suse•cz>
Subject: Re: linux-next: manual merge of the vfs tree with the ext3 tree
Date: Mon, 18 Jul 2011 21:32:48 +0200 [thread overview]
Message-ID: <20110718193248.GE5842@quack.suse.cz> (raw)
In-Reply-To: <20110718133645.7a4a21bb51c690034ecc6d58@canb.auug.org.au>
Hi,
On Mon 18-07-11 13:36:45, Stephen Rothwell wrote:
> Today's linux-next merge of the vfs tree got a conflict in
> fs/ext3/fsync.c between commit 785c4bcc0d88 ("ext3: Add fixed
> tracepoints") from the ext3 tree and commit 62ec115d5b9c ("fs: push
> i_mutex and filemap_write_and_wait down into ->fsync() handlers") from
> the vfs tree.
>
> I fixed it up (see below) but am not sure of the ordering of these two
> separate changes.
Thanks. Logically, I'd expect trace_ext3_sync_file_enter() to be always
called at the beginning of ext3_sync_file(). That means before
filemap_write_and_wait_range()... I guess the easiest way to resolve this
is if Al pulls the tracepoint patch from my tree to his - it's commit
785c4bcc0d88ff006a0b2120815a71e86ecf21ce in
git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs-2.6
Honza
> diff --cc fs/ext3/fsync.c
> index 06a4394,0bcf63a..0000000
> --- a/fs/ext3/fsync.c
> +++ b/fs/ext3/fsync.c
> @@@ -52,14 -51,22 +52,24 @@@ int ext3_sync_file(struct file *file, l
> int ret, needs_barrier = 0;
> tid_t commit_tid;
>
> - if (inode->i_sb->s_flags & MS_RDONLY)
> - return 0;
> -
> + ret = filemap_write_and_wait_range(inode->i_mapping, start, end);
> + if (ret)
> + return ret;
> +
> + /*
> + * Taking the mutex here just to keep consistent with how fsync was
> + * called previously, however it looks like we don't need to take
> + * i_mutex at all.
> + */
> + mutex_lock(&inode->i_mutex);
> +
> J_ASSERT(ext3_journal_current_handle() == NULL);
>
> + trace_ext3_sync_file_enter(file, datasync);
> +
> + if (inode->i_sb->s_flags & MS_RDONLY)
> + return 0;
> +
> -
> /*
> * data=writeback,ordered:
> * The caller's filemap_fdatawrite()/wait will sync the data.
> @@@ -75,8 -82,8 +85,9 @@@
> * safe in-journal, which is all fsync() needs to ensure.
> */
> if (ext3_should_journal_data(inode)) {
> + mutex_unlock(&inode->i_mutex);
> - return ext3_force_commit(inode->i_sb);
> + ret = ext3_force_commit(inode->i_sb);
> + goto out;
> }
>
> if (datasync)
> @@@ -97,8 -104,6 +108,9 @@@
> */
> if (needs_barrier)
> blkdev_issue_flush(inode->i_sb->s_bdev, GFP_KERNEL, NULL);
> + mutex_unlock(&inode->i_mutex);
> +
> +out:
> + trace_ext3_sync_file_exit(inode, ret);
> return ret;
> }
--
Jan Kara <jack@suse•cz>
SUSE Labs, CR
next prev parent reply other threads:[~2011-07-18 19:32 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-07-18 3:36 linux-next: manual merge of the vfs tree with the ext3 tree Stephen Rothwell
2011-07-18 19:32 ` Jan Kara [this message]
-- strict thread matches above, loose matches on Subject: below --
2022-10-03 22:56 Stephen Rothwell
2022-09-26 13:01 broonie
2019-01-02 1:09 Stephen Rothwell
2018-11-27 23:10 Stephen Rothwell
2018-06-01 1:56 Stephen Rothwell
2018-06-01 15:32 ` Jan Kara
2018-06-11 23:53 ` Stephen Rothwell
2017-11-08 22:55 Stephen Rothwell
2015-03-18 0:32 Stephen Rothwell
2012-01-05 2:06 Stephen Rothwell
2010-05-28 1:31 Stephen Rothwell
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=20110718193248.GE5842@quack.suse.cz \
--to=jack@suse$(echo .)cz \
--cc=josef@redhat$(echo .)com \
--cc=lczerner@redhat$(echo .)com \
--cc=linux-kernel@vger$(echo .)kernel.org \
--cc=linux-next@vger$(echo .)kernel.org \
--cc=sfr@canb$(echo .)auug.org.au \
--cc=viro@ZenIV$(echo .)linux.org.uk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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