]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blame - releases/2.6.32.12/xfs-remove-invalid-barrier-optimization-from-xfs_fsync.patch
Fixes for 4.19
[thirdparty/kernel/stable-queue.git] / releases / 2.6.32.12 / xfs-remove-invalid-barrier-optimization-from-xfs_fsync.patch
CommitLineData
cc67517a
GKH
1From david@fromorbit.com Fri Apr 2 11:12:06 2010
2From: Christoph Hellwig <hch@lst.de>
3Date: Fri, 12 Mar 2010 09:42:15 +1100
4Subject: xfs: remove invalid barrier optimization from xfs_fsync
5To: stable@kernel.org
6Cc: xfs@oss.sgi.com
7Message-ID: <1268347337-7160-18-git-send-email-david@fromorbit.com>
8
9
10From: Christoph Hellwig <hch@lst.de>
11
12commit e8b217e7530c6a073ac69f1c85b922d93fdf5647 upstream
13
14Date: Tue, 2 Feb 2010 10:16:26 +1100
15We always need to flush the disk write cache and can't skip it just because
16the no inode attributes have changed.
17
18Signed-off-by: Christoph Hellwig <hch@lst.de>
19Reviewed-by: Dave Chinner <david@fromorbit.com>
20Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
21---
22 fs/xfs/xfs_vnodeops.c | 12 ++----------
23 1 file changed, 2 insertions(+), 10 deletions(-)
24
25--- a/fs/xfs/xfs_vnodeops.c
26+++ b/fs/xfs/xfs_vnodeops.c
27@@ -597,7 +597,7 @@ xfs_fsync(
28 {
29 xfs_trans_t *tp;
30 int error = 0;
31- int log_flushed = 0, changed = 1;
32+ int log_flushed = 0;
33
34 xfs_itrace_entry(ip);
35
36@@ -627,19 +627,11 @@ xfs_fsync(
37 * disk yet, the inode will be still be pinned. If it is,
38 * force the log.
39 */
40-
41 xfs_iunlock(ip, XFS_ILOCK_SHARED);
42-
43 if (xfs_ipincount(ip)) {
44 error = _xfs_log_force(ip->i_mount, (xfs_lsn_t)0,
45 XFS_LOG_FORCE | XFS_LOG_SYNC,
46 &log_flushed);
47- } else {
48- /*
49- * If the inode is not pinned and nothing has changed
50- * we don't need to flush the cache.
51- */
52- changed = 0;
53 }
54 } else {
55 /*
56@@ -674,7 +666,7 @@ xfs_fsync(
57 xfs_iunlock(ip, XFS_ILOCK_EXCL);
58 }
59
60- if ((ip->i_mount->m_flags & XFS_MOUNT_BARRIER) && changed) {
61+ if (ip->i_mount->m_flags & XFS_MOUNT_BARRIER) {
62 /*
63 * If the log write didn't issue an ordered tag we need
64 * to flush the disk cache for the data device now.