rpms/kernel/F-7 linux-2.6-dio-fix-cache-invalidation-after-sync-writes.patch, NONE, 1.1 linux-2.6-mm-fix-ptrace-access-beyond-vma.patch, NONE, 1.1 kernel-2.6.spec, 1.3370, 1.3371 linux-2.6-iwlwifi-fixes.patch, 1.1, 1.2
Chuck Ebbert (cebbert)
fedora-extras-commits at redhat.com
Wed Oct 31 23:59:02 UTC 2007
Author: cebbert
Update of /cvs/pkgs/rpms/kernel/F-7
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv13266
Modified Files:
kernel-2.6.spec linux-2.6-iwlwifi-fixes.patch
Added Files:
linux-2.6-dio-fix-cache-invalidation-after-sync-writes.patch
linux-2.6-mm-fix-ptrace-access-beyond-vma.patch
Log Message:
* Wed Oct 31 2007 Chuck Ebbert <cebbert at redhat.com>
- Copy iwl wireless updates from Fedora 8 (#349981).
- Fix read after direct IO write returning stale data.
- Fix hang in ptrace trying to access beyond end of VMA.
- Add Powerbook HID input driver to x86_64 build (#358721).
linux-2.6-dio-fix-cache-invalidation-after-sync-writes.patch:
--- NEW FILE linux-2.6-dio-fix-cache-invalidation-after-sync-writes.patch ---
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=bdb76ef5a4bc8676a81034a443f1eda450b4babb
Commit: bdb76ef5a4bc8676a81034a443f1eda450b4babb
Parent: e58b7dab272ecee09cd7bafb89d6b224cd17bbe3
Author: Zach Brown <zach.brown at oracle.com>
AuthorDate: Tue Oct 30 11:45:46 2007 -0700
Committer: Linus Torvalds <torvalds at woody.linux-foundation.org>
CommitDate: Tue Oct 30 12:14:06 2007 -0700
dio: fix cache invalidation after sync writes
Commit commit 65b8291c4000e5f38fc94fb2ca0cb7e8683c8a1b ("dio: invalidate
clean pages before dio write") introduced a bug which stopped dio from
ever invalidating the page cache after writes. It still invalidated it
before writes so most users were fine.
Karl Schendel reported ( http://lkml.org/lkml/2007/10/26/481 ) hitting
this bug when he had a buffered reader immediately reading file data
after an O_DIRECT wirter had written the data. The kernel issued
read-ahead beyond the position of the reader which overlapped with the
O_DIRECT writer. The failure to invalidate after writes caused the
reader to see stale data from the read-ahead.
The following patch is originally from Karl. The following commentary
is his:
The below 3rd try takes on your suggestion of just invalidating
no matter what the retval from the direct_IO call. I ran it
thru the test-case several times and it has worked every time.
The post-invalidate is probably still too early for async-directio,
but I don't have a testcase for that; just sync. And, this
won't be any worse in the async case.
I added a test to the aio-dio-regress repository which mimics Karl's IO
pattern. It verifed the bad behaviour and that the patch fixed it. I
agree with Karl, this still doesn't help the case where a buffered
reader follows an AIO O_DIRECT writer. That will require a bit more
work.
This gives up on the idea of returning EIO to indicate to userspace that
stale data remains if the invalidation failed.
Signed-off-by: Zach Brown <zach.brown at oracle.com>
Cc: Karl Schendel <kschendel at datallegro.com>
Cc: Benjamin LaHaise <bcrl at kvack.org>
Cc: Andrew Morton <akpm at linux-foundation.org>
Cc: Nick Piggin <nickpiggin at yahoo.com.au>
Cc: Leonid Ananiev <leonid.i.ananiev at linux.intel.com>
Cc: Chris Mason <chris.mason at oracle.com>
Signed-off-by: Linus Torvalds <torvalds at linux-foundation.org>
---
mm/filemap.c | 16 ++++++----------
1 files changed, 6 insertions(+), 10 deletions(-)
diff --git a/mm/filemap.c b/mm/filemap.c
index 7c86436..9940895 100644
--- a/mm/filemap.c
+++ b/mm/filemap.c
@@ -2511,21 +2511,17 @@ generic_file_direct_IO(int rw, struct kiocb *iocb, const struct iovec *iov,
}
retval = mapping->a_ops->direct_IO(rw, iocb, iov, offset, nr_segs);
- if (retval)
- goto out;
/*
* Finally, try again to invalidate clean pages which might have been
- * faulted in by get_user_pages() if the source of the write was an
- * mmap()ed region of the file we're writing. That's a pretty crazy
- * thing to do, so we don't support it 100%. If this invalidation
- * fails and we have -EIOCBQUEUED we ignore the failure.
+ * cached by non-direct readahead, or faulted in by get_user_pages()
+ * if the source of the write was an mmap'ed region of the file
+ * we're writing. Either one is a pretty crazy thing to do,
+ * so we don't support it 100%. If this invalidation
+ * fails, tough, the write still worked...
*/
if (rw == WRITE && mapping->nrpages) {
- int err = invalidate_inode_pages2_range(mapping,
- offset >> PAGE_CACHE_SHIFT, end);
- if (err && retval >= 0)
- retval = err;
+ invalidate_inode_pages2_range(mapping, offset >> PAGE_CACHE_SHIFT, end);
}
out:
return retval;
linux-2.6-mm-fix-ptrace-access-beyond-vma.patch:
--- NEW FILE linux-2.6-mm-fix-ptrace-access-beyond-vma.patch ---
Duane Griffin noticed a 2.6.23 regression that will cause gdb to hang when
it tries to access the memory of another process beyond i_size.
This is because the solution to the fault vs invalidate race requires that
we recheck i_size after the page lock is taken. However in that case, I
had not accounted for the fact that ptracers are granted an exception to this
rule.
Cc: Duane Griffin <duaneg at dghda.com>
Cc: stable at kernel.org
Signed-off-by: Nick Piggin <npiggin at suse.de
---
Index: linux-2.6/mm/filemap.c
===================================================================
--- linux-2.6.orig/mm/filemap.c
+++ linux-2.6/mm/filemap.c
@@ -1374,7 +1374,7 @@ retry_find:
/* Must recheck i_size under page lock */
size = (i_size_read(inode) + PAGE_CACHE_SIZE - 1) >> PAGE_CACHE_SHIFT;
- if (unlikely(vmf->pgoff >= size)) {
+ if (unlikely(vmf->pgoff >= size) && vma->vm_mm == current->mm) {
unlock_page(page);
page_cache_release(page);
goto outside_data_content;
Index: kernel-2.6.spec
===================================================================
RCS file: /cvs/pkgs/rpms/kernel/F-7/kernel-2.6.spec,v
retrieving revision 1.3370
retrieving revision 1.3371
diff -u -r1.3370 -r1.3371
--- kernel-2.6.spec 31 Oct 2007 00:56:02 -0000 1.3370
+++ kernel-2.6.spec 31 Oct 2007 23:58:27 -0000 1.3371
@@ -579,6 +579,8 @@
Patch600: linux-2.6-vm-silence-atomic-alloc-failures.patch
Patch601: linux-2.6-input-ff-create-limit-memory.patch
+Patch602: linux-2.6-mm-fix-ptrace-access-beyond-vma.patch
+Patch603: linux-2.6-dio-fix-cache-invalidation-after-sync-writes.patch
Patch610: linux-2.6-defaults-fat-utf8.patch
Patch620: linux-2.6-defaults-unicode-vt.patch
@@ -1240,6 +1242,10 @@
ApplyPatch linux-2.6-vm-silence-atomic-alloc-failures.patch
# don't let input FF drivers allocate too much memory
ApplyPatch linux-2.6-input-ff-create-limit-memory.patch
+# fix ptrace access beyond vma
+ApplyPatch linux-2.6-mm-fix-ptrace-access-beyond-vma.patch
+# fix invalid data read after direct IO write
+ApplyPatch linux-2.6-dio-fix-cache-invalidation-after-sync-writes.patch
# Changes to upstream defaults.
# Use UTF-8 by default on VFAT.
@@ -2261,6 +2267,12 @@
%endif
%changelog
+* Wed Oct 31 2007 Chuck Ebbert <cebbert at redhat.com>
+- Copy iwl wireless updates from Fedora 8 (#349981).
+- Fix read after direct IO write returning stale data.
+- Fix hang in ptrace trying to access beyond end of VMA.
+- Add Powerbook HID input driver to x86_64 build (#358721).
+
* Tue Oct 30 2007 Chuck Ebbert <cebbert at redhat.com>
- Use upstream fixes for monotonic stime/utime.
- Another ACPI suspend/resume fix.
linux-2.6-iwlwifi-fixes.patch:
Index: linux-2.6-iwlwifi-fixes.patch
===================================================================
RCS file: /cvs/pkgs/rpms/kernel/F-7/linux-2.6-iwlwifi-fixes.patch,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- linux-2.6-iwlwifi-fixes.patch 28 Sep 2007 00:14:45 -0000 1.1
+++ linux-2.6-iwlwifi-fixes.patch 31 Oct 2007 23:58:27 -0000 1.2
@@ -1,6 +1,6 @@
diff -up linux-2.6.22.noarch/drivers/net/wireless/iwlwifi/iwl-4965-rs.c.orig linux-2.6.22.noarch/drivers/net/wireless/iwlwifi/iwl-4965-rs.c
---- linux-2.6.22.noarch/drivers/net/wireless/iwlwifi/iwl-4965-rs.c.orig 2007-09-27 19:59:56.000000000 -0400
-+++ linux-2.6.22.noarch/drivers/net/wireless/iwlwifi/iwl-4965-rs.c 2007-09-27 20:06:43.000000000 -0400
+--- linux-2.6.22.noarch/drivers/net/wireless/iwlwifi/iwl-4965-rs.c.orig 2007-09-27 19:08:16.000000000 -0400
++++ linux-2.6.22.noarch/drivers/net/wireless/iwlwifi/iwl-4965-rs.c 2007-09-27 19:09:01.000000000 -0400
@@ -115,24 +115,38 @@ struct iwl_rate_scale_priv {
u8 is_dup;
u8 phymode;
@@ -456,8 +456,8 @@
int iwl_fill_rs_info(struct ieee80211_hw *hw, char *buf, u8 sta_id)
diff -up linux-2.6.22.noarch/drivers/net/wireless/iwlwifi/iwl4965-base.c.orig linux-2.6.22.noarch/drivers/net/wireless/iwlwifi/iwl4965-base.c
---- linux-2.6.22.noarch/drivers/net/wireless/iwlwifi/iwl4965-base.c.orig 2007-09-27 19:59:56.000000000 -0400
-+++ linux-2.6.22.noarch/drivers/net/wireless/iwlwifi/iwl4965-base.c 2007-09-27 20:06:43.000000000 -0400
+--- linux-2.6.22.noarch/drivers/net/wireless/iwlwifi/iwl4965-base.c.orig 2007-09-27 19:08:16.000000000 -0400
++++ linux-2.6.22.noarch/drivers/net/wireless/iwlwifi/iwl4965-base.c 2007-09-27 19:09:01.000000000 -0400
@@ -102,7 +102,7 @@ int iwl_param_queues_num = IWL_MAX_NUM_Q
#define VS
#endif
@@ -574,8 +574,8 @@
/* FIXME - we need to add code here to detect a totally new
* configuration, reset the AP, unassoc, rxon timing, assoc,
diff -up linux-2.6.22.noarch/drivers/net/wireless/iwlwifi/iwl-4965.c.orig linux-2.6.22.noarch/drivers/net/wireless/iwlwifi/iwl-4965.c
---- linux-2.6.22.noarch/drivers/net/wireless/iwlwifi/iwl-4965.c.orig 2007-09-27 19:59:56.000000000 -0400
-+++ linux-2.6.22.noarch/drivers/net/wireless/iwlwifi/iwl-4965.c 2007-09-27 20:06:43.000000000 -0400
+--- linux-2.6.22.noarch/drivers/net/wireless/iwlwifi/iwl-4965.c.orig 2007-09-27 19:08:16.000000000 -0400
++++ linux-2.6.22.noarch/drivers/net/wireless/iwlwifi/iwl-4965.c 2007-09-27 19:10:39.000000000 -0400
@@ -183,7 +183,7 @@ u8 iwl_hw_find_station(struct iwl_priv *
goto out;
}
@@ -586,8 +586,8 @@
out:
diff -up linux-2.6.22.noarch/drivers/net/wireless/iwlwifi/iwl-debug.h.orig linux-2.6.22.noarch/drivers/net/wireless/iwlwifi/iwl-debug.h
---- linux-2.6.22.noarch/drivers/net/wireless/iwlwifi/iwl-debug.h.orig 2007-09-27 19:59:56.000000000 -0400
-+++ linux-2.6.22.noarch/drivers/net/wireless/iwlwifi/iwl-debug.h 2007-09-27 20:06:43.000000000 -0400
+--- linux-2.6.22.noarch/drivers/net/wireless/iwlwifi/iwl-debug.h.orig 2007-09-27 19:08:16.000000000 -0400
++++ linux-2.6.22.noarch/drivers/net/wireless/iwlwifi/iwl-debug.h 2007-09-27 19:09:01.000000000 -0400
@@ -136,8 +136,11 @@ static inline void IWL_DEBUG_LIMIT(int l
#define IWL_DEBUG_TXPOWER(f, a...) IWL_DEBUG(IWL_DL_TXPOWER, f, ## a)
#define IWL_DEBUG_IO(f, a...) IWL_DEBUG(IWL_DL_IO, f, ## a)
@@ -601,8 +601,8 @@
#define IWL_DEBUG_STATS(f, a...) IWL_DEBUG(IWL_DL_STATS, f, ## a)
#define IWL_DEBUG_TX_REPLY(f, a...) IWL_DEBUG(IWL_DL_TX_REPLY, f, ## a)
diff -up linux-2.6.22.noarch/drivers/net/wireless/iwlwifi/iwl3945-base.c.orig linux-2.6.22.noarch/drivers/net/wireless/iwlwifi/iwl3945-base.c
---- linux-2.6.22.noarch/drivers/net/wireless/iwlwifi/iwl3945-base.c.orig 2007-09-27 19:59:56.000000000 -0400
-+++ linux-2.6.22.noarch/drivers/net/wireless/iwlwifi/iwl3945-base.c 2007-09-27 20:06:43.000000000 -0400
+--- linux-2.6.22.noarch/drivers/net/wireless/iwlwifi/iwl3945-base.c.orig 2007-09-27 19:08:16.000000000 -0400
++++ linux-2.6.22.noarch/drivers/net/wireless/iwlwifi/iwl3945-base.c 2007-09-27 19:10:13.000000000 -0400
@@ -103,7 +103,7 @@ int iwl_param_queues_num = IWL_MAX_NUM_Q
#define VS
#endif
@@ -792,3 +792,27 @@
}
} else {
+diff -up linux-2.6.23.noarch/drivers/net/wireless/iwlwifi/iwl3945-base.c.orig linux-2.6.23.noarch/drivers/net/wireless/iwlwifi/iwl3945-base.c
+--- linux-2.6.23.noarch/drivers/net/wireless/iwlwifi/iwl3945-base.c.orig 2007-10-26 11:38:34.000000000 -0400
++++ linux-2.6.23.noarch/drivers/net/wireless/iwlwifi/iwl3945-base.c 2007-10-26 11:44:00.000000000 -0400
+@@ -8428,6 +8428,8 @@ static int iwl_pci_probe(struct pci_dev
+ priv->power_mode = IWL_POWER_AC;
+ priv->user_txpower_limit = IWL_DEFAULT_TX_POWER;
+
++ iwl_disable_interrupts(priv);
++
+ pci_enable_msi(pdev);
+
+ err = request_irq(pdev->irq, iwl_isr, IRQF_SHARED, DRV_NAME, priv);
+diff -up linux-2.6.23.noarch/drivers/net/wireless/iwlwifi/iwl4965-base.c.orig linux-2.6.23.noarch/drivers/net/wireless/iwlwifi/iwl4965-base.c
+--- linux-2.6.23.noarch/drivers/net/wireless/iwlwifi/iwl4965-base.c.orig 2007-10-26 11:38:34.000000000 -0400
++++ linux-2.6.23.noarch/drivers/net/wireless/iwlwifi/iwl4965-base.c 2007-10-26 11:44:00.000000000 -0400
+@@ -9026,6 +9026,8 @@ static int iwl_pci_probe(struct pci_dev
+ priv->power_mode = IWL_POWER_AC;
+ priv->user_txpower_limit = IWL_DEFAULT_TX_POWER;
+
++ iwl_disable_interrupts(priv);
++
+ pci_enable_msi(pdev);
+
+ err = request_irq(pdev->irq, iwl_isr, IRQF_SHARED, DRV_NAME, priv);
More information about the fedora-extras-commits
mailing list