* Re: [PATCH linux-next 1/1] ath6k: Normalize use of FW_DIR
From: Tim Gardner @ 2012-04-16 16:42 UTC (permalink / raw)
To: Kalle Valo
Cc: linux-kernel, John W. Linville, linux-wireless, netdev,
ath6kl-devel
In-Reply-To: <4F8BBEAD.40305@qca.qualcomm.com>
On 04/16/2012 12:39 AM, Kalle Valo wrote:
> On 04/13/2012 08:17 PM, Tim Gardner wrote:
>> Cc: Kalle Valo <kvalo@qca.qualcomm.com>
>> Cc: "John W. Linville" <linville@tuxdriver.com>
>> Cc: linux-wireless@vger.kernel.org
>> Cc: netdev@vger.kernel.org
>> Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
>
> Thanks, applied to ath6kl.git. But ar6004 hw1.2 supports wasn't in
> linux-next yet so I changed it as well. If you can, please check my changes:
>
> https://github.com/kvalo/ath6kl/commit/2023dbb8310ab39ac1119a32ef52405f7a73f51f
>
> Kalle
Looks good to me.
rtg
--
Tim Gardner tim.gardner@canonical.com
^ permalink raw reply
* Re: [PATCH] drivers/net/wireless/libertas/if_usb.c: add missing debugging code
From: Dan Williams @ 2012-04-16 16:20 UTC (permalink / raw)
To: Julia Lawall
Cc: kernel-janitors, John W. Linville, libertas-dev, linux-wireless,
netdev, linux-kernel
In-Reply-To: <1334591040-29298-1-git-send-email-Julia.Lawall@lip6.fr>
On Mon, 2012-04-16 at 17:44 +0200, Julia Lawall wrote:
> From: Julia Lawall <Julia.Lawall@lip6.fr>
>
> Add a corresponding leave call on error failure.
>
> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Acked-by: Dan Williams <dcbw@redhat.com>
>
> ---
> drivers/net/wireless/libertas/if_usb.c | 6 ++++--
> 1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/net/wireless/libertas/if_usb.c b/drivers/net/wireless/libertas/if_usb.c
> index 74da5f1..ce4938d 100644
> --- a/drivers/net/wireless/libertas/if_usb.c
> +++ b/drivers/net/wireless/libertas/if_usb.c
> @@ -1128,8 +1128,10 @@ static int if_usb_suspend(struct usb_interface *intf, pm_message_t message)
>
> lbs_deb_enter(LBS_DEB_USB);
>
> - if (priv->psstate != PS_STATE_FULL_POWER)
> - return -1;
> + if (priv->psstate != PS_STATE_FULL_POWER) {
> + ret = -1;
> + goto out;
> + }
>
> #ifdef CONFIG_OLPC
> if (machine_is_olpc()) {
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply
* [PATCH] drivers/net/wireless/libertas/if_usb.c: add missing debugging code
From: Julia Lawall @ 2012-04-16 15:44 UTC (permalink / raw)
To: Dan Williams
Cc: kernel-janitors, John W. Linville, libertas-dev, linux-wireless,
netdev, linux-kernel
From: Julia Lawall <Julia.Lawall@lip6.fr>
Add a corresponding leave call on error failure.
Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
---
drivers/net/wireless/libertas/if_usb.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/drivers/net/wireless/libertas/if_usb.c b/drivers/net/wireless/libertas/if_usb.c
index 74da5f1..ce4938d 100644
--- a/drivers/net/wireless/libertas/if_usb.c
+++ b/drivers/net/wireless/libertas/if_usb.c
@@ -1128,8 +1128,10 @@ static int if_usb_suspend(struct usb_interface *intf, pm_message_t message)
lbs_deb_enter(LBS_DEB_USB);
- if (priv->psstate != PS_STATE_FULL_POWER)
- return -1;
+ if (priv->psstate != PS_STATE_FULL_POWER) {
+ ret = -1;
+ goto out;
+ }
#ifdef CONFIG_OLPC
if (machine_is_olpc()) {
^ permalink raw reply related
* [PATCH] drivers/net/wan/farsync.c: add missing iounmap
From: Julia Lawall @ 2012-04-16 15:22 UTC (permalink / raw)
To: Kevin Curtis; +Cc: kernel-janitors, netdev, linux-kernel
From: Julia Lawall <Julia.Lawall@lip6.fr>
Free card->mem in the error-handling code since it was successfully
allocated just above.
Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
---
drivers/net/wan/farsync.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/net/wan/farsync.c b/drivers/net/wan/farsync.c
index ebb9f24..1a62318 100644
--- a/drivers/net/wan/farsync.c
+++ b/drivers/net/wan/farsync.c
@@ -2483,6 +2483,7 @@ fst_add_one(struct pci_dev *pdev, const struct pci_device_id *ent)
pr_err("Control memory remap failed\n");
pci_release_regions(pdev);
pci_disable_device(pdev);
+ iounmap(card->mem);
kfree(card);
return -ENODEV;
}
^ permalink raw reply related
* Re: Netlink, route monitoring, RTM_DELROUTE not issued for ppp peer address. Bug or feature?
From: Stephen Hemminger @ 2012-04-16 15:19 UTC (permalink / raw)
To: Denys Fedoryshchenko
Cc: Stian Skjelstad, eric.dumazet, stephen.hemminger, netdev
In-Reply-To: <3db49d4a58321a5e185cd67335a60c81@visp.net.lb>
On Mon, 16 Apr 2012 13:37:14 +0300
Denys Fedoryshchenko <denys@visp.net.lb> wrote:
> After digging the code, i came to conclusion:
> fib_del_ifaddr, will check if deleted address are exist as prefsrc or
> interface are shut down, they will do fi->fib_flags |= RTNH_F_DEAD;
> Then fib_flush -> fib_table_flush -> trie_flush_leaf -> trie_flush_list
> will delete such routes.
> But trie_flush_list won't notify over netlink that route are deleted.
>
> So the only solution is to fetch first, then keep full routing table in
> userspace also, and keep tracking if local addresses deleted, and do the
> same in userspace and check for prefsrc...
>
> Maybe it should be fixed? E.g. netlink message sent when any route are
> deleted, even over the flush
>
> On 2012-04-13 16:59, Stian Skjelstad wrote:
> > I've seen the same issue, and got no response so far to that very
> > same question. Have you tested this on older kernels? I have worked
> > around this issue by testing my local copy of routing entries that
> > use
> > 'via'. If they are not routable when after the RTM_DELROUTE event, I
> > autoremove them from my local copy.
> >
> > Stian Skjelstad
> >
Looking at Quagga, it knows that deleting interface address
removes connected routes and silently cleans up.
You have to be really careful here making any changes to not break
applications that expect existing behavior.
^ permalink raw reply
* Re: [PATCH 08/11] nfs: disable data cache revalidation for swapfiles
From: Fred Isaman @ 2012-04-16 15:03 UTC (permalink / raw)
To: Mel Gorman
Cc: Andrew Morton, Linux-MM, Linux-Netdev, Linux-NFS, LKML,
David Miller, Trond Myklebust, Neil Brown, Christoph Hellwig,
Peter Zijlstra, Mike Christie, Eric B Munson
In-Reply-To: <20120416134422.GC2359@suse.de>
On Mon, Apr 16, 2012 at 9:44 AM, Mel Gorman <mgorman@suse.de> wrote:
> On Mon, Apr 16, 2012 at 09:10:04AM -0400, Fred Isaman wrote:
>> > <SNIP>
>> > -static struct nfs_page *nfs_page_find_request_locked(struct page *page)
>> > +static struct nfs_page *
>> > +nfs_page_find_request_locked(struct nfs_inode *nfsi, struct page *page)
>> > {
>> > struct nfs_page *req = NULL;
>> >
>> > - if (PagePrivate(page)) {
>> > + if (PagePrivate(page))
>> > req = (struct nfs_page *)page_private(page);
>> > - if (req != NULL)
>> > - kref_get(&req->wb_kref);
>> > + else if (unlikely(PageSwapCache(page))) {
>> > + struct nfs_page *freq, *t;
>> > +
>> > + /* Linearly search the commit list for the correct req */
>> > + list_for_each_entry_safe(freq, t, &nfsi->commit_list, wb_list) {
>> > + if (freq->wb_page == page) {
>> > + req = freq;
>> > + break;
>> > + }
>> > + }
>> > +
>> > + BUG_ON(req == NULL);
>>
>> I suspect I am missing something, but why is it guaranteed that the
>> req is on the commit list?
>>
>
> It's a fair question and a statement about what I expected to happen.
> The commit list replaces the nfs_page_tree radix tree that used to exist
> and my understanding was that the req would exist in the radix tree until
> the swap IO was completed. I expected it to be the same for the commit
> list and the BUG_ON was based on that expectation. Are there cases where
> the req would not be found?
>
> Thanks.
>
> --
> Mel Gorman
> SUSE Labs
> --
A req is on the commit list only if it actually needs to be scheduled
for COMMIT. In other words, only after it has been sent via WRITE and
the server did not return NFS_FILE_SYNC.
Thus dirtying a page, then trying to touch it again before the WRITE
is sent will not find the corresponding req on the commit_list.
Fred
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply
* Re: [PATCH net-next] net: vxge: Add MODULE_FIRMWARE
From: Tim Gardner @ 2012-04-16 14:52 UTC (permalink / raw)
To: Ben Hutchings; +Cc: linux-kernel, Jon Mason, netdev
In-Reply-To: <1334586550.3209.128.camel@deadeye>
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512
On 04/16/2012 08:29 AM, Ben Hutchings wrote:
>>
>> I guess I'm confused about use of the MODULE_FIRMWARE() macro. I
>> thought it merely described the names of the firmware files that
>> were actually used by the driver and had no run-time impact.
>> Regardless of whether firmware files are used on every load, why
>> _not_ describe them to modinfo ?
> [...]
>
> Ah, that's a good question. Quoting my own interpretation from
> <1257629601.15927.361.camel@localhost>:
>
>> Drivers that must load 'firmware' into the devices they drive
>> should declare the names of the files they will request, using
>> the MODULE_FIRMWARE() macro. This enables other tools to
>> discover these dependencies statically, and warn the user if
>> firmware files are missing.
>
> In Debian we use this to decide which files need to be copied into
> an initramfs. You use that too unless you've changed this feature
> of initramfs-tools. We warn when building an initramfs and during
> a major kernel upgrade if it looks like a driver will be used and
> the corresponding firmware isn't installed.
>
Yep, we've merged "initramfs-tools (0.99) unstable" into precise. I'll
assume it behaves as described. The Ubuntu server installer will
certainly annoy you if firmware is missing. Its likely the LiveCD will
as well.
> I also have an (unfinished) patch that will use this information
> for CONFIG_FIRMWARE_IN_KERNEL.
>
> In this case the firmware files are used to upgrade old flash, but
> since the vendor has closed down there aren't going to be any
> further updates. So the likelihood of the files actually being
> needed by the driver is very small.
>
> Ben.
>
I didn't realize the vendor is defunct, so I suddenly don't care as much.
rtg
- --
Tim Gardner tim.gardner@canonical.com
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
iQIcBAEBCgAGBQJPjDIXAAoJED12yEX6FEfKRE4P/j7zqPOeom4wwocrn4zQrU/6
BW5BTUpea9pnC7dgIp/Vl/HgO+5WrdApBrcONpfJeHE+1bBM1gx6NANLu2qPx3BG
EqMUI+I7bAbwFqUQnDs1wgqfat5CKTGfmf8lwjTzbmRVMlPRMfCGZWlfSL/Pi9Tn
5R8M4TxbspOkI0+iRmcjlOiRVAYuTglaiQD9r0cqyRQeJ+jQ5RK/uwCNyTKHh3eB
LmeXj7RU/gbUiXZkqh6HEtT9QqhOL2BYHboVjHnKGcdvLylqaLNiwcWKLOrQ4bxy
q3GuLtEmAb7fV5stONhyoqrDBfvWGNtbOSmqW4yXIeKOT3S4/UOs+LrrIXItgLgD
qpBW9xBNjT+K+DkTh8iTpCF39igyMG+PvPJ3bjxEznPZoYU5TLJLPrw6YDUnfe54
lFUMdnAVHZmgdF9uUrakNacwPXkdTd3t4F+Y+sPLxaHYyOC/+hrXnkj9KLxlVjYr
RP82iHhINcNgEl5Rqj98Kp0kw8vsVBuDm5i5LvaRLlah7PNWJ/tSbFXwG+qC0VZK
BkVSatVyLgWDOJAN4NYgPME9/IAV+Mmlu7ZOIN/8oyRiMaK4HPsDDSLYhwthmXN3
r9ViAJTdGCBf+FTvLS8H3YXbueFuLNoH0nfV4oPB77jrYWesEPEqJlKPqefJAVAG
NZshSCqSm2x4C+2UXuhp
=BYdE
-----END PGP SIGNATURE-----
^ permalink raw reply
* [PATCH] netns: do not leak net_generic data on failed init
From: Julian Anastasov @ 2012-04-16 14:43 UTC (permalink / raw)
To: netdev; +Cc: Eric W. Biederman
ops_init should free the net_generic data on
init failure and __register_pernet_operations should not
call ops_free when NET_NS is not enabled.
Signed-off-by: Julian Anastasov <ja@ssi.bg>
---
net/core/net_namespace.c | 33 ++++++++++++++++++---------------
1 files changed, 18 insertions(+), 15 deletions(-)
diff --git a/net/core/net_namespace.c b/net/core/net_namespace.c
index 0e950fd..31a5ae5 100644
--- a/net/core/net_namespace.c
+++ b/net/core/net_namespace.c
@@ -83,21 +83,29 @@ assign:
static int ops_init(const struct pernet_operations *ops, struct net *net)
{
- int err;
+ int err = -ENOMEM;
+ void *data = NULL;
+
if (ops->id && ops->size) {
- void *data = kzalloc(ops->size, GFP_KERNEL);
+ data = kzalloc(ops->size, GFP_KERNEL);
if (!data)
- return -ENOMEM;
+ goto out;
err = net_assign_generic(net, *ops->id, data);
- if (err) {
- kfree(data);
- return err;
- }
+ if (err)
+ goto cleanup;
}
+ err = 0;
if (ops->init)
- return ops->init(net);
- return 0;
+ err = ops->init(net);
+ if (!err)
+ return 0;
+
+cleanup:
+ kfree(data);
+
+out:
+ return err;
}
static void ops_free(const struct pernet_operations *ops, struct net *net)
@@ -448,12 +456,7 @@ static void __unregister_pernet_operations(struct pernet_operations *ops)
static int __register_pernet_operations(struct list_head *list,
struct pernet_operations *ops)
{
- int err = 0;
- err = ops_init(ops, &init_net);
- if (err)
- ops_free(ops, &init_net);
- return err;
-
+ return ops_init(ops, &init_net);
}
static void __unregister_pernet_operations(struct pernet_operations *ops)
--
1.7.3.4
^ permalink raw reply related
* [PATCH] davinci_mdio: Fix MDIO timeout check
From: Christian Riesch @ 2012-04-16 14:35 UTC (permalink / raw)
To: netdev-u79uwXL29TY76Z2rM5mHXA
Cc: davinci-linux-open-source-VycZQUHpC/PFrsHnngEfi1aTQe2KTcn/,
ravonereal-Re5JQEeQqe8AvxtiuMwx3w, stable-u79uwXL29TY76Z2rM5mHXA,
Manfred Rudigier
Under heavy load (flood ping) it is possible for the MDIO timeout to
expire before the loop checks the GO bit again. This patch adds an
additional check whether the operation was done before actually
returning -ETIMEDOUT.
To reproduce this bug, flood ping the device, e.g., ping -f -l 1000
After some time, a "timed out waiting for user access" warning
may appear. And even worse, link may go down since the PHY reported a
timeout.
Signed-off-by: Christian Riesch <christian.riesch-3mrvs1K0uXizZXS1Dc/lvw@public.gmane.org>
Cc: <stable-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>
Cc: Cyril Chemparathy <cyril-l0cyMroinI0@public.gmane.org>
---
drivers/net/ethernet/ti/davinci_mdio.c | 5 +++++
1 files changed, 5 insertions(+), 0 deletions(-)
diff --git a/drivers/net/ethernet/ti/davinci_mdio.c b/drivers/net/ethernet/ti/davinci_mdio.c
index 2757c7d..e4e4708 100644
--- a/drivers/net/ethernet/ti/davinci_mdio.c
+++ b/drivers/net/ethernet/ti/davinci_mdio.c
@@ -181,6 +181,11 @@ static inline int wait_for_user_access(struct davinci_mdio_data *data)
__davinci_mdio_reset(data);
return -EAGAIN;
}
+
+ reg = __raw_readl(®s->user[0].access);
+ if ((reg & USERACCESS_GO) == 0)
+ return 0;
+
dev_err(data->dev, "timed out waiting for user access\n");
return -ETIMEDOUT;
}
--
1.7.0.4
^ permalink raw reply related
* Re: [PATCH net-next] net: vxge: Add MODULE_FIRMWARE
From: Ben Hutchings @ 2012-04-16 14:29 UTC (permalink / raw)
To: tim.gardner; +Cc: linux-kernel, Jon Mason, netdev
In-Reply-To: <4F8C0EE1.7030901@canonical.com>
[-- Attachment #1: Type: text/plain, Size: 2919 bytes --]
On Mon, 2012-04-16 at 06:21 -0600, Tim Gardner wrote:
> On 04/15/2012 07:56 AM, Ben Hutchings wrote:
> > On Thu, 2012-04-12 at 14:34 -0600, Tim Gardner wrote:
> >> Cc: Jon Mason <jdmason@kudzu.us> Cc: netdev@vger.kernel.org
> >> Signed-off-by: Tim Gardner <tim.gardner@canonical.com> ---
> >> drivers/net/ethernet/neterion/vxge/vxge-main.c | 2 ++ 1 file
> >> changed, 2 insertions(+)
> >>
> >> diff --git a/drivers/net/ethernet/neterion/vxge/vxge-main.c
> >> b/drivers/net/ethernet/neterion/vxge/vxge-main.c index
> >> 51387c3..dcef72d 100644 ---
> >> a/drivers/net/ethernet/neterion/vxge/vxge-main.c +++
> >> b/drivers/net/ethernet/neterion/vxge/vxge-main.c @@ -4856,3
> >> +4856,5 @@ vxge_closer(void) } module_init(vxge_starter);
> >> module_exit(vxge_closer); +MODULE_FIRMWARE("vxge/X3fw-pxe.ncf");
> >> +MODULE_FIRMWARE("vxge/X3fw.ncf");
> >
> > I don't agree; these firmware files are updates for the flash and
> > only need to be loaded once.
> >
> > Also: this driver's behaviour of automatically updating flash
> > without any confirmation seems quite dangerous. The driver also
> > isn't usable after it performs such an update:
> >
> > printk(KERN_NOTICE "Upgrade of firmware successful! Adapter must
> > be " "hard reset before using, thus requiring a system reboot or a
> > " "hotplug event.\n");
> >
> > So what is the point of integrating firmware update into the driver
> > at all?
> >
> > Ben.
> >
>
> I guess I'm confused about use of the MODULE_FIRMWARE() macro. I
> thought it merely described the names of the firmware files that were
> actually used by the driver and had no run-time impact. Regardless of
> whether firmware files are used on every load, why _not_ describe them
> to modinfo ?
[...]
Ah, that's a good question. Quoting my own interpretation from
<1257629601.15927.361.camel@localhost>:
> Drivers that must load 'firmware' into the devices they drive should
> declare the names of the files they will request, using the
> MODULE_FIRMWARE() macro. This enables other tools to discover these
> dependencies statically, and warn the user if firmware files are
> missing.
In Debian we use this to decide which files need to be copied into an
initramfs. You use that too unless you've changed this feature of
initramfs-tools. We warn when building an initramfs and during a major
kernel upgrade if it looks like a driver will be used and the
corresponding firmware isn't installed.
I also have an (unfinished) patch that will use this information for
CONFIG_FIRMWARE_IN_KERNEL.
In this case the firmware files are used to upgrade old flash, but since
the vendor has closed down there aren't going to be any further updates.
So the likelihood of the files actually being needed by the driver is
very small.
Ben.
--
Ben Hutchings
This sentence contradicts itself - no actually it doesn't.
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 828 bytes --]
^ permalink raw reply
* Re: [PATCH 2/2] IPVS: make failure of netns init more stable
From: Julian Anastasov @ 2012-04-16 14:25 UTC (permalink / raw)
To: Hans Schillstrom; +Cc: horms, wensong, lvs-devel, netdev, netfilter-devel, hans
In-Reply-To: <1334576378-2034-2-git-send-email-hans.schillstrom@ericsson.com>
Hello,
On Mon, 16 Apr 2012, Hans Schillstrom wrote:
> Add a IP_VS_F_NET_INIT_OK flag
> that other modules can use for check of a successful init of ip_vs
>
> Signed-off-by: Hans Schillstrom <hans.schillstrom@ericsson.com>
> ---
> diff --git a/net/netfilter/ipvs/ip_vs_core.c b/net/netfilter/ipvs/ip_vs_core.c
> index b5a5c73..58722a2 100644
> --- a/net/netfilter/ipvs/ip_vs_core.c
> +++ b/net/netfilter/ipvs/ip_vs_core.c
> @@ -1881,7 +1881,7 @@ static int __net_init __ip_vs_init(struct net *net)
> return -ENOMEM;
>
> /* Hold the beast until a service is registerd */
> - ipvs->enable = 0;
> + ipvs->status = 0;
> ipvs->net = net;
> /* Counters used for creating unique names */
> ipvs->gen = atomic_read(&ipvs_netns_cnt);
> @@ -1906,6 +1906,7 @@ static int __net_init __ip_vs_init(struct net *net)
> if (ip_vs_sync_net_init(net) < 0)
> goto sync_fail;
>
> + IPVS_NETNS_OK(ipvs);
> printk(KERN_INFO "IPVS: Creating netns size=%zu id=%d\n",
> sizeof(struct netns_ipvs), ipvs->gen);
> return 0;
> @@ -1924,6 +1925,7 @@ protocol_fail:
> control_fail:
> ip_vs_estimator_net_cleanup(net);
> estimator_fail:
> + ipvs->status = 0; /* Nothing is enabled */
While 1st patch looks ok, keeping net->ipvs after
failure is not going to work. It seems you ignored the patch
I already posted. We duplicate the pointer in net->ipvs but
it should not be used after free.
Note that net_generic() and net->ipvs can not be
used after ops_exit/ops_free and failed ops_init.
But I see some inconsistency in net/core/net_namespace.c:
__register_pernet_operations when CONFIG_NET_NS is enabled
does not call ops_free after failed ops_init while when
CONFIG_NET_NS is not enabled ops_free is called. The
problem is that we leak the ops->size data allocated for the
failed net. I think, the fix should be ops_init to free the data.
The 2nd problem is that after ops_free the
net_generic pointer remains assigned in ptr[id-1], even
after being freed. Not sure if recent changes to net_generic()
can deal with freed data. This BUG_ON(!ptr) can not catch
problems if one subsys uses net_generic() for another
subsys that can be unregistered.
I'm going to test such fix for ops_init:
[PATCH] netns: do not leak net_generic data on failed init
ops_init should free the net_generic data on
init failure and __register_pernet_operations should not
call ops_free when NET_NS is not enabled.
Signed-off-by: Julian Anastasov <ja@ssi.bg>
---
net/core/net_namespace.c | 33 ++++++++++++++++++---------------
1 files changed, 18 insertions(+), 15 deletions(-)
diff --git a/net/core/net_namespace.c b/net/core/net_namespace.c
index 0e950fd..31a5ae5 100644
--- a/net/core/net_namespace.c
+++ b/net/core/net_namespace.c
@@ -83,21 +83,29 @@ assign:
static int ops_init(const struct pernet_operations *ops, struct net *net)
{
- int err;
+ int err = -ENOMEM;
+ void *data = NULL;
+
if (ops->id && ops->size) {
- void *data = kzalloc(ops->size, GFP_KERNEL);
+ data = kzalloc(ops->size, GFP_KERNEL);
if (!data)
- return -ENOMEM;
+ goto out;
err = net_assign_generic(net, *ops->id, data);
- if (err) {
- kfree(data);
- return err;
- }
+ if (err)
+ goto cleanup;
}
+ err = 0;
if (ops->init)
- return ops->init(net);
- return 0;
+ err = ops->init(net);
+ if (!err)
+ return 0;
+
+cleanup:
+ kfree(data);
+
+out:
+ return err;
}
static void ops_free(const struct pernet_operations *ops, struct net *net)
@@ -448,12 +456,7 @@ static void __unregister_pernet_operations(struct pernet_operations *ops)
static int __register_pernet_operations(struct list_head *list,
struct pernet_operations *ops)
{
- int err = 0;
- err = ops_init(ops, &init_net);
- if (err)
- ops_free(ops, &init_net);
- return err;
-
+ return ops_init(ops, &init_net);
}
static void __unregister_pernet_operations(struct pernet_operations *ops)
--
1.7.3.4
> diff --git a/net/netfilter/ipvs/ip_vs_ftp.c b/net/netfilter/ipvs/ip_vs_ftp.c
> index debb8c7..6bc2420 100644
> --- a/net/netfilter/ipvs/ip_vs_ftp.c
> +++ b/net/netfilter/ipvs/ip_vs_ftp.c
> @@ -439,6 +439,8 @@ static int __net_init __ip_vs_ftp_init(struct net *net)
> struct ip_vs_app *app;
> struct netns_ipvs *ipvs = net_ipvs(net);
>
> + if (!IS_IPVS_NETNS_OK(ipvs))
> + return -EUNATCH;
I already provided patch for ip_vs_ftp.
> app = kmemdup(&ip_vs_ftp, sizeof(struct ip_vs_app), GFP_KERNEL);
> if (!app)
> return -ENOMEM;
> diff --git a/net/netfilter/ipvs/ip_vs_lblc.c b/net/netfilter/ipvs/ip_vs_lblc.c
> index 27c24f1..f158f0c 100644
> --- a/net/netfilter/ipvs/ip_vs_lblc.c
> +++ b/net/netfilter/ipvs/ip_vs_lblc.c
> @@ -551,6 +551,9 @@ static int __net_init __ip_vs_lblc_init(struct net *net)
> {
> struct netns_ipvs *ipvs = net_ipvs(net);
>
> + if (!IS_IPVS_NETNS_OK(ipvs))
> + return -EUNATCH;
> +
As for LBLC* they need just net->ipvs != NULL
check because net_generic can not be trusted for
other subsys.
> if (!net_eq(net, &init_net)) {
> ipvs->lblc_ctl_table = kmemdup(vs_vars_table,
> sizeof(vs_vars_table),
> diff --git a/net/netfilter/ipvs/ip_vs_lblcr.c b/net/netfilter/ipvs/ip_vs_lblcr.c
> index 7498756..aeecda4 100644
> --- a/net/netfilter/ipvs/ip_vs_lblcr.c
> +++ b/net/netfilter/ipvs/ip_vs_lblcr.c
> @@ -745,6 +745,9 @@ static int __net_init __ip_vs_lblcr_init(struct net *net)
> {
> struct netns_ipvs *ipvs = net_ipvs(net);
>
> + if (!IS_IPVS_NETNS_OK(ipvs))
> + return -EUNATCH;
> +
> if (!net_eq(net, &init_net)) {
> ipvs->lblcr_ctl_table = kmemdup(vs_vars_table,
> sizeof(vs_vars_table),
> --
> 1.7.2.3
Regards
--
Julian Anastasov <ja@ssi.bg>
^ permalink raw reply related
* RE: [net 2/2] ixgbe: fix WoL issue with fiber
From: Skidmore, Donald C @ 2012-04-16 13:57 UTC (permalink / raw)
To: Jan Ceuleers, Kirsher, Jeffrey T
Cc: davem@davemloft.net, netdev@vger.kernel.org, gospo@redhat.com,
sassmann@redhat.com
In-Reply-To: <4F89C659.4080702@computer.org>
>-----Original Message-----
>From: Jan Ceuleers [mailto:jan.ceuleers@computer.org]
>Sent: Saturday, April 14, 2012 11:48 AM
>To: Kirsher, Jeffrey T
>Cc: davem@davemloft.net; Skidmore, Donald C; netdev@vger.kernel.org;
>gospo@redhat.com; sassmann@redhat.com
>Subject: Re: [net 2/2] ixgbe: fix WoL issue with fiber
>
>Jeff Kirsher wrote:
>> From: Don Skidmore<donald.c.skidmore@intel.com>
>>
>> There are times we turn of the laser before shutdown. This is a bad
>thing
>> if we want to wake on lan to work so now we make sure the laser is on
>> before shutdown if we support WoL.
>
>I'm ever-so-sorry if this is a silly question, but:
>
>WOL is receive-only, right? Why does the laser need to be on?
>
>Thanks, Jan
Without the laser on we can't get link and without link we can't get the magic packet to wake us up.
Thanks,
-Don Skidmore <donald.c.skidmore@intel.com>
^ permalink raw reply
* Re: [PATCH 08/11] nfs: disable data cache revalidation for swapfiles
From: Mel Gorman @ 2012-04-16 13:44 UTC (permalink / raw)
To: Fred Isaman
Cc: Andrew Morton, Linux-MM, Linux-Netdev, Linux-NFS, LKML,
David Miller, Trond Myklebust, Neil Brown, Christoph Hellwig,
Peter Zijlstra, Mike Christie, Eric B Munson
In-Reply-To: <CADnza444dTr=JEtqpL5wxHRNkEc7vBz1qq9TL7Z+5h749vNawg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
On Mon, Apr 16, 2012 at 09:10:04AM -0400, Fred Isaman wrote:
> > <SNIP>
> > -static struct nfs_page *nfs_page_find_request_locked(struct page *page)
> > +static struct nfs_page *
> > +nfs_page_find_request_locked(struct nfs_inode *nfsi, struct page *page)
> > {
> > struct nfs_page *req = NULL;
> >
> > - if (PagePrivate(page)) {
> > + if (PagePrivate(page))
> > req = (struct nfs_page *)page_private(page);
> > - if (req != NULL)
> > - kref_get(&req->wb_kref);
> > + else if (unlikely(PageSwapCache(page))) {
> > + struct nfs_page *freq, *t;
> > +
> > + /* Linearly search the commit list for the correct req */
> > + list_for_each_entry_safe(freq, t, &nfsi->commit_list, wb_list) {
> > + if (freq->wb_page == page) {
> > + req = freq;
> > + break;
> > + }
> > + }
> > +
> > + BUG_ON(req == NULL);
>
> I suspect I am missing something, but why is it guaranteed that the
> req is on the commit list?
>
It's a fair question and a statement about what I expected to happen.
The commit list replaces the nfs_page_tree radix tree that used to exist
and my understanding was that the req would exist in the radix tree until
the swap IO was completed. I expected it to be the same for the commit
list and the BUG_ON was based on that expectation. Are there cases where
the req would not be found?
Thanks.
--
Mel Gorman
SUSE Labs
--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply
* Re: [PATCH 6/6] vhost_net: don't poll on -EFAULT
From: Michael S. Tsirkin @ 2012-04-16 13:39 UTC (permalink / raw)
To: Jason Wang; +Cc: netdev, xma, davem, linux-kernel, ebiederm
In-Reply-To: <4F8BD81A.7010507@redhat.com>
On Mon, Apr 16, 2012 at 04:28:10PM +0800, Jason Wang wrote:
> On 04/16/2012 03:16 PM, Michael S. Tsirkin wrote:
> >On Mon, Apr 16, 2012 at 02:08:33PM +0800, Jason Wang wrote:
> >>Currently, we restart tx polling unconditionally when sendmsg()
> >>fails. This would cause unnecessary wakeups of vhost wokers as it's
> >>only needed when the socket send buffer were exceeded.
> >Why is this a problem?
>
> This issue is when guest driver is able to hit the -EFAULT, vhost
> discard the the descriptor and restart the polling. This would wake
> vhost thread and repeat the loop again which waste cpu.
Does same thing happen if we get an error from copy from user?
> Another possible solution is don't discard the descriptor.
> >
> >>Fix this by
> >>restart the tx polling only when sendmsg() returns value other than
> >>-EFAULT.
> >>
> >>Signed-off-by: Jason Wang<jasowang@redhat.com>
> >>---
> >> drivers/vhost/net.c | 3 ++-
> >> 1 files changed, 2 insertions(+), 1 deletions(-)
> >>
> >>diff --git a/drivers/vhost/net.c b/drivers/vhost/net.c
> >>index 29abd65..035fa95 100644
> >>--- a/drivers/vhost/net.c
> >>+++ b/drivers/vhost/net.c
> >>@@ -262,7 +262,8 @@ static void handle_tx(struct vhost_net *net)
> >> UIO_MAXIOV;
> >> }
> >> vhost_discard_vq_desc(vq, 1);
> >>- tx_poll_start(net, sock);
> >>+ if (err != -EFAULT)
> >>+ tx_poll_start(net, sock);
> >> break;
> >> }
> >> if (err != len)
> >--
> >To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> >the body of a message to majordomo@vger.kernel.org
> >More majordomo info at http://vger.kernel.org/majordomo-info.html
> >Please read the FAQ at http://www.tux.org/lkml/
^ permalink raw reply
* [PATCH] ipv6: clean up rt6_clean_expires
From: Jiri Bohac @ 2012-04-16 13:35 UTC (permalink / raw)
To: David Miller; +Cc: gaofeng, netdev
In-Reply-To: <20120413.125851.894792528374368454.davem@davemloft.net>
Functionally, this change is a NOP.
Semantically, rt6_clean_expires() wants to do rt->dst.from = NULL instead of
rt->dst.expires = 0. It is clearing the RTF_EXPIRES flag, so the union is going
to be treated as a pointer (dst.from) not a long (dst.expires).
Signed-off-by: Jiri Bohac <jbohac@suse.cz>
diff --git a/include/net/ip6_fib.h b/include/net/ip6_fib.h
index c64778f..ad4126f 100644
--- a/include/net/ip6_fib.h
+++ b/include/net/ip6_fib.h
@@ -129,7 +129,7 @@ static inline void rt6_clean_expires(struct rt6_info *rt)
dst_release(rt->dst.from);
rt->rt6i_flags &= ~RTF_EXPIRES;
- rt->dst.expires = 0;
+ rt->dst.from = NULL;
}
static inline void rt6_set_expires(struct rt6_info *rt, unsigned long expires)
--
Jiri Bohac <jbohac@suse.cz>
SUSE Labs, SUSE CZ
^ permalink raw reply related
* [PATCH] ipv6: fix rt6_update_expires
From: Jiri Bohac @ 2012-04-16 13:34 UTC (permalink / raw)
To: David Miller; +Cc: gaofeng, netdev
In-Reply-To: <20120413.125851.894792528374368454.davem@davemloft.net>
Commit 1716a961 (ipv6: fix problem with expired dst cache) broke PMTU
discovery. rt6_update_expires() calls dst_set_expires(), which only updates
dst->expires if it has not been set previously (expires == 0) or if the new
expires is earlier than the current dst->expires.
rt6_update_expires() needs to zero rt->dst.expires, otherwise it will contain
ivalid data left over from rt->dst.from and will confuse dst_set_expires().
Signed-off-by: Jiri Bohac <jbohac@suse.cz>
diff --git a/include/net/ip6_fib.h b/include/net/ip6_fib.h
index ad4126f..68c1f94 100644
--- a/include/net/ip6_fib.h
+++ b/include/net/ip6_fib.h
@@ -143,8 +143,13 @@ static inline void rt6_set_expires(struct rt6_info *rt, unsigned long expires)
static inline void rt6_update_expires(struct rt6_info *rt, int timeout)
{
- if (!(rt->rt6i_flags & RTF_EXPIRES) && rt->dst.from)
- dst_release(rt->dst.from);
+ if (!(rt->rt6i_flags & RTF_EXPIRES)) {
+ if (rt->dst.from)
+ dst_release(rt->dst.from);
+ /* dst_set_expires relies on expires == 0
+ if it has not been set previously */
+ rt->dst.expires = 0;
+ }
dst_set_expires(&rt->dst, timeout);
rt->rt6i_flags |= RTF_EXPIRES;
--
Jiri Bohac <jbohac@suse.cz>
SUSE Labs, SUSE CZ
^ permalink raw reply related
* Re: [PATCH 5/6] vhost_net: fix use after free of vq->ubufs
From: Michael S. Tsirkin @ 2012-04-16 13:28 UTC (permalink / raw)
To: Jason Wang; +Cc: netdev, xma, davem, linux-kernel, ebiederm
In-Reply-To: <20120416060825.14140.32069.stgit@intel-e5620-16-2.englab.nay.redhat.com>
On Mon, Apr 16, 2012 at 02:08:25PM +0800, Jason Wang wrote:
> When zerocopy socket is used, ubufs pointer were used in handle_tx()
> without any validation. This would cause NULL pointer deference after
> it has been freed in vhost_net_set_backend(). Fix this by check the
> pointer before using it.
>
> Signed-off-by: Jason Wang <jasowang@redhat.com>
OK so it's NULL dereference and not user after free :)
Also could you clarify how does this happen pls?
Don't we always initialize ubufs when vhost_sock_zcopy is set?
> ---
> drivers/vhost/net.c | 7 ++++++-
> 1 files changed, 6 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/vhost/net.c b/drivers/vhost/net.c
> index f0da2c3..29abd65 100644
> --- a/drivers/vhost/net.c
> +++ b/drivers/vhost/net.c
> @@ -163,10 +163,15 @@ static void handle_tx(struct vhost_net *net)
> mutex_lock(&vq->mutex);
> vhost_disable_notify(&net->dev, vq);
>
> + zcopy = vhost_sock_zcopy(sock);
> + if (zcopy && !vq->ubufs) {
> + mutex_unlock(&vq->mutex);
> + return;
> + }
> +
> if (wmem < sock->sk->sk_sndbuf / 2)
> tx_poll_stop(net);
> hdr_size = vq->vhost_hlen;
> - zcopy = vhost_sock_zcopy(sock);
>
> for (;;) {
> /* Release DMAs done buffers first */
^ permalink raw reply
* Re: [PATCH 2/6] macvtap: zerocopy: fix truesize underestimation
From: Michael S. Tsirkin @ 2012-04-16 13:25 UTC (permalink / raw)
To: Eric Dumazet; +Cc: Jason Wang, netdev, xma, davem, linux-kernel, ebiederm
In-Reply-To: <1334566193.28012.66.camel@edumazet-glaptop>
On Mon, Apr 16, 2012 at 10:49:53AM +0200, Eric Dumazet wrote:
> On Mon, 2012-04-16 at 10:14 +0300, Michael S. Tsirkin wrote:
> > On Mon, Apr 16, 2012 at 02:07:59PM +0800, Jason Wang wrote:
> > > As the skb fragment were pinned/built from user pages, we should
> > > account the page instead of length for truesize.
> > >
> > > Signed-off-by: Jason Wang <jasowang@redhat.com>
> >
> > I'm not sure this is right: the skb does *not* consume the
> > whole page, userspace uses the rest of the page
> > for other skbs. So we'll end up accounting for the
> > same page twice.
> > Eric, what's the right thing to do here in your opinion?
>
> Problem is we dont know for sure userspace wont free pages right after
> this syscall. So an evil application could consume more kernel memory
> than what socket limit allowed.
>
> Its same problem with vmsplice(mem -> pipe) + splice(pipe -> socket)
>
> When we clone skb with frags, resulting skb will have same truesize,
> even if the pages are shared ...
>
I see, thanks for the clarification.
--
MST
^ permalink raw reply
* [PATCH v2] net_sched: red: Make minor corrections to comments
From: David Ward @ 2012-04-16 13:17 UTC (permalink / raw)
To: netdev; +Cc: David Ward
In-Reply-To: <4F8C193A.5090806@ll.mit.edu>
Signed-off-by: David Ward <david.ward@ll.mit.edu>
---
include/net/red.h | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/include/net/red.h b/include/net/red.h
index 77d4c37..ef46058 100644
--- a/include/net/red.h
+++ b/include/net/red.h
@@ -245,7 +245,7 @@ static inline unsigned long red_calc_qavg_from_idle_time(const struct red_parms
*
* dummy packets as a burst after idle time, i.e.
*
- * p->qavg *= (1-W)^m
+ * v->qavg *= (1-W)^m
*
* This is an apparently overcomplicated solution (f.e. we have to
* precompute a table to make this calculation in reasonable time)
@@ -279,7 +279,7 @@ static inline unsigned long red_calc_qavg_no_idle_time(const struct red_parms *p
unsigned int backlog)
{
/*
- * NOTE: p->qavg is fixed point number with point at Wlog.
+ * NOTE: v->qavg is fixed point number with point at Wlog.
* The formula below is equvalent to floating point
* version:
*
@@ -390,7 +390,7 @@ static inline void red_adaptative_algo(struct red_parms *p, struct red_vars *v)
if (red_is_idling(v))
qavg = red_calc_qavg_from_idle_time(p, v);
- /* p->qavg is fixed point number with point at Wlog */
+ /* v->qavg is fixed point number with point at Wlog */
qavg >>= p->Wlog;
if (qavg > p->target_max && p->max_P <= MAX_P_MAX)
--
1.7.1
^ permalink raw reply related
* Re: [PATCH 08/11] nfs: disable data cache revalidation for swapfiles
From: Fred Isaman @ 2012-04-16 13:10 UTC (permalink / raw)
To: Mel Gorman
Cc: Andrew Morton, Linux-MM, Linux-Netdev, Linux-NFS, LKML,
David Miller, Trond Myklebust, Neil Brown, Christoph Hellwig,
Peter Zijlstra, Mike Christie, Eric B Munson
In-Reply-To: <1334578675-23445-9-git-send-email-mgorman@suse.de>
On Mon, Apr 16, 2012 at 8:17 AM, Mel Gorman <mgorman@suse.de> wrote:
> The VM does not like PG_private set on PG_swapcache pages. As suggested
> by Trond in http://lkml.org/lkml/2006/8/25/348, this patch disables
> NFS data cache revalidation on swap files. as it does not make
> sense to have other clients change the file while it is being used as
> swap. This avoids setting PG_private on swap pages, since there ought
> to be no further races with invalidate_inode_pages2() to deal with.
>
> Since we cannot set PG_private we cannot use page->private which
> is already used by PG_swapcache pages to store the nfs_page. Thus
> augment the new nfs_page_find_request logic.
>
> Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
> Signed-off-by: Mel Gorman <mgorman@suse.de>
> ---
> fs/nfs/inode.c | 6 ++++++
> fs/nfs/write.c | 51 +++++++++++++++++++++++++++++++++++++--------------
> 2 files changed, 43 insertions(+), 14 deletions(-)
>
> diff --git a/fs/nfs/inode.c b/fs/nfs/inode.c
> index e8bbfa5..af43ef6 100644
> --- a/fs/nfs/inode.c
> +++ b/fs/nfs/inode.c
> @@ -880,6 +880,12 @@ int nfs_revalidate_mapping(struct inode *inode, struct address_space *mapping)
> struct nfs_inode *nfsi = NFS_I(inode);
> int ret = 0;
>
> + /*
> + * swapfiles are not supposed to be shared.
> + */
> + if (IS_SWAPFILE(inode))
> + goto out;
> +
> if ((nfsi->cache_validity & NFS_INO_REVAL_PAGECACHE)
> || nfs_attribute_cache_expired(inode)
> || NFS_STALE(inode)) {
> diff --git a/fs/nfs/write.c b/fs/nfs/write.c
> index 6a891eb..eea4ec0 100644
> --- a/fs/nfs/write.c
> +++ b/fs/nfs/write.c
> @@ -111,15 +111,30 @@ static void nfs_context_set_write_error(struct nfs_open_context *ctx, int error)
> set_bit(NFS_CONTEXT_ERROR_WRITE, &ctx->flags);
> }
>
> -static struct nfs_page *nfs_page_find_request_locked(struct page *page)
> +static struct nfs_page *
> +nfs_page_find_request_locked(struct nfs_inode *nfsi, struct page *page)
> {
> struct nfs_page *req = NULL;
>
> - if (PagePrivate(page)) {
> + if (PagePrivate(page))
> req = (struct nfs_page *)page_private(page);
> - if (req != NULL)
> - kref_get(&req->wb_kref);
> + else if (unlikely(PageSwapCache(page))) {
> + struct nfs_page *freq, *t;
> +
> + /* Linearly search the commit list for the correct req */
> + list_for_each_entry_safe(freq, t, &nfsi->commit_list, wb_list) {
> + if (freq->wb_page == page) {
> + req = freq;
> + break;
> + }
> + }
> +
> + BUG_ON(req == NULL);
I suspect I am missing something, but why is it guaranteed that the
req is on the commit list?
Fred
> }
> +
> + if (req)
> + kref_get(&req->wb_kref);
> +
> return req;
> }
>
> @@ -129,7 +144,7 @@ static struct nfs_page *nfs_page_find_request(struct page *page)
> struct nfs_page *req = NULL;
>
> spin_lock(&inode->i_lock);
> - req = nfs_page_find_request_locked(page);
> + req = nfs_page_find_request_locked(NFS_I(inode), page);
> spin_unlock(&inode->i_lock);
> return req;
> }
> @@ -232,7 +247,7 @@ static struct nfs_page *nfs_find_and_lock_request(struct page *page, bool nonblo
>
> spin_lock(&inode->i_lock);
> for (;;) {
> - req = nfs_page_find_request_locked(page);
> + req = nfs_page_find_request_locked(NFS_I(inode), page);
> if (req == NULL)
> break;
> if (nfs_lock_request_dontget(req))
> @@ -385,9 +400,15 @@ static void nfs_inode_add_request(struct inode *inode, struct nfs_page *req)
> spin_lock(&inode->i_lock);
> if (!nfsi->npages && nfs_have_delegation(inode, FMODE_WRITE))
> inode->i_version++;
> - set_bit(PG_MAPPED, &req->wb_flags);
> - SetPagePrivate(req->wb_page);
> - set_page_private(req->wb_page, (unsigned long)req);
> + /*
> + * Swap-space should not get truncated. Hence no need to plug the race
> + * with invalidate/truncate.
> + */
> + if (likely(!PageSwapCache(req->wb_page))) {
> + set_bit(PG_MAPPED, &req->wb_flags);
> + SetPagePrivate(req->wb_page);
> + set_page_private(req->wb_page, (unsigned long)req);
> + }
> nfsi->npages++;
> kref_get(&req->wb_kref);
> spin_unlock(&inode->i_lock);
> @@ -404,9 +425,11 @@ static void nfs_inode_remove_request(struct nfs_page *req)
> BUG_ON (!NFS_WBACK_BUSY(req));
>
> spin_lock(&inode->i_lock);
> - set_page_private(req->wb_page, 0);
> - ClearPagePrivate(req->wb_page);
> - clear_bit(PG_MAPPED, &req->wb_flags);
> + if (likely(!PageSwapCache(req->wb_page))) {
> + set_page_private(req->wb_page, 0);
> + ClearPagePrivate(req->wb_page);
> + clear_bit(PG_MAPPED, &req->wb_flags);
> + }
> nfsi->npages--;
> spin_unlock(&inode->i_lock);
> nfs_release_request(req);
> @@ -646,7 +669,7 @@ static struct nfs_page *nfs_try_to_update_request(struct inode *inode,
> spin_lock(&inode->i_lock);
>
> for (;;) {
> - req = nfs_page_find_request_locked(page);
> + req = nfs_page_find_request_locked(NFS_I(inode), page);
> if (req == NULL)
> goto out_unlock;
>
> @@ -1690,7 +1713,7 @@ int nfs_wb_page_cancel(struct inode *inode, struct page *page)
> */
> int nfs_wb_page(struct inode *inode, struct page *page)
> {
> - loff_t range_start = page_offset(page);
> + loff_t range_start = page_file_offset(page);
> loff_t range_end = range_start + (loff_t)(PAGE_CACHE_SIZE - 1);
> struct writeback_control wbc = {
> .sync_mode = WB_SYNC_ALL,
> --
> 1.7.9.2
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply
* Re: [PATCH] net_sched: red: Make minor corrections to comments
From: Ward, David - 0663 - MITLL @ 2012-04-16 13:06 UTC (permalink / raw)
To: netdev@vger.kernel.org
In-Reply-To: <1334529106-5035-2-git-send-email-david.ward@ll.mit.edu>
On 04/15/2012 06:31 PM, Ward, David - 0663 - MITLL wrote:
> diff --git a/include/net/red.h b/include/net/red.h
> index 77d4c37..c0bc25e 100644
> --- a/include/net/red.h
> +++ b/include/net/red.h
> @@ -28,7 +28,7 @@
> the inertia of the algorithm. To allow larger bursts, W should be
> decreased.
>
> - if (avg> th_max) -> packet marked (dropped).
> + if (avg> th_max) -> packet marked (dropped) with probability max_P.
> if (avg< th_min) -> packet passes.
> if (th_min< avg< th_max) we calculate probability:
>
Sorry, this line was correct as it was. (Misleading man page tc-red(8)
says "Because probability is normally not set to 100%, the queue size
might conceivably rise above max bytes")
Re-sending with just the other changes (and a patch for that man page).
^ permalink raw reply
* Re: [PATCH] net/ipv4:Remove two reports using kmemleak
From: Eric Dumazet @ 2012-04-16 12:41 UTC (permalink / raw)
To: majianpeng; +Cc: davem, netdev
In-Reply-To: <201204161940178124485@gmail.com>
On Mon, 2012-04-16 at 19:40 +0800, majianpeng wrote:
> From 8eb7c077dd3e746476a2a9fe059a676a6bc1a61f Mon Sep 17 00:00:00 2001
> From: majianpeng <majianpeng@gmail.com>
> Date: Mon, 16 Apr 2012 19:34:50 +0800
> Subject: [PATCH] net/ipv4:Remove two reports using kmemleak. Although those
> two reports do not real kmemleak,I think can remove it better.
>
> Reported by kmemleak:
> unreferenced object 0xffff8800b8735090 (size 96):
> comm "swapper/0", pid 1, jiffies 4294670057 (age 542.870s)
> hex dump (first 32 bytes):
> 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
> 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
> backtrace:
> [<ffffffff81695df1>] kmemleak_alloc+0x21/0x50
> [<ffffffff81117c3b>] __kmalloc+0x11b/0x1f0
> [<ffffffff81188f57>] __register_sysctl_paths+0x127/0x1f0
> [<ffffffff81189036>] register_sysctl_paths+0x16/0x20
> [<ffffffff81cf1fc7>] ip_static_sysctl_init+0x17/0x19
> [<ffffffff81cf2924>] inet_init+0xb4/0x2b2
> [<ffffffff810001ca>] do_one_initcall+0x3a/0x160
> [<ffffffff81cb9c7e>] kernel_init+0x12e/0x1b2
> [<ffffffff816bdb94>] kernel_thread_helper+0x4/0x10
> [<ffffffffffffffff>] 0xffffffffffffffff
> unreferenced object 0xffff8800b8735730 (size 96):
> comm "swapper/0", pid 1, jiffies 4294670057 (age 542.870s)
> hex dump (first 32 bytes):
> 80 80 e3 81 ff ff ff ff 00 00 00 00 01 00 00 00 ................
> 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
> backtrace:
> [<ffffffff81695df1>] kmemleak_alloc+0x21/0x50
> [<ffffffff81117c3b>] __kmalloc+0x11b/0x1f0
> [<ffffffff81188792>] __register_sysctl_table+0x62/0x4b0
> [<ffffffff81188da5>] register_leaf_sysctl_tables+0x1c5/0x230
> [<ffffffff81188ca0>] register_leaf_sysctl_tables+0xc0/0x230
> [<ffffffff81188f89>] __register_sysctl_paths+0x159/0x1f0
> [<ffffffff81189036>] register_sysctl_paths+0x16/0x20
> [<ffffffff81cf1fc7>] ip_static_sysctl_init+0x17/0x19
> [<ffffffff81cf2924>] inet_init+0xb4/0x2b2
> [<ffffffff810001ca>] do_one_initcall+0x3a/0x160
> [<ffffffff81cb9c7e>] kernel_init+0x12e/0x1b2
> [<ffffffff816bdb94>] kernel_thread_helper+0x4/0x10
> [<ffffffffffffffff>] 0xffffffffffffffff
>
>
> Signed-off-by: majianpeng <majianpeng@gmail.com>
> ---
> net/ipv4/route.c | 3 ++-
> 1 files changed, 2 insertions(+), 1 deletions(-)
>
> diff --git a/net/ipv4/route.c b/net/ipv4/route.c
> index 167ea10..817207b 100644
> --- a/net/ipv4/route.c
> +++ b/net/ipv4/route.c
> @@ -3499,12 +3499,13 @@ int __init ip_rt_init(void)
> }
>
> #ifdef CONFIG_SYSCTL
> +static struct ctl_table_header *sysctl_header;
> /*
> * We really need to sanitize the damn ipv4 init order, then all
> * this nonsense will go away.
> */
> void __init ip_static_sysctl_init(void)
> {
> - register_sysctl_paths(ipv4_path, ipv4_skeleton);
> + sysctl_header = register_sysctl_paths(ipv4_path, ipv4_skeleton);
> }
> #endif
I dont think so.
Please check kmemleak_not_leak()
^ permalink raw reply
* Re: [PATCH net-next] net: vxge: Add MODULE_FIRMWARE
From: Tim Gardner @ 2012-04-16 12:21 UTC (permalink / raw)
To: Ben Hutchings; +Cc: Tim Gardner, linux-kernel, Jon Mason, netdev
In-Reply-To: <1334498215.3209.4.camel@deadeye>
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512
On 04/15/2012 07:56 AM, Ben Hutchings wrote:
> On Thu, 2012-04-12 at 14:34 -0600, Tim Gardner wrote:
>> Cc: Jon Mason <jdmason@kudzu.us> Cc: netdev@vger.kernel.org
>> Signed-off-by: Tim Gardner <tim.gardner@canonical.com> ---
>> drivers/net/ethernet/neterion/vxge/vxge-main.c | 2 ++ 1 file
>> changed, 2 insertions(+)
>>
>> diff --git a/drivers/net/ethernet/neterion/vxge/vxge-main.c
>> b/drivers/net/ethernet/neterion/vxge/vxge-main.c index
>> 51387c3..dcef72d 100644 ---
>> a/drivers/net/ethernet/neterion/vxge/vxge-main.c +++
>> b/drivers/net/ethernet/neterion/vxge/vxge-main.c @@ -4856,3
>> +4856,5 @@ vxge_closer(void) } module_init(vxge_starter);
>> module_exit(vxge_closer); +MODULE_FIRMWARE("vxge/X3fw-pxe.ncf");
>> +MODULE_FIRMWARE("vxge/X3fw.ncf");
>
> I don't agree; these firmware files are updates for the flash and
> only need to be loaded once.
>
> Also: this driver's behaviour of automatically updating flash
> without any confirmation seems quite dangerous. The driver also
> isn't usable after it performs such an update:
>
> printk(KERN_NOTICE "Upgrade of firmware successful! Adapter must
> be " "hard reset before using, thus requiring a system reboot or a
> " "hotplug event.\n");
>
> So what is the point of integrating firmware update into the driver
> at all?
>
> Ben.
>
I guess I'm confused about use of the MODULE_FIRMWARE() macro. I
thought it merely described the names of the firmware files that were
actually used by the driver and had no run-time impact. Regardless of
whether firmware files are used on every load, why _not_ describe them
to modinfo ?
I'm auditing the Ubuntu linux-firmware package to reduce size by
removing obsolete firmware files. Along the way I'm also trying to
update the drivers that have caught my attention in their use of
MODULE_FIRMWARE.
rtg
- --
Tim Gardner tim.gardner@canonical.com
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
iQIcBAEBCgAGBQJPjA7cAAoJED12yEX6FEfKqWEQAJHHf/g0yuJg5eJ7XSdCJWbV
6xs5NNj3Wwo2bN578PnwK28grBFT6atDg6Y0KkcMgZ/NCc7Q8GN/7yJaK+VcW6wQ
395JNYf67bFx+6B+MDVj2qPHa/2EJjYGjZlxMzPPIKUqYOzHt18A779Tb5DLWelj
B1DAJJcTDVF1jyAEB/4zCDq1R39jARWGDzC11OqrQqEmBqbE2z5CgLeDECR0uDsg
axyIW4Mc+nSF1SrrmvdtXfHzDPN+wpXVoGTjb83iqBLWSkKo8QYQDQLnc67mZgAa
lT+ZdFIfAY8vE/PmfokX+xkCc7Dk1B36fIuwWEIRM4QUgFp0skXHUyr8n3xDRLiD
+Kcb3IMIIprzlPi7zpEwB0ulubyjKdh8+dCwlHZVLmRt/QgXUyLCQJG6vqg6WlBO
T53xZ24JcwmdSASYDMTxWmEc3ERq33b1uKPfrUGTLENdyt4F5yU1KT0HXmkJ8Chq
/wQLX9fAC3janMKJP4fdQvox/WBAihZ4wIBNUKnCYl01XXCDvy0FnOtxk3ZGPHzv
g1tS8U2pJUuktX74U1p4ltrKQXhW3z4Oro5BdLTqNunlXDqmT0kiBVkLbJmDNzwK
mL7tlcx8Nn28WRYUM+MW7J1C0+tVRaVMtF8dW1ICduhzzPy5KSarI23SFlExoQ5s
Kn56ELI/wV/ajx+z2pTk
=mobO
-----END PGP SIGNATURE-----
^ permalink raw reply
* Re: [PATCH] arcnet: rimi: Fix device name in debug output
From: Steven Young @ 2012-04-16 12:20 UTC (permalink / raw)
To: Jiri Kosina; +Cc: linux-kernel, David S. Miller, netdev
In-Reply-To: <alpine.LNX.2.00.1204161335420.16373@pobox.suse.cz>
On Mon, Apr 16, 2012 at 02:02:48PM +0200, Jiri Kosina wrote:
> I propose the minimalistic fix instead ... it'd be better to just drop the
> BUGMSG() thing altogether and convert it to dev_printk(), but that'd be
> larger revamp of the driver, and such effort is questionable for something
> like Arcnet :)
You're right, I'm not really interested in spending any amount of time on
ARCnet. It's just something I noticed when I was booting a poorly-configured
kernel and thought I'd try a drive-by fix. :)
Thanks for your time,
Steve.
^ permalink raw reply
* [PATCH 11/11] Avoid dereferencing bd_disk during swap_entry_free for network storage
From: Mel Gorman @ 2012-04-16 12:17 UTC (permalink / raw)
To: Andrew Morton
Cc: Linux-MM, Linux-Netdev, Linux-NFS, LKML, David Miller,
Trond Myklebust, Neil Brown, Christoph Hellwig, Peter Zijlstra,
Mike Christie, Eric B Munson, Mel Gorman
In-Reply-To: <1334578675-23445-1-git-send-email-mgorman@suse.de>
Commit [b3a27d: swap: Add swap slot free callback to
block_device_operations] dereferences p->bdev->bd_disk but this is a
NULL dereference if using swap-over-NFS. This patch checks SWP_BLKDEV
on the swap_info_struct before dereferencing.
With reference to this callback, Christoph Hellwig stated "Please
just remove the callback entirely. It has no user outside the staging
tree and was added clearly against the rules for that staging tree".
This would also be my preference but there was not an obvious way of
keeping zram in staging/ happy.
Signed-off-by: Xiaotian Feng <dfeng@redhat.com>
Signed-off-by: Mel Gorman <mgorman@suse.de>
---
mm/swapfile.c | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/mm/swapfile.c b/mm/swapfile.c
index 80b3415..d85d842 100644
--- a/mm/swapfile.c
+++ b/mm/swapfile.c
@@ -547,7 +547,6 @@ static unsigned char swap_entry_free(struct swap_info_struct *p,
/* free if no reference */
if (!usage) {
- struct gendisk *disk = p->bdev->bd_disk;
if (offset < p->lowest_bit)
p->lowest_bit = offset;
if (offset > p->highest_bit)
@@ -557,9 +556,11 @@ static unsigned char swap_entry_free(struct swap_info_struct *p,
swap_list.next = p->type;
nr_swap_pages++;
p->inuse_pages--;
- if ((p->flags & SWP_BLKDEV) &&
- disk->fops->swap_slot_free_notify)
- disk->fops->swap_slot_free_notify(p->bdev, offset);
+ if (p->flags & SWP_BLKDEV) {
+ struct gendisk *disk = p->bdev->bd_disk;
+ if (disk->fops->swap_slot_free_notify)
+ disk->fops->swap_slot_free_notify(p->bdev, offset);
+ }
}
return usage;
--
1.7.9.2
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply related
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox