* linux-next: manual merge of the logfs tree with Linus' tree
@ 2011-11-01 3:10 Stephen Rothwell
2011-11-02 19:00 ` Jörn Engel
0 siblings, 1 reply; 4+ messages in thread
From: Stephen Rothwell @ 2011-11-01 3:10 UTC (permalink / raw)
To: Prasad Joshi, "Jörn Engel"
Cc: linux-next, linux-kernel, Josef Bacik, Al Viro
[-- Attachment #1: Type: text/plain, Size: 1268 bytes --]
Hi all,
Today's linux-next merge of the logfs tree got a conflict in
fs/logfs/file.c between commit 02c24a82187d ("fs: push i_mutex and
filemap_write_and_wait down into ->fsync() handlers") from Linus' tree
and commit 39da12ef4bbe ("logfs: take write mutex lock during fsync and
sync") from the logfs tree.
I have no idea what needs to be done here. I fixed it like below to make
it build, but a better fix is needed.
--
Cheers,
Stephen Rothwell sfr@canb.auug.org.au
diff --cc fs/logfs/file.c
index b548c87,f85d603..0000000
--- a/fs/logfs/file.c
+++ b/fs/logfs/file.c
@@@ -219,20 -219,13 +219,22 @@@ long logfs_ioctl(struct file *file, uns
}
}
-int logfs_fsync(struct file *file, int datasync)
+int logfs_fsync(struct file *file, loff_t start, loff_t end, int datasync)
{
struct super_block *sb = file->f_mapping->host->i_sb;
+ struct inode *inode = file->f_mapping->host;
+ int ret;
+
+ ret = filemap_write_and_wait_range(inode->i_mapping, start, end);
+ if (ret)
+ return ret;
+ mutex_lock(&inode->i_mutex);
+ logfs_get_wblocks(sb, NULL, WF_LOCK);
logfs_write_anchor(sb);
+ logfs_put_wblocks(sb, NULL, WF_LOCK);
+ mutex_unlock(&inode->i_mutex);
+
return 0;
}
[-- Attachment #2: Type: application/pgp-signature, Size: 836 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: linux-next: manual merge of the logfs tree with Linus' tree
2011-11-01 3:10 linux-next: manual merge of the logfs tree with Linus' tree Stephen Rothwell
@ 2011-11-02 19:00 ` Jörn Engel
2011-11-03 1:02 ` Stephen Rothwell
0 siblings, 1 reply; 4+ messages in thread
From: Jörn Engel @ 2011-11-02 19:00 UTC (permalink / raw)
To: Stephen Rothwell
Cc: Prasad Joshi, linux-next, linux-kernel, Josef Bacik, Al Viro
On Tue, 1 November 2011 14:10:00 +1100, Stephen Rothwell wrote:
>
> Hi all,
>
> Today's linux-next merge of the logfs tree got a conflict in
> fs/logfs/file.c between commit 02c24a82187d ("fs: push i_mutex and
> filemap_write_and_wait down into ->fsync() handlers") from Linus' tree
> and commit 39da12ef4bbe ("logfs: take write mutex lock during fsync and
> sync") from the logfs tree.
>
> I have no idea what needs to be done here. I fixed it like below to make
> it build, but a better fix is needed.
From a code perspective your fix below is correct, to the best of my
judgement. I'm less sure what to do from a git perspective.
Explicitly tell Linus about it in the logfs pull request?
> diff --cc fs/logfs/file.c
> index b548c87,f85d603..0000000
> --- a/fs/logfs/file.c
> +++ b/fs/logfs/file.c
> @@@ -219,20 -219,13 +219,22 @@@ long logfs_ioctl(struct file *file, uns
> }
> }
>
> -int logfs_fsync(struct file *file, int datasync)
> +int logfs_fsync(struct file *file, loff_t start, loff_t end, int datasync)
> {
> struct super_block *sb = file->f_mapping->host->i_sb;
> + struct inode *inode = file->f_mapping->host;
> + int ret;
> +
> + ret = filemap_write_and_wait_range(inode->i_mapping, start, end);
> + if (ret)
> + return ret;
>
> + mutex_lock(&inode->i_mutex);
> + logfs_get_wblocks(sb, NULL, WF_LOCK);
> logfs_write_anchor(sb);
> + logfs_put_wblocks(sb, NULL, WF_LOCK);
> + mutex_unlock(&inode->i_mutex);
> +
> return 0;
> }
>
Jörn
--
You can take my soul, but not my lack of enthusiasm.
-- Wally
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: linux-next: manual merge of the logfs tree with Linus' tree
2011-11-02 19:00 ` Jörn Engel
@ 2011-11-03 1:02 ` Stephen Rothwell
2011-11-03 1:25 ` Jörn Engel
0 siblings, 1 reply; 4+ messages in thread
From: Stephen Rothwell @ 2011-11-03 1:02 UTC (permalink / raw)
To: Jörn Engel
Cc: Prasad Joshi, linux-next, linux-kernel, Josef Bacik, Al Viro
[-- Attachment #1: Type: text/plain, Size: 1028 bytes --]
Hi Jörn,
On Wed, 2 Nov 2011 20:00:46 +0100 Jörn Engel <joern@logfs.org> wrote:
>
> On Tue, 1 November 2011 14:10:00 +1100, Stephen Rothwell wrote:
> >
> > Today's linux-next merge of the logfs tree got a conflict in
> > fs/logfs/file.c between commit 02c24a82187d ("fs: push i_mutex and
> > filemap_write_and_wait down into ->fsync() handlers") from Linus' tree
> > and commit 39da12ef4bbe ("logfs: take write mutex lock during fsync and
> > sync") from the logfs tree.
> >
> > I have no idea what needs to be done here. I fixed it like below to make
> > it build, but a better fix is needed.
>
> From a code perspective your fix below is correct, to the best of my
> judgement. I'm less sure what to do from a git perspective.
> Explicitly tell Linus about it in the logfs pull request?
I was concered about the locking order (or if both locks were needed at
all). And, yes, tell Linus.
--
Cheers,
Stephen Rothwell sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/
[-- Attachment #2: Type: application/pgp-signature, Size: 836 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: linux-next: manual merge of the logfs tree with Linus' tree
2011-11-03 1:02 ` Stephen Rothwell
@ 2011-11-03 1:25 ` Jörn Engel
0 siblings, 0 replies; 4+ messages in thread
From: Jörn Engel @ 2011-11-03 1:25 UTC (permalink / raw)
To: Stephen Rothwell
Cc: Prasad Joshi, linux-next, linux-kernel, Josef Bacik, Al Viro
On Thu, 3 November 2011 12:02:57 +1100, Stephen Rothwell wrote:
> On Wed, 2 Nov 2011 20:00:46 +0100 Jörn Engel <joern@logfs.org> wrote:
> > On Tue, 1 November 2011 14:10:00 +1100, Stephen Rothwell wrote:
> > >
> > > Today's linux-next merge of the logfs tree got a conflict in
> > > fs/logfs/file.c between commit 02c24a82187d ("fs: push i_mutex and
> > > filemap_write_and_wait down into ->fsync() handlers") from Linus' tree
> > > and commit 39da12ef4bbe ("logfs: take write mutex lock during fsync and
> > > sync") from the logfs tree.
> > >
> > > I have no idea what needs to be done here. I fixed it like below to make
> > > it build, but a better fix is needed.
> >
> > From a code perspective your fix below is correct, to the best of my
> > judgement. I'm less sure what to do from a git perspective.
> > Explicitly tell Linus about it in the logfs pull request?
>
> I was concered about the locking order (or if both locks were needed at
> all). And, yes, tell Linus.
Locking order should be fine. Whether both locks are needed is a
valid question. I suspect the answer is yes.
Jörn
--
Simplicity is prerequisite for reliability.
-- Edsger W. Dijkstra
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2011-11-03 1:24 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-11-01 3:10 linux-next: manual merge of the logfs tree with Linus' tree Stephen Rothwell
2011-11-02 19:00 ` Jörn Engel
2011-11-03 1:02 ` Stephen Rothwell
2011-11-03 1:25 ` Jörn Engel
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).