[FIB_TRIE]: Don't ignore negative results from fib_semantic_match
tree 01d66754d441b84cb09fe28f875cbb47b3b9fb0c parent 0572e3da3ff5c3744b2f606ecf296d5f89a4bbdf author Patrick McHardy [EMAIL PROTECTED] Wed, 24 Aug 2005 12:06:09 -0700 committer David S. Miller [EMAIL PROTECTED] Wed, 24 Aug 2005 12:06:09 -0700 [FIB_TRIE]: Don't ignore negative results from fib_semantic_match When a semantic match occurs either success, not found or an error (for matching unreachable routes/blackholes) is returned. fib_trie ignores the errors and looks for a different matching route. Treat results other than no match as success and end lookup. Signed-off-by: Patrick McHardy [EMAIL PROTECTED] Signed-off-by: David S. Miller [EMAIL PROTECTED] net/ipv4/fib_trie.c | 14 +++--- 1 files changed, 7 insertions(+), 7 deletions(-) diff --git a/net/ipv4/fib_trie.c b/net/ipv4/fib_trie.c --- a/net/ipv4/fib_trie.c +++ b/net/ipv4/fib_trie.c @@ -1333,9 +1333,9 @@ err:; } static inline int check_leaf(struct trie *t, struct leaf *l, t_key key, int *plen, const struct flowi *flp, -struct fib_result *res, int *err) +struct fib_result *res) { - int i; + int err, i; t_key mask; struct leaf_info *li; struct hlist_head *hhead = l-list; @@ -1348,18 +1348,18 @@ static inline int check_leaf(struct trie if (l-key != (key mask)) continue; - if (((*err) = fib_semantic_match(li-falh, flp, res, l-key, mask, i)) == 0) { + if ((err = fib_semantic_match(li-falh, flp, res, l-key, mask, i)) = 0) { *plen = i; #ifdef CONFIG_IP_FIB_TRIE_STATS t-stats.semantic_match_passed++; #endif - return 1; + return err; } #ifdef CONFIG_IP_FIB_TRIE_STATS t-stats.semantic_match_miss++; #endif } - return 0; + return 1; } static int @@ -1386,7 +1386,7 @@ fn_trie_lookup(struct fib_table *tb, con /* Just a leaf? */ if (IS_LEAF(n)) { - if (check_leaf(t, (struct leaf *)n, key, plen, flp, res, ret)) + if ((ret = check_leaf(t, (struct leaf *)n, key, plen, flp, res)) = 0) goto found; goto failed; } @@ -1508,7 +1508,7 @@ fn_trie_lookup(struct fib_table *tb, con continue; } if (IS_LEAF(n)) { - if (check_leaf(t, (struct leaf *)n, key, plen, flp, res, ret)) + if ((ret = check_leaf(t, (struct leaf *)n, key, plen, flp, res)) = 0) goto found; } backtrace: - To unsubscribe from this list: send the line unsubscribe git-commits-head in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[TG3]: Fix ethtool loopback test lockup
tree 3984a1dc8378d7a976be60523021036c8265a167 parent 06c7427021f1cc83703f14659d8405ca773ba1ef author Michael Chan [EMAIL PROTECTED] Fri, 26 Aug 2005 05:31:41 -0700 committer David S. Miller [EMAIL PROTECTED] Fri, 26 Aug 2005 05:31:41 -0700 [TG3]: Fix ethtool loopback test lockup The tg3_abort_hw() call in tg3_test_loopback() is causing lockups on some devices. tg3_abort_hw() disables the memory arbiter, causing tg3_reset_hw() to hang when it tries to write the pre-reset signature. tg3_abort_hw() should only be called after the pre-reset signature has been written. This is all done in tg3_reset_hw() so the tg3_abort_hw() call is unnecessary and can be removed. [ Also bump driver version and release date. -DaveM ] Signed-off-by: Michael Chan [EMAIL PROTECTED] Signed-off-by: David S. Miller [EMAIL PROTECTED] drivers/net/tg3.c |6 ++ 1 files changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c --- a/drivers/net/tg3.c +++ b/drivers/net/tg3.c @@ -66,8 +66,8 @@ #define DRV_MODULE_NAMEtg3 #define PFX DRV_MODULE_NAME: -#define DRV_MODULE_VERSION 3.36 -#define DRV_MODULE_RELDATE August 19, 2005 +#define DRV_MODULE_VERSION 3.37 +#define DRV_MODULE_RELDATE August 25, 2005 #define TG3_DEF_MAC_MODE 0 #define TG3_DEF_RX_MODE0 @@ -7865,8 +7865,6 @@ static int tg3_test_loopback(struct tg3 err = -EIO; - tg3_abort_hw(tp, 1); - tg3_reset_hw(tp); mac_mode = (tp-mac_mode ~MAC_MODE_PORT_MODE_MASK) | - To unsubscribe from this list: send the line unsubscribe git-commits-head in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH] Fix oops in fs/locks.c on close of file with pending locks
tree 2fff144b1b85cdf362c1a774e77b34f204b93ebf parent fd589e0b662c1ea8cfb1e0d20d60a2510979865b author Steve French [EMAIL PROTECTED] Sat, 27 Aug 2005 00:42:59 -0500 committer Linus Torvalds [EMAIL PROTECTED] Sat, 27 Aug 2005 06:05:35 -0700 [PATCH] Fix oops in fs/locks.c on close of file with pending locks The recent change to locks_remove_flock code in fs/locks.c changes how byte range locks are removed from closing files, which shows up a bug in cifs. The assumption in the cifs code was that the close call sent to the server would remove any pending locks on the server on this file, but that is no longer safe as the fs/locks.c code on the client wants unlock of 0 to PATH_MAX to remove all locks (at least from this client, it is not possible AFAIK to remove all locks from other clients made to the server copy of the file). Note that cifs locks are different from posix locks - and it is not possible to map posix locks perfectly on the wire yet, due to restrictions of the cifs network protocol, even to Samba without adding a new request type to the network protocol (which we plan to do for Samba 3.0.21 within a few months), but the local client will have the correct, posix view, of the lock in most cases. The correct fix for cifs for this would involve a bigger change than I would like to do this late in the 2.6.13-rc cycle - and would involve cifs keeping track of all unmerged (uncoalesced) byte range locks for each remote inode and scanning that list to remove locks that intersect or fall wholly within the range - locks that intersect may have to be reaquired with the smaller, remaining range. Signed-off-by: Steve French [EMAIL PROTECTED] Signed-off-by: Dave Kleikamp [EMAIL PROTECTED] Signed-off-by: Linus Torvalds [EMAIL PROTECTED] fs/cifs/file.c |2 +- 1 files changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/cifs/file.c b/fs/cifs/file.c --- a/fs/cifs/file.c +++ b/fs/cifs/file.c @@ -643,7 +643,7 @@ int cifs_lock(struct file *file, int cmd netfid, length, pfLock-fl_start, numUnlock, numLock, lockType, wait_flag); - if (rc == 0 (pfLock-fl_flags FL_POSIX)) + if (pfLock-fl_flags FL_POSIX) posix_lock_file_wait(file, pfLock); FreeXid(xid); return rc; - To unsubscribe from this list: send the line unsubscribe git-commits-head in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH] drivers/hwmon/*: kfree() correct pointers
tree 0db3419ab73cabed542a18cd5c7da50b03df896c parent d634cc15e8f2038dc9c078beae79f9382ada author Alexey Dobriyan [EMAIL PROTECTED] Fri, 26 Aug 2005 01:49:14 +0400 committer Linus Torvalds [EMAIL PROTECTED] Sat, 27 Aug 2005 06:30:30 -0700 [PATCH] drivers/hwmon/*: kfree() correct pointers The adm9240 driver, in adm9240_detect(), allocates a structure. The error path attempts to kfree() -client field of it (second one), resulting in an oops (or slab corruption) if the hardware is not present. -client field in adm1026, adm1031, smsc47b397 and smsc47m1 is the first in ${HWMON}_data structure, but fix them too. Signed-off-by: Jonathan Corbet [EMAIL PROTECTED] Signed-off-by: Alexey Dobriyan [EMAIL PROTECTED] Signed-off-by: Linus Torvalds [EMAIL PROTECTED] drivers/hwmon/adm1026.c|2 +- drivers/hwmon/adm1031.c|2 +- drivers/hwmon/adm9240.c|2 +- drivers/hwmon/smsc47b397.c |2 +- drivers/hwmon/smsc47m1.c |2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/hwmon/adm1026.c b/drivers/hwmon/adm1026.c --- a/drivers/hwmon/adm1026.c +++ b/drivers/hwmon/adm1026.c @@ -1691,7 +1691,7 @@ int adm1026_detect(struct i2c_adapter *a /* Error out and cleanup code */ exitfree: - kfree(new_client); + kfree(data); exit: return err; } diff --git a/drivers/hwmon/adm1031.c b/drivers/hwmon/adm1031.c --- a/drivers/hwmon/adm1031.c +++ b/drivers/hwmon/adm1031.c @@ -834,7 +834,7 @@ static int adm1031_detect(struct i2c_ada return 0; exit_free: - kfree(new_client); + kfree(data); exit: return err; } diff --git a/drivers/hwmon/adm9240.c b/drivers/hwmon/adm9240.c --- a/drivers/hwmon/adm9240.c +++ b/drivers/hwmon/adm9240.c @@ -616,7 +616,7 @@ static int adm9240_detect(struct i2c_ada return 0; exit_free: - kfree(new_client); + kfree(data); exit: return err; } diff --git a/drivers/hwmon/smsc47b397.c b/drivers/hwmon/smsc47b397.c --- a/drivers/hwmon/smsc47b397.c +++ b/drivers/hwmon/smsc47b397.c @@ -298,7 +298,7 @@ static int smsc47b397_detect(struct i2c_ return 0; error_free: - kfree(new_client); + kfree(data); error_release: release_region(addr, SMSC_EXTENT); return err; diff --git a/drivers/hwmon/smsc47m1.c b/drivers/hwmon/smsc47m1.c --- a/drivers/hwmon/smsc47m1.c +++ b/drivers/hwmon/smsc47m1.c @@ -495,7 +495,7 @@ static int smsc47m1_detect(struct i2c_ad return 0; error_free: - kfree(new_client); + kfree(data); error_release: release_region(address, SMSC_EXTENT); return err; - To unsubscribe from this list: send the line unsubscribe git-commits-head in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH] bogus iounmap() in emac
tree 1d6d1e779fcbaed6f06bf49ed4ad630ecdf58ed1 parent 1f57ff89fee47a317e9e8ca63bf0f139802cc116 author Al Viro [EMAIL PROTECTED] Thu, 25 Aug 2005 22:59:48 +0100 committer Linus Torvalds [EMAIL PROTECTED] Sat, 27 Aug 2005 06:30:30 -0700 [PATCH] bogus iounmap() in emac Dumb typo: iounmap(local_pointer_variable). Signed-off-by: Al Viro [EMAIL PROTECTED] Signed-off-by: Linus Torvalds [EMAIL PROTECTED] drivers/net/ibm_emac/ibm_emac_core.c |2 +- 1 files changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ibm_emac/ibm_emac_core.c b/drivers/net/ibm_emac/ibm_emac_core.c --- a/drivers/net/ibm_emac/ibm_emac_core.c +++ b/drivers/net/ibm_emac/ibm_emac_core.c @@ -1253,7 +1253,7 @@ static int emac_init_tah(struct ocp_enet TAH_MR_CVR | TAH_MR_ST_768 | TAH_MR_TFS_10KB | TAH_MR_DTFP | TAH_MR_DIG); - iounmap(tahp); + iounmap(tahp); return 0; } - To unsubscribe from this list: send the line unsubscribe git-commits-head in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH] bogus function type in qdio
tree c550c6ef8439e867ea2f73aebfca0fca0e09b64a parent b6a9ad73897acb7ea4cf56aae0fc39ba1c471fba author Al Viro [EMAIL PROTECTED] Thu, 25 Aug 2005 23:03:35 +0100 committer Linus Torvalds [EMAIL PROTECTED] Sat, 27 Aug 2005 06:30:30 -0700 [PATCH] bogus function type in qdio In qdio_get_micros() volatile in return type is plain noise (even with old gccisms it would make no sense - noreturn function returning __u64 is a bit odd ;-) Signed-off-by: Al Viro [EMAIL PROTECTED] Signed-off-by: Linus Torvalds [EMAIL PROTECTED] drivers/s390/cio/qdio.c |2 +- 1 files changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/s390/cio/qdio.c b/drivers/s390/cio/qdio.c --- a/drivers/s390/cio/qdio.c +++ b/drivers/s390/cio/qdio.c @@ -112,7 +112,7 @@ qdio_min(int a,int b) /* SCRUBBER HELPER ROUTINES **/ -static inline volatile __u64 +static inline __u64 qdio_get_micros(void) { return (get_clock() 10); /* time12 is microseconds */ - To unsubscribe from this list: send the line unsubscribe git-commits-head in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH] I2C hwmon: kfree fixes
tree b88e2d0d55bbc9788337c256dfd25b54d684e49e parent 32818c2eb6b83ea5065c89e0c3cf774abc4dc02b author Mark M. Hoffman [EMAIL PROTECTED] Sat, 27 Aug 2005 08:34:08 -0700 committer Linus Torvalds [EMAIL PROTECTED] Sat, 27 Aug 2005 09:37:12 -0700 [PATCH] I2C hwmon: kfree fixes This patch fixes several instances of hwmon drivers kfree'ing the wrong pointer; the existing code works somewhat by accident. (akpm: plucked from Greg's queue based on lkml discussion. Finishes off the patch from Jon Corbet) Signed-off-by: Mark M. Hoffman [EMAIL PROTECTED] Signed-off-by: Jean Delvare [EMAIL PROTECTED] Signed-off-by: Greg Kroah-Hartman [EMAIL PROTECTED] Signed-off-by: Andrew Morton [EMAIL PROTECTED] Signed-off-by: Linus Torvalds [EMAIL PROTECTED] drivers/hwmon/adm1026.c |2 +- drivers/hwmon/adm1031.c |2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/hwmon/adm1026.c b/drivers/hwmon/adm1026.c --- a/drivers/hwmon/adm1026.c +++ b/drivers/hwmon/adm1026.c @@ -325,7 +325,7 @@ int adm1026_attach_adapter(struct i2c_ad int adm1026_detach_client(struct i2c_client *client) { i2c_detach_client(client); - kfree(client); + kfree(i2c_get_clientdata(client)); return 0; } diff --git a/drivers/hwmon/adm1031.c b/drivers/hwmon/adm1031.c --- a/drivers/hwmon/adm1031.c +++ b/drivers/hwmon/adm1031.c @@ -845,7 +845,7 @@ static int adm1031_detach_client(struct if ((ret = i2c_detach_client(client)) != 0) { return ret; } - kfree(client); + kfree(i2c_get_clientdata(client)); return 0; } - To unsubscribe from this list: send the line unsubscribe git-commits-head in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH] x86_64: Tell VM about holes in nodes
tree c75562513489f62c8dcfd41acd467bca3d3202cc parent bebf4688e9dbbfdd421736685d607bced91a3c91 author Andi Kleen [EMAIL PROTECTED] Sat, 27 Aug 2005 08:34:10 -0700 committer Linus Torvalds [EMAIL PROTECTED] Sat, 27 Aug 2005 09:37:12 -0700 [PATCH] x86_64: Tell VM about holes in nodes Some nodes can have large holes on x86-64. This fixes problems with the VM allowing too many dirty pages because it overestimates the number of available RAM in a node. In extreme cases you can end up with all RAM filled with dirty pages which can lead to deadlocks and other nasty behaviour. This patch just tells the VM about the known holes from e820. Reserved (like the kernel text or mem_map) is still not taken into account, but that should be only a few percent error now. Small detail is that the flat setup uses the NUMA free_area_init_node() now too because it offers more flexibility. (akpm: lotsa thanks to Martin for working this problem out) Cc: Martin Bligh [EMAIL PROTECTED] Signed-off-by: Andi Kleen [EMAIL PROTECTED] Signed-off-by: Andrew Morton [EMAIL PROTECTED] Signed-off-by: Linus Torvalds [EMAIL PROTECTED] arch/x86_64/kernel/e820.c | 34 ++ arch/x86_64/mm/init.c | 16 arch/x86_64/mm/numa.c |8 +++- include/asm-x86_64/e820.h |2 ++ 4 files changed, 55 insertions(+), 5 deletions(-) diff --git a/arch/x86_64/kernel/e820.c b/arch/x86_64/kernel/e820.c --- a/arch/x86_64/kernel/e820.c +++ b/arch/x86_64/kernel/e820.c @@ -185,6 +185,40 @@ unsigned long __init e820_end_of_ram(voi } /* + * Compute how much memory is missing in a range. + * Unlike the other functions in this file the arguments are in page numbers. + */ +unsigned long __init +e820_hole_size(unsigned long start_pfn, unsigned long end_pfn) +{ + unsigned long ram = 0; + unsigned long start = start_pfn PAGE_SHIFT; + unsigned long end = end_pfn PAGE_SHIFT; + int i; + for (i = 0; i e820.nr_map; i++) { + struct e820entry *ei = e820.map[i]; + unsigned long last, addr; + + if (ei-type != E820_RAM || + ei-addr+ei-size = start || + ei-addr = end) + continue; + + addr = round_up(ei-addr, PAGE_SIZE); + if (addr start) + addr = start; + + last = round_down(ei-addr + ei-size, PAGE_SIZE); + if (last = end) + last = end; + + if (last addr) + ram += last - addr; + } + return ((end - start) - ram) PAGE_SHIFT; +} + +/* * Mark e820 reserved areas as busy for the resource manager. */ void __init e820_reserve_resources(void) diff --git a/arch/x86_64/mm/init.c b/arch/x86_64/mm/init.c --- a/arch/x86_64/mm/init.c +++ b/arch/x86_64/mm/init.c @@ -322,18 +322,26 @@ void zap_low_mappings(void) void __init paging_init(void) { { - unsigned long zones_size[MAX_NR_ZONES] = {0, 0, 0}; + unsigned long zones_size[MAX_NR_ZONES]; + unsigned long holes[MAX_NR_ZONES]; unsigned int max_dma; + memset(zones_size, 0, sizeof(zones_size)); + memset(holes, 0, sizeof(holes)); + max_dma = virt_to_phys((char *)MAX_DMA_ADDRESS) PAGE_SHIFT; - if (end_pfn max_dma) + if (end_pfn max_dma) { zones_size[ZONE_DMA] = end_pfn; - else { + holes[ZONE_DMA] = e820_hole_size(0, end_pfn); + } else { zones_size[ZONE_DMA] = max_dma; + holes[ZONE_DMA] = e820_hole_size(0, max_dma); zones_size[ZONE_NORMAL] = end_pfn - max_dma; + holes[ZONE_NORMAL] = e820_hole_size(max_dma, end_pfn); } - free_area_init(zones_size); + free_area_init_node(0, NODE_DATA(0), zones_size, +__pa(PAGE_OFFSET) PAGE_SHIFT, holes); } return; } diff --git a/arch/x86_64/mm/numa.c b/arch/x86_64/mm/numa.c --- a/arch/x86_64/mm/numa.c +++ b/arch/x86_64/mm/numa.c @@ -126,9 +126,11 @@ void __init setup_node_zones(int nodeid) { unsigned long start_pfn, end_pfn; unsigned long zones[MAX_NR_ZONES]; + unsigned long holes[MAX_NR_ZONES]; unsigned long dma_end_pfn; memset(zones, 0, sizeof(unsigned long) * MAX_NR_ZONES); + memset(holes, 0, sizeof(unsigned long) * MAX_NR_ZONES); start_pfn = node_start_pfn(nodeid); end_pfn = node_end_pfn(nodeid); @@ -139,13 +141,17 @@ void __init setup_node_zones(int nodeid) dma_end_pfn = __pa(MAX_DMA_ADDRESS) PAGE_SHIFT; if (start_pfn dma_end_pfn) { zones[ZONE_DMA] = dma_end_pfn - start_pfn; + holes[ZONE_DMA] = e820_hole_size(start_pfn, dma_end_pfn);
[PATCH] arm: fix IXP4xx flash resource range
tree 662163e453ee6514a13e844993700e96baa09260 parent 485761bd6a72d33b3d4fa884927b2b0d983b701e author Deepak Saxena [EMAIL PROTECTED] Sat, 27 Aug 2005 08:34:11 -0700 committer Linus Torvalds [EMAIL PROTECTED] Sat, 27 Aug 2005 09:37:12 -0700 [PATCH] arm: fix IXP4xx flash resource range We are currently reserving one byte more than actually needed by the flash device and overlapping into the next I/O expansion bus window. This a) causes us to allocate an extra page of VM due to ARM ioremap() alignment code and b) could cause problems if another driver tries to request the next expansion bus window. Signed-off-by: Deepak Saxena [EMAIL PROTECTED] Cc: Russell King [EMAIL PROTECTED] Signed-off-by: Andrew Morton [EMAIL PROTECTED] Signed-off-by: Linus Torvalds [EMAIL PROTECTED] arch/arm/mach-ixp4xx/coyote-setup.c |2 +- arch/arm/mach-ixp4xx/gtwx5715-setup.c |2 +- arch/arm/mach-ixp4xx/ixdp425-setup.c |2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/arch/arm/mach-ixp4xx/coyote-setup.c b/arch/arm/mach-ixp4xx/coyote-setup.c --- a/arch/arm/mach-ixp4xx/coyote-setup.c +++ b/arch/arm/mach-ixp4xx/coyote-setup.c @@ -36,7 +36,7 @@ static struct flash_platform_data coyote static struct resource coyote_flash_resource = { .start = COYOTE_FLASH_BASE, - .end= COYOTE_FLASH_BASE + COYOTE_FLASH_SIZE, + .end= COYOTE_FLASH_BASE + COYOTE_FLASH_SIZE - 1, .flags = IORESOURCE_MEM, }; diff --git a/arch/arm/mach-ixp4xx/gtwx5715-setup.c b/arch/arm/mach-ixp4xx/gtwx5715-setup.c --- a/arch/arm/mach-ixp4xx/gtwx5715-setup.c +++ b/arch/arm/mach-ixp4xx/gtwx5715-setup.c @@ -114,7 +114,7 @@ static struct flash_platform_data gtwx57 static struct resource gtwx5715_flash_resource = { .start = GTWX5715_FLASH_BASE, - .end= GTWX5715_FLASH_BASE + GTWX5715_FLASH_SIZE, + .end= GTWX5715_FLASH_BASE + GTWX5715_FLASH_SIZE - 1, .flags = IORESOURCE_MEM, }; diff --git a/arch/arm/mach-ixp4xx/ixdp425-setup.c b/arch/arm/mach-ixp4xx/ixdp425-setup.c --- a/arch/arm/mach-ixp4xx/ixdp425-setup.c +++ b/arch/arm/mach-ixp4xx/ixdp425-setup.c @@ -36,7 +36,7 @@ static struct flash_platform_data ixdp42 static struct resource ixdp425_flash_resource = { .start = IXDP425_FLASH_BASE, - .end= IXDP425_FLASH_BASE + IXDP425_FLASH_SIZE, + .end= IXDP425_FLASH_BASE + IXDP425_FLASH_SIZE - 1, .flags = IORESOURCE_MEM, }; - To unsubscribe from this list: send the line unsubscribe git-commits-head in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH] IB: fix use-after-free in user verbs cleanup
tree 01c6de89a3d60c35d2133c0b6b1903509a8f1df8 parent 1c9cf6f9861f8d27303ee2531b3b7686269c71ce author Roland Dreier [EMAIL PROTECTED] Sat, 27 Aug 2005 08:34:14 -0700 committer Linus Torvalds [EMAIL PROTECTED] Sat, 27 Aug 2005 09:37:12 -0700 [PATCH] IB: fix use-after-free in user verbs cleanup Fix a use-after-free bug in userspace verbs cleanup: we can't touch mr-device after we free mr by calling ib_dereg_mr(). Signed-off-by: Roland Dreier [EMAIL PROTECTED] Signed-off-by: Andrew Morton [EMAIL PROTECTED] Signed-off-by: Linus Torvalds [EMAIL PROTECTED] drivers/infiniband/core/uverbs_main.c |3 ++- 1 files changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/infiniband/core/uverbs_main.c b/drivers/infiniband/core/uverbs_main.c --- a/drivers/infiniband/core/uverbs_main.c +++ b/drivers/infiniband/core/uverbs_main.c @@ -130,13 +130,14 @@ static int ib_dealloc_ucontext(struct ib list_for_each_entry_safe(uobj, tmp, context-mr_list, list) { struct ib_mr *mr = idr_find(ib_uverbs_mr_idr, uobj-id); + struct ib_device *mrdev = mr-device; struct ib_umem_object *memobj; idr_remove(ib_uverbs_mr_idr, uobj-id); ib_dereg_mr(mr); memobj = container_of(uobj, struct ib_umem_object, uobject); - ib_umem_release_on_close(mr-device, memobj-umem); + ib_umem_release_on_close(mrdev, memobj-umem); list_del(uobj-list); kfree(memobj); - To unsubscribe from this list: send the line unsubscribe git-commits-head in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH] md: create a MODULE_ALIAS for md corresponding to its block major number.
tree 23660dd9234016c927b8c135c9e48b685cb16207 parent e1bcfcaa0b3bec2a67b22c565a0bf508ea90db1d author NeilBrown [EMAIL PROTECTED] Sat, 27 Aug 2005 08:34:15 -0700 committer Linus Torvalds [EMAIL PROTECTED] Sat, 27 Aug 2005 09:37:12 -0700 [PATCH] md: create a MODULE_ALIAS for md corresponding to its block major number. I just discovered this is needed for module auto-loading. Signed-off-by: Neil Brown [EMAIL PROTECTED] Signed-off-by: Andrew Morton [EMAIL PROTECTED] Signed-off-by: Linus Torvalds [EMAIL PROTECTED] drivers/md/md.c |1 + 1 files changed, 1 insertion(+) diff --git a/drivers/md/md.c b/drivers/md/md.c --- a/drivers/md/md.c +++ b/drivers/md/md.c @@ -4011,3 +4011,4 @@ EXPORT_SYMBOL(md_print_devices); EXPORT_SYMBOL(md_check_recovery); MODULE_LICENSE(GPL); MODULE_ALIAS(md); +MODULE_ALIAS_BLOCKDEV_MAJOR(MD_MAJOR); - To unsubscribe from this list: send the line unsubscribe git-commits-head in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH] md: clear the 'recovery' flags when starting an md array.
tree 35b09cbecef683302adaddb9e8f7047462e7a848 parent 72008652dae7d10fa668d7b2ada3bddff7403d86 author NeilBrown [EMAIL PROTECTED] Sat, 27 Aug 2005 08:34:16 -0700 committer Linus Torvalds [EMAIL PROTECTED] Sat, 27 Aug 2005 09:37:13 -0700 [PATCH] md: clear the 'recovery' flags when starting an md array. It's possible for this to still have flags in it and a previous instance has been stopped, and that confused the new array using the same mddev. Signed-off-by: Neil Brown [EMAIL PROTECTED] Signed-off-by: Andrew Morton [EMAIL PROTECTED] Signed-off-by: Linus Torvalds [EMAIL PROTECTED] drivers/md/md.c |1 + 1 files changed, 1 insertion(+) diff --git a/drivers/md/md.c b/drivers/md/md.c --- a/drivers/md/md.c +++ b/drivers/md/md.c @@ -1689,6 +1689,7 @@ static int do_md_run(mddev_t * mddev) mddev-pers = pers[pnum]; spin_unlock(pers_lock); + mddev-recovery = 0; mddev-resync_max_sectors = mddev-size 1; /* may be over-ridden by personality */ /* before we start the array running, initialise the bitmap */ - To unsubscribe from this list: send the line unsubscribe git-commits-head in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH] Document idr_get_new_above() semantics, update inotify
tree 5e1ae11c320ea00488b33224cc982d0be2d986d6 parent 755528c860b05fcecda1c88a2bdaffcb50760a7f author John McCutchan [EMAIL PROTECTED] Fri, 26 Aug 2005 22:02:04 -0400 committer Linus Torvalds [EMAIL PROTECTED] Sat, 27 Aug 2005 01:32:57 -0700 [PATCH] Document idr_get_new_above() semantics, update inotify There is an off by one problem with idr_get_new_above. The comment and function name suggest that it will return an id starting_id, but it actually returned an id = starting_id, and kernel callers other than inotify treated it as such. The patch below fixes the comment, and fixes inotifys usage. The function name still doesn't match the behaviour, but it never did. Signed-off-by: John McCutchan [EMAIL PROTECTED] Signed-off-by: Linus Torvalds [EMAIL PROTECTED] fs/inotify.c |2 +- lib/idr.c|2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/inotify.c b/fs/inotify.c --- a/fs/inotify.c +++ b/fs/inotify.c @@ -353,7 +353,7 @@ static int inotify_dev_get_wd(struct ino do { if (unlikely(!idr_pre_get(dev-idr, GFP_KERNEL))) return -ENOSPC; - ret = idr_get_new_above(dev-idr, watch, dev-last_wd, watch-wd); + ret = idr_get_new_above(dev-idr, watch, dev-last_wd+1, watch-wd); } while (ret == -EAGAIN); return ret; diff --git a/lib/idr.c b/lib/idr.c --- a/lib/idr.c +++ b/lib/idr.c @@ -207,7 +207,7 @@ build_up: } /** - * idr_get_new_above - allocate new idr entry above a start id + * idr_get_new_above - allocate new idr entry above or equal to a start id * @idp: idr handle * @ptr: pointer you want associated with the ide * @start_id: id to start search at - To unsubscribe from this list: send the line unsubscribe git-commits-head in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH] Fixup symlink function pointers for hppfs [for 2.6.13]
tree 80a3d59724cc0faf0a5cb07f7e426c9f41d87e67 parent 7c657f2f25d50c602df9291bc6242b98fc090759 author Paolo 'Blaisorblade' Giarrusso [EMAIL PROTECTED] Fri, 26 Aug 2005 16:57:44 +0200 committer Linus Torvalds [EMAIL PROTECTED] Sat, 27 Aug 2005 01:39:19 -0700 [PATCH] Fixup symlink function pointers for hppfs [for 2.6.13] Update hppfs for the symlink functions prototype change. Yes, I know the code I leave there is still _bogus_, see next patch for this. Signed-off-by: Paolo 'Blaisorblade' Giarrusso [EMAIL PROTECTED] Signed-off-by: Linus Torvalds [EMAIL PROTECTED] fs/hppfs/hppfs_kern.c | 16 1 files changed, 8 insertions(+), 8 deletions(-) diff --git a/fs/hppfs/hppfs_kern.c b/fs/hppfs/hppfs_kern.c --- a/fs/hppfs/hppfs_kern.c +++ b/fs/hppfs/hppfs_kern.c @@ -679,25 +679,25 @@ static int hppfs_readlink(struct dentry return(n); } -static int hppfs_follow_link(struct dentry *dentry, struct nameidata *nd) +static void* hppfs_follow_link(struct dentry *dentry, struct nameidata *nd) { struct file *proc_file; struct dentry *proc_dentry; - int (*follow_link)(struct dentry *, struct nameidata *); - int err, n; + void * (*follow_link)(struct dentry *, struct nameidata *); + void *ret; proc_dentry = HPPFS_I(dentry-d_inode)-proc_dentry; proc_file = dentry_open(dget(proc_dentry), NULL, O_RDONLY); - err = PTR_ERR(proc_dentry); - if(IS_ERR(proc_dentry)) - return(err); + + if (IS_ERR(proc_dentry)) + return proc_dentry; follow_link = proc_dentry-d_inode-i_op-follow_link; - n = (*follow_link)(proc_dentry, nd); + ret = (*follow_link)(proc_dentry, nd); fput(proc_file); - return(n); + return ret; } static struct inode_operations hppfs_dir_iops = { - To unsubscribe from this list: send the line unsubscribe git-commits-head in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH] hppfs: fix symlink error path
tree 5c281ab99184fa6dcfb09586064ea7751c32fd4c parent d7a60d50d7713b65a3fd88f11d5717b83a6b6a97 author Paolo 'Blaisorblade' Giarrusso [EMAIL PROTECTED] Fri, 26 Aug 2005 16:57:53 +0200 committer Linus Torvalds [EMAIL PROTECTED] Sat, 27 Aug 2005 01:39:19 -0700 [PATCH] hppfs: fix symlink error path While touching this code I noticed the error handling is bogus, so I fixed it up. I've removed the IS_ERR(proc_dentry) check, which will never trigger and is clearly a typo: we must check proc_file instead. Signed-off-by: Paolo 'Blaisorblade' Giarrusso [EMAIL PROTECTED] Signed-off-by: Linus Torvalds [EMAIL PROTECTED] fs/hppfs/hppfs_kern.c | 24 +--- 1 files changed, 9 insertions(+), 15 deletions(-) diff --git a/fs/hppfs/hppfs_kern.c b/fs/hppfs/hppfs_kern.c --- a/fs/hppfs/hppfs_kern.c +++ b/fs/hppfs/hppfs_kern.c @@ -38,7 +38,7 @@ struct hppfs_inode_info { static inline struct hppfs_inode_info *HPPFS_I(struct inode *inode) { - return(list_entry(inode, struct hppfs_inode_info, vfs_inode)); + return container_of(inode, struct hppfs_inode_info, vfs_inode); } #define HPPFS_SUPER_MAGIC 0xb0ee @@ -662,38 +662,32 @@ static int hppfs_readlink(struct dentry { struct file *proc_file; struct dentry *proc_dentry; - int (*readlink)(struct dentry *, char *, int); - int err, n; + int ret; proc_dentry = HPPFS_I(dentry-d_inode)-proc_dentry; proc_file = dentry_open(dget(proc_dentry), NULL, O_RDONLY); - err = PTR_ERR(proc_dentry); - if(IS_ERR(proc_dentry)) - return(err); + if (IS_ERR(proc_file)) + return PTR_ERR(proc_file); - readlink = proc_dentry-d_inode-i_op-readlink; - n = (*readlink)(proc_dentry, buffer, buflen); + ret = proc_dentry-d_inode-i_op-readlink(proc_dentry, buffer, buflen); fput(proc_file); - return(n); + return ret; } static void* hppfs_follow_link(struct dentry *dentry, struct nameidata *nd) { struct file *proc_file; struct dentry *proc_dentry; - void * (*follow_link)(struct dentry *, struct nameidata *); void *ret; proc_dentry = HPPFS_I(dentry-d_inode)-proc_dentry; proc_file = dentry_open(dget(proc_dentry), NULL, O_RDONLY); + if (IS_ERR(proc_file)) + return proc_file; - if (IS_ERR(proc_dentry)) - return proc_dentry; - - follow_link = proc_dentry-d_inode-i_op-follow_link; - ret = (*follow_link)(proc_dentry, nd); + ret = proc_dentry-d_inode-i_op-follow_link(proc_dentry, nd); fput(proc_file); - To unsubscribe from this list: send the line unsubscribe git-commits-head in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html