Drop patch that was NAKed upstream (rhbz 783211)

This commit is contained in:
Josh Boyer 2012-02-03 14:07:56 -05:00
parent 46521a321b
commit 914bd7b36a
2 changed files with 4 additions and 113 deletions

View File

@ -1,106 +0,0 @@
Path: news.gmane.org!not-for-mail
From: Niels de Vos <ndevos@redhat.com>
Newsgroups: gmane.linux.kernel,gmane.linux.file-systems
Subject: [PATCH v2] fs: Invalidate the cache for a parent block-device if fsync() is called for a partition
Date: Mon, 23 Jan 2012 10:38:29 +0000
Lines: 58
Approved: news@gmane.org
Message-ID: <1327315109-7740-1-git-send-email-ndevos@redhat.com>
References: <4F19356E.3020708@redhat.com>
NNTP-Posting-Host: lo.gmane.org
X-Trace: dough.gmane.org 1327315263 30652 80.91.229.12 (23 Jan 2012 10:41:03 GMT)
X-Complaints-To: usenet@dough.gmane.org
NNTP-Posting-Date: Mon, 23 Jan 2012 10:41:03 +0000 (UTC)
Cc: linux-kernel@vger.kernel.org, Niels de Vos <ndevos@redhat.com>,
"Bryn M. Reeves" <bmr@redhat.com>,
Mikulas Patocka <mpatocka@redhat.com>
To: linux-fsdevel@vger.kernel.org
Original-X-From: linux-kernel-owner@vger.kernel.org Mon Jan 23 11:40:58 2012
Return-path: <linux-kernel-owner@vger.kernel.org>
Envelope-to: glk-linux-kernel-3@lo.gmane.org
Original-Received: from vger.kernel.org ([209.132.180.67])
by lo.gmane.org with esmtp (Exim 4.69)
(envelope-from <linux-kernel-owner@vger.kernel.org>)
id 1RpHKb-0008Bu-Fh
for glk-linux-kernel-3@lo.gmane.org; Mon, 23 Jan 2012 11:40:57 +0100
Original-Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand
id S1753263Ab2AWKkt (ORCPT <rfc822;glk-linux-kernel-3@m.gmane.org>);
Mon, 23 Jan 2012 05:40:49 -0500
Original-Received: from mx1.redhat.com ([209.132.183.28]:58739 "EHLO mx1.redhat.com"
rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP
id S1751990Ab2AWKks (ORCPT <rfc822;linux-kernel@vger.kernel.org>);
Mon, 23 Jan 2012 05:40:48 -0500
Original-Received: from int-mx12.intmail.prod.int.phx2.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.25])
by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q0NAelMx027033
(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
Mon, 23 Jan 2012 05:40:47 -0500
Original-Received: from ndevos.usersys.redhat.com (dhcp-1-51.fab.redhat.com [10.33.1.51])
by int-mx12.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id q0NAejLn013691;
Mon, 23 Jan 2012 05:40:46 -0500
In-Reply-To: <4F19356E.3020708@redhat.com>
X-Scanned-By: MIMEDefang 2.68 on 10.5.11.25
Original-Sender: linux-kernel-owner@vger.kernel.org
Precedence: bulk
List-ID: <linux-kernel.vger.kernel.org>
X-Mailing-List: linux-kernel@vger.kernel.org
Xref: news.gmane.org gmane.linux.kernel:1242432 gmane.linux.file-systems:60751
Archived-At: <http://permalink.gmane.org/gmane.linux.kernel/1242432>
Executing an fsync() on a file-descriptor of a partition flushes the
caches for that partition by calling blkdev_issue_flush(). However, it
seems that reading data through the parent device will still return the
old cached data.
The cache for the block-device is not synced if the block-device is kept
open (due to a mounted partition, for example). Only when all users for
the disk have exited, the cache for the disk is made consistent again.
Calling invalidate_bdev() on the parent block-device in case
blkdev_fsync() was called for a partition, fixes this.
The problem can be worked around by forcing the caches to be flushed
with either
# blockdev --flushbufs ${dev_disk}
or
# echo 3 > /proc/sys/vm/drop_caches
CC: Bryn M. Reeves <bmr@redhat.com>
CC: Mikulas Patocka <mpatocka@redhat.com>
Signed-off-by: Niels de Vos <ndevos@redhat.com>
---
v2:
- Do not call invalidate_bdev() from blkdev_issue_flush() and prevent
performance degration with journalled filesystems.
Suggested was to call invalidate_bdev() in fsync_bdev(), but this is
not in the call-path of mkfs.ext3 and similar tools. Hence the issue
persists.
- Correct phrasing a little, changing ioctl-BLKFLSBUF is not required.
- This issue also occurs when doing an ioctl-BLKFLSBUF on a partition.
Reading the whole disk will still return cached data. If this is an
issue, it will need a seperate patch.
---
fs/block_dev.c | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/fs/block_dev.c b/fs/block_dev.c
index 0e575d1..433c4de 100644
--- a/fs/block_dev.c
+++ b/fs/block_dev.c
@@ -424,6 +424,10 @@ int blkdev_fsync(struct file *filp, loff_t start, loff_t end, int datasync)
if (error == -EOPNOTSUPP)
error = 0;
+ /* invalidate parent block_device */
+ if (!error && bdev != bdev->bd_contains)
+ invalidate_bdev(bdev->bd_contains);
+
return error;
}
EXPORT_SYMBOL(blkdev_fsync);
--
1.7.6.5

View File

@ -54,7 +54,7 @@ Summary: The Linux kernel
# For non-released -rc kernels, this will be appended after the rcX and
# gitX tags, so a 3 here would become part of release "0.rcX.gitX.3"
#
%global baserelease 1
%global baserelease 2
%global fedora_build %{baserelease}
# base_sublevel is the kernel version we're starting with and patching
@ -737,9 +737,6 @@ Patch21070: ext4-Support-check-none-nocheck-mount-options.patch
Patch21073: KVM-x86-extend-struct-x86_emulate_ops-with-get_cpuid.patch
Patch21074: KVM-x86-fix-missing-checks-in-syscall-emulation.patch
#rhbz 783211
Patch21087: fs-Inval-cache-for-parent-block-device-if-fsync-called-on-part.patch
Patch21091: kmemleak.patch
Patch21092: udlfb-remove-sysfs-framebuffer-device-with-USB-disconnect.patch
@ -1439,9 +1436,6 @@ ApplyPatch kmemleak.patch
ApplyPatch udlfb-remove-sysfs-framebuffer-device-with-USB-disconnect.patch
#rhbz 783211
ApplyPatch fs-Inval-cache-for-parent-block-device-if-fsync-called-on-part.patch
#rhbz 772772
ApplyPatch rt2x00_fix_MCU_request_failures.patch
@ -2292,6 +2286,9 @@ fi
# ||----w |
# || ||
%changelog
* Fri Feb 03 2012 Josh Boyer <jwboyer@redhat.com> - 3.3.0-0.rc2.git3.2
- Drop patch that was NAKed upstream (rhbz 783211)
* Fri Feb 03 2012 Josh Boyer <jwboyer@redhat.com> - 3.3.0-0.rc2.git3.1
- Linux 3.3-rc2-git3 (upstream 7f06db34e55af8fc33cf3d6d46d869cb7a372b5d)
- Patch from Jakub Kicinski to fix rt2x00 MCU requests (rhbz 772772)