* Subject: [PATCH] Restore 'fsync' functionality on block devices.
@ 2011-08-05 3:34 NeilBrown
2011-08-05 3:48 ` Al Viro
0 siblings, 1 reply; 4+ messages in thread
From: NeilBrown @ 2011-08-05 3:34 UTC (permalink / raw)
To: Al Viro; +Cc: Josef Bacik, Jan Kara, LKML
Commit 02c24a82187d5a628c68edfe71ae60dc135cd178:
fs: push i_mutex and filemap_write_and_wait down into ->fsync() handlers
broke fsync on block devices as it did not push the
"filemap_write_and_wait" call down into blkdev_fsync.
(it didn't push it down into ps3flash_flush either, but maybe there is
a reason for that).
So call filemap_write_and_wait from blkdev_fsync following the pattern
that was originally in vfs_fsync_range.
Signed-off-by: NeilBrown <neilb@suse.de>
Cc: Jan Kara <jack@suse.cz>
Cc: Josef Bacik <josef@redhat.com>
Cc: Al Viro <viro@zeniv.linux.org.uk>
diff --git a/fs/block_dev.c b/fs/block_dev.c
index f286805..532fefe 100644
--- a/fs/block_dev.c
+++ b/fs/block_dev.c
@@ -386,8 +386,10 @@ int blkdev_fsync(struct file *filp, loff_t start, loff_t
end, int datasync) {
struct inode *bd_inode = filp->f_mapping->host;
struct block_device *bdev = I_BDEV(bd_inode);
- int error;
+ int error, ret;
+
+ ret = filemap_write_and_wait_range(filp->f_mapping, start, end);
/*
* There is no need to serialise calls to blkdev_issue_flush with
* i_mutex and doing so causes performance issues with concurrent
@@ -396,6 +398,8 @@ int blkdev_fsync(struct file *filp, loff_t start, loff_t
end, int datasync) error = blkdev_issue_flush(bdev, GFP_KERNEL, NULL);
if (error == -EOPNOTSUPP)
error = 0;
+ if (ret)
+ return ret;
return error;
}
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: Subject: [PATCH] Restore 'fsync' functionality on block devices.
2011-08-05 3:34 Subject: [PATCH] Restore 'fsync' functionality on block devices NeilBrown
@ 2011-08-05 3:48 ` Al Viro
2011-08-05 4:35 ` NeilBrown
0 siblings, 1 reply; 4+ messages in thread
From: Al Viro @ 2011-08-05 3:48 UTC (permalink / raw)
To: NeilBrown; +Cc: Josef Bacik, Jan Kara, LKML
On Fri, Aug 05, 2011 at 01:34:56PM +1000, NeilBrown wrote:
>
> Commit 02c24a82187d5a628c68edfe71ae60dc135cd178:
see da5aa861bea09197e6ae4d7c46618616064891e4 in mainline
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Subject: [PATCH] Restore 'fsync' functionality on block devices.
2011-08-05 3:48 ` Al Viro
@ 2011-08-05 4:35 ` NeilBrown
2011-08-05 4:49 ` Al Viro
0 siblings, 1 reply; 4+ messages in thread
From: NeilBrown @ 2011-08-05 4:35 UTC (permalink / raw)
To: Al Viro; +Cc: Josef Bacik, Jan Kara, LKML
On Fri, 5 Aug 2011 04:48:59 +0100 Al Viro <viro@ZenIV.linux.org.uk> wrote:
> On Fri, Aug 05, 2011 at 01:34:56PM +1000, NeilBrown wrote:
> >
> > Commit 02c24a82187d5a628c68edfe71ae60dc135cd178:
>
> see da5aa861bea09197e6ae4d7c46618616064891e4 in mainline
http://git.kernel.org/?p=linux/kernel/git/torvalds/linux.git;a=commitdiff;h=da5aa861bea09197e6ae4d7c46618616064891e4
gives me
404 - Unknown commit object
(as does a 'git show').
But I'll take your word for it that it is on it's way.
Thanks,
NeilBrown
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Subject: [PATCH] Restore 'fsync' functionality on block devices.
2011-08-05 4:35 ` NeilBrown
@ 2011-08-05 4:49 ` Al Viro
0 siblings, 0 replies; 4+ messages in thread
From: Al Viro @ 2011-08-05 4:49 UTC (permalink / raw)
To: NeilBrown; +Cc: Josef Bacik, Jan Kara, LKML
On Fri, Aug 05, 2011 at 02:35:09PM +1000, NeilBrown wrote:
> http://git.kernel.org/?p=linux/kernel/git/torvalds/linux.git;a=commitdiff;h=da5aa861bea09197e6ae4d7c46618616064891e4
>
> gives me
>
> 404 - Unknown commit object
>
> (as does a 'git show').
>
> But I'll take your word for it that it is on it's way.
Charming... the diff between what's on hera and what's on git.kernel.org
is not small -
arch/arm/kernel/process.c | 2 +-
arch/ia64/kernel/efi.c | 2 +-
arch/sh/kernel/idle.c | 2 +-
drivers/dma/dmaengine.c | 4 +-
drivers/dma/ioat/dma_v3.c | 8 ++--
drivers/dma/ioat/pci.c | 11 +++++
fs/block_dev.c | 4 ++
fs/namei.c | 17 +++-----
include/linux/pci_ids.h | 10 +++++
include/linux/posix_acl.h | 74 +++++++++++++-----------------------
kernel/futex.c | 54 ++++++++++++++++++++------
kernel/lockdep.c | 37 +++++++++---------
mm/slab.c | 92 ++++++++++++++++++++++++++++++++++----------
13 files changed, 196 insertions(+), 121 deletions(-)
and the latest is actually commit 24f0eed2668b059e847ff145848ddacb75419acc
Merge: 8b6b462 3567866
Author: Linus Torvalds <torvalds@linux-foundation.org>
Date: Thu Aug 4 16:44:40 2011 -1000
(with several more merges between git.kernel.org tip and this one)
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2011-08-05 4:49 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-08-05 3:34 Subject: [PATCH] Restore 'fsync' functionality on block devices NeilBrown
2011-08-05 3:48 ` Al Viro
2011-08-05 4:35 ` NeilBrown
2011-08-05 4:49 ` Al Viro
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.