* Re: [PATCH] ipsec: allow to align IPv4 AH on 32 bits
From: David Miller @ 2011-02-08 22:00 UTC (permalink / raw)
To: nicolas.dichtel; +Cc: herbert, netdev, christophe.gouault
In-Reply-To: <4D49864E.8020002@6wind.com>
From: Nicolas Dichtel <nicolas.dichtel@6wind.com>
Date: Wed, 02 Feb 2011 17:29:02 +0100
> On 28/01/2011 20:46, David Miller wrote:
>> From: Nicolas Dichtel<nicolas.dichtel@6wind.com>
>> Date: Fri, 28 Jan 2011 09:51:40 +0100
>>
>>> On 28/01/2011 05:51, Herbert Xu wrote:
>>>> So perhaps an SA configuration flag is needed?
>>> I agree. If David is ok, I will update the patch.
>>
>> Sounds good to me.
>
> Here is the new patch.
I've applied this to net-next-2.6, thanks.
^ permalink raw reply
* Re: [PATCH 0/2] CDC NCM errata updates
From: David Miller @ 2011-02-08 21:53 UTC (permalink / raw)
To: alexey.orishko-0IS4wlFg1OjSUeElwK9/Pw
Cc: netdev-u79uwXL29TY76Z2rM5mHXA, linux-usb-u79uwXL29TY76Z2rM5mHXA,
gregkh-l3A5Bk7waGM, yauheni.kaliuta-xNZwKgViW5gAvxtiuMwx3w
In-Reply-To: <2AC7D4AD8BA1C640B4C60C61C8E520153BB643596B-8ZTw5gFVCTjVH5byLeRTJxkTb7+GphCuwzqs5ZKRSiY@public.gmane.org>
From: Alexey ORISHKO <alexey.orishko-0IS4wlFg1OjSUeElwK9/Pw@public.gmane.org>
Date: Tue, 8 Feb 2011 18:44:13 +0100
> Both patches can be applied to net-2.6 and net-next.
> [PATCH 1/2] CDC NCM errata updates for cdc.h
> [PATCH 2/2] USB CDC NCM errata updates for cdc_ncm host driver
>
> I don't know if the merge window is closed or not, but it would be
> *really* good to get this patches merged to 2.6.38-rc branch due to
> bug fixes included.
I'll apply them to net-2.6, thanks.
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" 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: pull request: wireless-next-2.6 2011-02-08
From: David Miller @ 2011-02-08 21:53 UTC (permalink / raw)
To: linville; +Cc: linux-wireless, netdev
In-Reply-To: <20110208204139.GC6244@tuxdriver.com>
From: "John W. Linville" <linville@tuxdriver.com>
Date: Tue, 8 Feb 2011 15:41:39 -0500
> Here is the latest round of wireless bits intended for 2.6.39.
> This is mostly driver updates (as usual), including a flurry of
> wl1251 patches from David Gnedt. ath5k, ath9k, and iwlwifi are
> well represented, of course. Interestingly, this batch includes a
> number of mac80211 patches -- most of them _not_ from Johannes Berg!
> I doubt if that holds for long... :-) And, zd1211rw grows AP support.
> Also, this includes a wireless-2.6 pull to resolve some merge conflicts.
>
> Please let me know if there are problems!
Pulled, thanks a lot John.
^ permalink raw reply
* Re: [net-2.6][2.6.38-rc2] panic during stress testing
From: David Miller @ 2011-02-08 21:51 UTC (permalink / raw)
To: jesse.brandeburg; +Cc: netdev, jeffrey.e.pieper
In-Reply-To: <1297189925.4087.8.camel@jbrandeb-mobl2>
From: Jesse Brandeburg <jesse.brandeburg@intel.com>
Date: Tue, 08 Feb 2011 10:32:05 -0800
> We are currently testing patches and ran into this panic, doesn't
> immediately seem related to the driver.
>
> During TCP/UDP ipv4/6 stress testing on 82574L, 2.6.38-rc2 x86_64
> (net-2.6 with e1000e patches under test) gets numerous OOM killer
> messages, followed by a bug/Oops and panic. could not reproduce the
> bug/panic on 2.6.37, but the OOM killer messages are still seen.
>
> Could well be related somehow to testing with DEBUG_PAGEALLOC enabled.
>
> panic dump and .config follows:
>
> BUG: unable to handle kernel paging request at ffffffff81089738
> IP: [<ffffffff812e2139>] dst_destroy+0x4b/0xf3
> PGD 1695067 PUD 1699063 PMD 10001e1
> Oops: 0003 [#1] PREEMPT SMP DEBUG_PAGEALLOC
> last sysfs file: /sys/devices/system/cpu/cpu3/cache/index2/shared_cpu_map
> CPU 1
> Modules linked in: nfsd exportfs lockd sunrpc dca e1000e [last unloaded: igb]
So some piece of freed memory is being referenced in dst_destroy(), can you
match dst_destroy+0x4b to a line in that function for your build?
You should always do this when submitting a trace like this.
Thanks.
^ permalink raw reply
* Re: [Bugme-new] [Bug 28282] New: forwarding turns autoconfiguration off
From: David Miller @ 2011-02-08 21:44 UTC (permalink / raw)
To: akpm; +Cc: netdev, bugzilla-daemon, bugme-daemon, hadmut
In-Reply-To: <20110208133408.7d447e6a.akpm@linux-foundation.org>
From: Andrew Morton <akpm@linux-foundation.org>
Date: Tue, 8 Feb 2011 13:34:08 -0800
>> Linux ethernet interfaces do not use autoconfiguration and do ignore router
>> advertisings if the packet forwarding is turned on in the configuration (i.e.
>> /proc/sys/net/ipv6/conf/eth0/forwarding set to 1)
>>
>>
>> This might be wrong.
>>
>> IPv6 network devices can have multiple IPv6 addresses and server several
>> purposes at the same time. A machine can have a statically assigned local IPv6
>> address and act as a router (e.g. to a virtual machine or a VPN tunnel) and
>> thus needs to turn forwarding on, while at the same time it needs to listen to
>> router advertisements and autoconfigure, e.g. because a network is connected to
>> the internet through a DSL router with dynamically assigned network adresses,
>> either through direct IPv6 assignment or a 6to4 tunnel.
>>
>> So there are cases where you need to have autoconfiguration of an IP address
>> and forwarding on the same interface at the same time. Therefore, it might be
>> technically wrong to have this mutually exclusive.
This is a case where we're probably just following what the RFC documents
state we should do, which means unless you can provide clear reference to
a specification that states we should behave otherwise this isn't changing.
^ permalink raw reply
* Re: Trouble Shooting ipsec
From: Neil Horman @ 2011-02-08 21:37 UTC (permalink / raw)
To: David Miller; +Cc: sclark46, netdev
In-Reply-To: <20110208.113708.226773767.davem@davemloft.net>
On Tue, Feb 08, 2011 at 11:37:08AM -0800, David Miller wrote:
> From: Stephen Clark <sclark46@earthlink.net>
> Date: Tue, 08 Feb 2011 14:33:17 -0500
>
> > I'll continue investigating. It just so frustrating when the ipsec
> > packets just get dropped and you have no idea why. I wish there were
> > some hooks in the kernel so you could at least get some debug
> > information about what is happening.
>
> There is a tracepoint (which you can monitor using perf) which tracks
> all packet drops.
>
+1, you can also use dropwatch to monitor that tracepoint if the drop volume is
high.
Neil
^ permalink raw reply
* Re: [Bugme-new] [Bug 28282] New: forwarding turns autoconfiguration off
From: Andrew Morton @ 2011-02-08 21:34 UTC (permalink / raw)
To: netdev; +Cc: bugzilla-daemon, bugme-daemon, hadmut
In-Reply-To: <bug-28282-10286@https.bugzilla.kernel.org/>
(switched to email. Please respond via emailed reply-to-all, not via the
bugzilla web interface).
On Sat, 5 Feb 2011 18:06:31 GMT
bugzilla-daemon@bugzilla.kernel.org wrote:
> https://bugzilla.kernel.org/show_bug.cgi?id=28282
>
> Summary: forwarding turns autoconfiguration off
> Product: Networking
> Version: 2.5
> Kernel Version: 2.6.35
> Platform: All
> OS/Version: Linux
> Tree: Mainline
> Status: NEW
> Severity: normal
> Priority: P1
> Component: IPV6
> AssignedTo: yoshfuji@linux-ipv6.org
> ReportedBy: hadmut@danisch.de
> Regression: No
>
>
> Hi,
>
> Linux ethernet interfaces do not use autoconfiguration and do ignore router
> advertisings if the packet forwarding is turned on in the configuration (i.e.
> /proc/sys/net/ipv6/conf/eth0/forwarding set to 1)
>
>
> This might be wrong.
>
> IPv6 network devices can have multiple IPv6 addresses and server several
> purposes at the same time. A machine can have a statically assigned local IPv6
> address and act as a router (e.g. to a virtual machine or a VPN tunnel) and
> thus needs to turn forwarding on, while at the same time it needs to listen to
> router advertisements and autoconfigure, e.g. because a network is connected to
> the internet through a DSL router with dynamically assigned network adresses,
> either through direct IPv6 assignment or a 6to4 tunnel.
>
> So there are cases where you need to have autoconfiguration of an IP address
> and forwarding on the same interface at the same time. Therefore, it might be
> technically wrong to have this mutually exclusive.
>
^ permalink raw reply
* Re: [PATCH] GRO: fix merging a paged skb after non-paged skbs
From: Herbert Xu @ 2011-02-08 20:54 UTC (permalink / raw)
To: Ben Hutchings; +Cc: Michal Schmidt, David Miller, netdev, linux-net-drivers
In-Reply-To: <1297177484.3325.1.camel@bwh-desktop>
On Tue, Feb 08, 2011 at 03:04:44PM +0000, Ben Hutchings wrote:
>
> That would work, though it looks like Michal has managed to make it
> tolerate switches. (I haven't yet tested the result myself.)
Well the question is do we really want to still keep merging
in case of a switch? It could potentially get messy if it switches
back over and over again.
However, I suppose other merging criteria will stop the merging
in such cases so it's probably not a big deal.
Cheers,
--
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
^ permalink raw reply
* RE: [net-next-2.6 03/16] e1000e: do not wakeup Tx queue until ready
From: Allan, Bruce W @ 2011-02-08 20:52 UTC (permalink / raw)
To: David Miller, Kirsher, Jeffrey T
Cc: netdev@vger.kernel.org, gospo@redhat.com, bphilips@novell.com
In-Reply-To: <20110208.122115.183054158.davem@davemloft.net>
>-----Original Message-----
>From: David Miller [mailto:davem@davemloft.net]
>Sent: Tuesday, February 08, 2011 12:21 PM
>To: Kirsher, Jeffrey T
>Cc: Allan, Bruce W; netdev@vger.kernel.org; gospo@redhat.com;
>bphilips@novell.com
>Subject: Re: [net-next-2.6 03/16] e1000e: do not wakeup Tx queue until ready
>
>You should not control the TX queue based upon link status information.
>That's the job of netif_carrier_{on,off}().
>
>The TX queue state should be set based solely upon that state of the
>TX ring, whether it is full or not.
>
>When the netif carrier is off, the packet scheduler is blocked from
>sending packets to the driver.
>
>If that isn't happening, that's a bug which you need to track down.
>Maybe you're not doing netif_carrier_off() early enough.
That's what I understood, but the driver was still getting packets
scheduled, at least that's what appeared to happen. I'll dig deeper.
Thanks,
Bruce.
^ permalink raw reply
* Re: [Bugme-new] [Bug 28532] New: Link state change detection problem on Moschip MCS7832 [mcs7830]
From: Andreas Mohr @ 2011-02-08 20:52 UTC (permalink / raw)
To: Andrew Morton
Cc: netdev-u79uwXL29TY76Z2rM5mHXA, linux-usb-u79uwXL29TY76Z2rM5mHXA,
bugzilla-daemon-590EEB7GvNiWaY/ihj7yzEB+6BGkLq7r,
bugme-daemon-590EEB7GvNiWaY/ihj7yzEB+6BGkLq7r,
myxal.mxl-Re5JQEeQqe8AvxtiuMwx3w, Andreas Mohr
In-Reply-To: <20110207151401.d1db088a.akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b@public.gmane.org>
Hi,
> > I have a network adapter which uses the aforementioned driver and while
> > checking for the link state via ethtool reports the correct state, many
> > networking userspace utilities seem to have no clue about it (NM 0.8.1 starts
> > dhclient BEFORE any cable is plugged) - and more importantly, don't notice when
> > the cable is (dis)connected. Since there's not even a kernel message when
> > (dis)connecting the cable, I suspect the driver does not implement Link state
> > change detection at all. Is this accurate?
Ah, perhaps that is why as long as network-mangler is running, my
.resume_reset() handler improvements (managing to keep an active interface
even directly after resume) actually do _not_ work (since it seems it simply
down:s the iface and that's it).
I know that there is link info functionality in other drivers yet not
as much in mcs7830.
Note that the mcs7830 driver still has a rather stubby appearance
(many more "advanced" features are either weak or not available at all).
I've got a patch series sitting here to improve several parts
(and waiting to cook a bit more), but I hadn't even identified the link issue.
It appears that this would need fixing, presto.
> > LSCD works in Windows, where it's apparently implemented through periodic
> > polling (judging by virtualbox's blinking USB icon).
> > How is this situation normally handled? Is it kernel's job to do the polling?
> > Or are userspace utilities expected to do this?
I'm afraid a painful solution would be to activate the .status callback
for periodic USB status descriptor polling. I've got a
half-implementation of that, however it's very painful in terms of
obscene amounts of CPU wakeups.
There _has_ to be a better solution...
Thank you for your (the OP's) report (and for my extra notification!),
this seems very helpful!
(I am determined to post related useful patches soon,
especially since this card is in active use here)
Andreas Mohr
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" 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
* pull request: wireless-next-2.6 2011-02-08
From: John W. Linville @ 2011-02-08 20:41 UTC (permalink / raw)
To: davem; +Cc: linux-wireless, netdev
Dave,
Here is the latest round of wireless bits intended for 2.6.39.
This is mostly driver updates (as usual), including a flurry of
wl1251 patches from David Gnedt. ath5k, ath9k, and iwlwifi are
well represented, of course. Interestingly, this batch includes a
number of mac80211 patches -- most of them _not_ from Johannes Berg!
I doubt if that holds for long... :-) And, zd1211rw grows AP support.
Also, this includes a wireless-2.6 pull to resolve some merge conflicts.
Please let me know if there are problems!
Thanks,
John
---
The following changes since commit 2360d2e8f01043632d6b651672bec66c49892f94:
enic: Update MAINTAINERS (2011-02-07 11:49:04 -0800)
are available in the git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-next-2.6.git master
Arik Nemtsov (3):
mac80211: do not calc frame duration when using HW rate-control
mac80211: add HW flag for disabling auto link-PS in AP mode
mac80211: pass up beacons from external BSS when operating as AP
Ben Greear (7):
mac80211: Be more careful when changing channels.
mac80211: Show configured channel-type in netdev debugfs.
mac80211: Warn users if HT fails because of freq mismatch.
ath9k: Show channel type and frequency in debugfs.
mac80211: Recalculate channel-type on iface removal.
mac80211: Optimize scans on current operating channel.
mac80211: Make some mlme timers module paramaters.
Christian Lamparter (1):
mac80211: fix race between next beacon dtim and ieee80211_get_buffered_bc
Dan Carpenter (1):
mac80211: remove unneeded check
David Gnedt (6):
wl1251: fix queue stopping/waking for TX path
wl1251: fix 4-byte TX buffer alignment
wl1251: enable beacon early termination while in power-saving mode
wl1251: implement connection quality monitoring
wl1251: enable adhoc mode
wl1251: set rate index and preamble flag on received packets
Felix Fietkau (3):
mac80211: do not send duplicate data frames to the cooked monitor interface
ath9k: add additional checks for the baseband hang detection
mac80211: as a 4-addr station, do not receive packets for other stations
Johannes Berg (6):
iwlwifi: support RSN IBSS
iwlwifi: advertise max aggregate size
iwlwifi: use maximum aggregation size
iwlwifi: fix beacon notification parsing
mac80211: allow GO to scan like AP
iwlwifi: remove unnecessary locking
John W. Linville (2):
Merge branch 'master' of git://git.kernel.org/.../linville/wireless-2.6
Merge branch 'wireless-next-2.6' of git://git.kernel.org/.../iwlwifi/iwlwifi-2.6
Jouni Malinen (3):
mac80211: Remove obsolete TKIP flexibility
mac80211: Add testing functionality for TKIP
ath: Fix clearing of secondary key cache entry for TKIP
Jussi Kivilinna (21):
zd1211rw: use urb anchors for tx and fix tx-queue disabling
zd1211rw: cancel process_intr work on zd_chip_disable_int()
zd1211rw: add locking for mac->process_intr
zd1211rw: fix beacon interval setup
zd1211rw: move set_multicast_hash and set_rx_filter from workers to configure_filter
zd1211rw: move set_rts_cts_work to bss_info_changed
zd1211rw: support setting BSSID for AP mode
zd1211rw: fix ack_pending in filter_ack causing tx-packet ordering problem on monitor
zd1211rw: let zd_set_beacon_interval() set dtim_period and add AP-beacon flag
zd1211rw: implement beacon fetching and handling ieee80211_get_buffered_bc()
zd1211rw: add beacon watchdog and setting HW beacon more failsafe
zd1211rw: batch beacon config commands together
zd1211rw: use stack and preallocated memory for small cmd-buffers
zd1211rw: change interrupt URB buffer to DMA buffer
zd1211rw: lower hw command timeouts
zd1211rw: collect driver settings and add function to restore theim
zd1211rw: add TX watchdog and device resetting
zd1211rw: reset device when CR_BCN_FIFO_SEMAPHORE freezes in beacon setup
zd1211rw: reset rx urbs after idle period of 30 seconds
zd1211rw: enable NL80211_IFTYPE_AP
zd1211rw: add useful debug output
Justin P. Mattock (1):
drivers:net:ipw2100.c change a typo comamnd to command
Juuso Oikarinen (1):
cfg80211: Fix power save state after interface type change
Mohammed Shafi Shajakhan (3):
ath9k: Fix memory leak due to failed PAPRD frames
mac80211: Update comments on radiotap MCS index
ath9k: Update comments for not parsing DTIM period
Nick Kossifidis (1):
ath5k: Fix fast channel switching
Rajkumar Manoharan (7):
ath9k_htc: cancel ani work in ath9k_htc_stop
ath9k: use common get current channel function
ath9k: move update tx power to common
ath9k_htc: make use common of function to update txpower
ath9k: do not access hw registers in FULL SLEEP
ath9k: reserve a beacon slot on beaconing vif addition
mac80211: do not restart ps timer during scan or offchannel
Vasily Khoruzhick (2):
libertas_spi: Use workqueue in hw_host_to_card
libertas: Prepare stuff for if_spi.c pm support
Wey-Yi Guy (8):
iwlwifi: check ucode loading error and restart
iwlagn: adjust rate table
iwlagn: add IQ inversion support for 2000 series devices
iwlwifi: always support idle mode for agn devices
iwlagn: use 2030 macro for 2030 devices
iwlagn: remove unsupported BT SCO command
iiwlagn: remove unused parameter
iwlwifi: fix compiling error with different configuration
drivers/net/wireless/ath/ath5k/phy.c | 142 +++++---
drivers/net/wireless/ath/ath9k/ath9k.h | 2 +
drivers/net/wireless/ath/ath9k/beacon.c | 5 +-
drivers/net/wireless/ath/ath9k/common.c | 11 +
drivers/net/wireless/ath/ath9k/common.h | 2 +
drivers/net/wireless/ath/ath9k/debug.c | 23 ++-
drivers/net/wireless/ath/ath9k/htc.h | 1 -
drivers/net/wireless/ath/ath9k/htc_drv_gpio.c | 3 +-
drivers/net/wireless/ath/ath9k/htc_drv_main.c | 24 +-
drivers/net/wireless/ath/ath9k/main.c | 96 +++---
drivers/net/wireless/ath/key.c | 5 +-
drivers/net/wireless/ipw2x00/ipw2100.c | 2 +-
drivers/net/wireless/iwlwifi/iwl-1000.c | 1 -
drivers/net/wireless/iwlwifi/iwl-2000.c | 16 +-
drivers/net/wireless/iwlwifi/iwl-4965.c | 32 ++-
drivers/net/wireless/iwlwifi/iwl-6000.c | 3 -
drivers/net/wireless/iwlwifi/iwl-agn-lib.c | 28 --
drivers/net/wireless/iwlwifi/iwl-agn-rs.c | 29 +-
drivers/net/wireless/iwlwifi/iwl-agn-ucode.c | 8 -
drivers/net/wireless/iwlwifi/iwl-agn.c | 87 ++++--
drivers/net/wireless/iwlwifi/iwl-commands.h | 8 +-
drivers/net/wireless/iwlwifi/iwl-core.h | 3 +-
drivers/net/wireless/iwlwifi/iwl-csr.h | 2 +
drivers/net/wireless/iwlwifi/iwl-debugfs.c | 7 +-
drivers/net/wireless/iwlwifi/iwl-dev.h | 2 +-
drivers/net/wireless/iwlwifi/iwl-power.c | 3 +-
drivers/net/wireless/iwlwifi/iwl3945-base.c | 14 +-
drivers/net/wireless/libertas/cmd.c | 10 +-
drivers/net/wireless/libertas/dev.h | 2 +
drivers/net/wireless/libertas/if_spi.c | 368 +++++++++++++-------
drivers/net/wireless/libertas/main.c | 77 +++--
drivers/net/wireless/wl1251/acx.c | 53 +++
drivers/net/wireless/wl1251/acx.h | 72 ++++
drivers/net/wireless/wl1251/event.c | 18 +
drivers/net/wireless/wl1251/main.c | 18 +-
drivers/net/wireless/wl1251/ps.c | 11 +
drivers/net/wireless/wl1251/rx.c | 46 +++-
drivers/net/wireless/wl1251/tx.c | 74 ++---
drivers/net/wireless/wl1251/wl1251.h | 7 +
drivers/net/wireless/zd1211rw/zd_chip.c | 134 +++++---
drivers/net/wireless/zd1211rw/zd_chip.h | 5 +-
drivers/net/wireless/zd1211rw/zd_mac.c | 448 +++++++++++++++++++------
drivers/net/wireless/zd1211rw/zd_mac.h | 24 +-
drivers/net/wireless/zd1211rw/zd_usb.c | 444 +++++++++++++++++++------
drivers/net/wireless/zd1211rw/zd_usb.h | 30 ++-
include/net/mac80211.h | 58 ++++-
net/mac80211/cfg.c | 26 ++-
net/mac80211/debugfs_netdev.c | 108 ++++++-
net/mac80211/ieee80211_i.h | 14 +-
net/mac80211/iface.c | 9 +-
net/mac80211/main.c | 53 +++-
net/mac80211/mlme.c | 60 +++-
net/mac80211/offchannel.c | 68 ++--
net/mac80211/rx.c | 59 +++--
net/mac80211/scan.c | 88 ++++--
net/mac80211/sta_info.c | 3 +-
net/mac80211/status.c | 4 +
net/mac80211/tx.c | 12 +-
net/mac80211/work.c | 66 +++-
net/mac80211/wpa.c | 39 +--
net/wireless/core.c | 20 +-
61 files changed, 2215 insertions(+), 872 deletions(-)
Omnibus patch available here:
http://www.kernel.org/pub/linux/kernel/people/linville/wireless-next-2.6-2011-02-08.patch.bz2
--
John W. Linville Someday the world will need a hero, and you
linville@tuxdriver.com might be all we have. Be ready.
^ permalink raw reply
* Re: [net-next-2.6 03/16] e1000e: do not wakeup Tx queue until ready
From: David Miller @ 2011-02-08 20:21 UTC (permalink / raw)
To: jeffrey.t.kirsher; +Cc: bruce.w.allan, netdev, gospo, bphilips
In-Reply-To: <1297168167-15755-4-git-send-email-jeffrey.t.kirsher@intel.com>
From: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Date: Tue, 8 Feb 2011 04:29:14 -0800
> From: Bruce Allan <bruce.w.allan@intel.com>
>
> When restarting the adapter via calls to e1000e_down() followed by
> e1000e_up() (for example when restarting autonegotiation via ethtool),
> packets can be queued for transmit before link is actually up and
> netif_carrier_on is set. This was causing the watchdog_task to do an
> extra unnecessary reset of the adapter. Delaying the wakeup of the Tx
> queue until link is up prevents the reset.
>
> Signed-off-by: Bruce Allan <bruce.w.allan@intel.com>
> Tested-by: Jeff Pieper <jeffrey.e.pieper@intel.com>
> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
You should not control the TX queue based upon link status information.
That's the job of netif_carrier_{on,off}().
The TX queue state should be set based solely upon that state of the
TX ring, whether it is full or not.
When the netif carrier is off, the packet scheduler is blocked from
sending packets to the driver.
If that isn't happening, that's a bug which you need to track down.
Maybe you're not doing netif_carrier_off() early enough.
^ permalink raw reply
* Re: [net-2.6 0/7][pull request] Intel Wired LAN Driver Updates
From: David Miller @ 2011-02-08 20:17 UTC (permalink / raw)
To: jeffrey.t.kirsher; +Cc: netdev, gospo, bphilips
In-Reply-To: <1297158279-20277-1-git-send-email-jeffrey.t.kirsher@intel.com>
From: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Date: Tue, 8 Feb 2011 01:44:32 -0800
> The following series contains the addition of a PHY id for e1000,
> fix for e1000e, and several ixgbe fixes.
>
> We are currently still working on the patch:
> ixgbe: DDP last buffer size work around
> which was in the previous pull request, and has been removed from this
> pull request.
>
> The following are changes since commit 429a01a70f301baf0c8fc780f891a18c296d5e24:
> Merge branch 'batman-adv/merge' of git://git.open-mesh.org/ecsv/linux-merge
>
> and are available in the git repository at:
> master.kernel.org:/pub/scm/linux/kernel/git/jkirsher/net-2.6 master
Pulled, thanks a lot Jeff.
^ permalink raw reply
* Re: pull request: wireless-2.6 2011-02-08
From: David Miller @ 2011-02-08 20:14 UTC (permalink / raw)
To: linville; +Cc: linux-wireless, netdev, linux-kernel
In-Reply-To: <20110208195530.GB6244@tuxdriver.com>
From: "John W. Linville" <linville@tuxdriver.com>
Date: Tue, 8 Feb 2011 14:55:30 -0500
> Here is the latest round of wireless fixes intended for 2.6.38.
> Included is a carl9170 fix (described as a typo) for receiving buffered
> broadcasts, an iwlagn fix to properly monitor the rfkill switch when
> the interface is down, a mac80211 fix to correctly check for cloned
> skbs when resizing, a null pointer fix for wl1251 if it fails to get
> a beacon, a mac80211 fix related to off-channel tx, an ssb fix for
> using the wrong pointer for getting invariance for pcmcia devices,
> an ath9k double-free fix, and a one-line iwlagn fix to correctly
> describe an antenna configuration.
Pulled, thanks John.
^ permalink raw reply
* Assalamu`Alaikum Friend,
From: Aboubaka Hassan @ 2011-02-08 20:03 UTC (permalink / raw)
Assalamu`Alaikum Friend,
My Name is Dr.Hassan Aboubaka.I am a banker by profession.I hail from Ouagadougou,Burkina Faso ,West Africa.My reason for contacting you is to transfer an abandoned $10, 300,000.00 (Ten Million Three Hundred Thousand Dollars) to your account.
The owner of this fund died since 1997 with his Next Of Kin. I want to present you to the bank as the Next of Kin/beneficiary of this fund.
Further details of the transaction shall be forwarded to you as soon as I receive your return mail indicating your interest.
Happy New Year
Dr.Hassan Aboubaka
^ permalink raw reply
* pull request: wireless-2.6 2011-02-08
From: John W. Linville @ 2011-02-08 19:55 UTC (permalink / raw)
To: davem; +Cc: linux-wireless, netdev, linux-kernel
Dave,
Here is the latest round of wireless fixes intended for 2.6.38.
Included is a carl9170 fix (described as a typo) for receiving buffered
broadcasts, an iwlagn fix to properly monitor the rfkill switch when
the interface is down, a mac80211 fix to correctly check for cloned
skbs when resizing, a null pointer fix for wl1251 if it fails to get
a beacon, a mac80211 fix related to off-channel tx, an ssb fix for
using the wrong pointer for getting invariance for pcmcia devices,
an ath9k double-free fix, and a one-line iwlagn fix to correctly
describe an antenna configuration.
Please let me know if there are problems!
Thanks,
John
---
The following changes since commit 429a01a70f301baf0c8fc780f891a18c296d5e24:
Merge branch 'batman-adv/merge' of git://git.open-mesh.org/ecsv/linux-merge (2011-02-07 19:54:14 -0800)
are available in the git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-2.6.git master
Christian Lamparter (1):
carl9170: fix typo in PS code
Don Fry (1):
iwlagn: Re-enable RF_KILL interrupt when down
Felix Fietkau (1):
mac80211: fix the skb cloned check in the tx path
Jesper Juhl (1):
wireless, wl1251: Fix potential NULL pointer dereference in wl1251_op_bss_info_changed()
Johannes Berg (1):
mac80211: fix TX status cookie in HW offload case
Michael Buesch (1):
ssb-pcmcia: Fix parsing of invariants tuples
Mohammed Shafi Shajakhan (1):
ath9k: Fix possible double free of PAPRD skb's
Wey-Yi Guy (1):
iwlagn: overwrite EEPROM chain setting for 6250 devices
drivers/net/wireless/ath/ath9k/ath9k.h | 2 +-
drivers/net/wireless/ath/ath9k/main.c | 2 --
drivers/net/wireless/ath/ath9k/xmit.c | 7 ++++++-
drivers/net/wireless/ath/carl9170/rx.c | 2 +-
drivers/net/wireless/iwlwifi/iwl-6000.c | 2 ++
drivers/net/wireless/iwlwifi/iwl-agn.c | 6 ++++++
drivers/net/wireless/wl1251/main.c | 3 +++
drivers/ssb/pcmcia.c | 2 +-
net/mac80211/cfg.c | 2 ++
net/mac80211/ieee80211_i.h | 2 +-
net/mac80211/status.c | 7 ++++++-
net/mac80211/tx.c | 2 +-
12 files changed, 30 insertions(+), 9 deletions(-)
diff --git a/drivers/net/wireless/ath/ath9k/ath9k.h b/drivers/net/wireless/ath/ath9k/ath9k.h
index 3681caf5..23838e3 100644
--- a/drivers/net/wireless/ath/ath9k/ath9k.h
+++ b/drivers/net/wireless/ath/ath9k/ath9k.h
@@ -218,6 +218,7 @@ struct ath_frame_info {
struct ath_buf_state {
u8 bf_type;
u8 bfs_paprd;
+ unsigned long bfs_paprd_timestamp;
enum ath9k_internal_frame_type bfs_ftype;
};
@@ -593,7 +594,6 @@ struct ath_softc {
struct work_struct paprd_work;
struct work_struct hw_check_work;
struct completion paprd_complete;
- bool paprd_pending;
u32 intrstatus;
u32 sc_flags; /* SC_OP_* */
diff --git a/drivers/net/wireless/ath/ath9k/main.c b/drivers/net/wireless/ath/ath9k/main.c
index 9040c2f..da5c645 100644
--- a/drivers/net/wireless/ath/ath9k/main.c
+++ b/drivers/net/wireless/ath/ath9k/main.c
@@ -342,7 +342,6 @@ static bool ath_paprd_send_frame(struct ath_softc *sc, struct sk_buff *skb, int
tx_info->control.rates[1].idx = -1;
init_completion(&sc->paprd_complete);
- sc->paprd_pending = true;
txctl.paprd = BIT(chain);
if (ath_tx_start(hw, skb, &txctl) != 0) {
@@ -353,7 +352,6 @@ static bool ath_paprd_send_frame(struct ath_softc *sc, struct sk_buff *skb, int
time_left = wait_for_completion_timeout(&sc->paprd_complete,
msecs_to_jiffies(ATH_PAPRD_TIMEOUT));
- sc->paprd_pending = false;
if (!time_left)
ath_dbg(ath9k_hw_common(sc->sc_ah), ATH_DBG_CALIBRATE,
diff --git a/drivers/net/wireless/ath/ath9k/xmit.c b/drivers/net/wireless/ath/ath9k/xmit.c
index 33a37ed..07b7804 100644
--- a/drivers/net/wireless/ath/ath9k/xmit.c
+++ b/drivers/net/wireless/ath/ath9k/xmit.c
@@ -1725,6 +1725,9 @@ static void ath_tx_start_dma(struct ath_softc *sc, struct ath_buf *bf,
ar9003_hw_set_paprd_txdesc(sc->sc_ah, bf->bf_desc,
bf->bf_state.bfs_paprd);
+ if (txctl->paprd)
+ bf->bf_state.bfs_paprd_timestamp = jiffies;
+
ath_tx_send_normal(sc, txctl->txq, tid, &bf_head);
}
@@ -1886,7 +1889,9 @@ static void ath_tx_complete_buf(struct ath_softc *sc, struct ath_buf *bf,
bf->bf_buf_addr = 0;
if (bf->bf_state.bfs_paprd) {
- if (!sc->paprd_pending)
+ if (time_after(jiffies,
+ bf->bf_state.bfs_paprd_timestamp +
+ msecs_to_jiffies(ATH_PAPRD_TIMEOUT)))
dev_kfree_skb_any(skb);
else
complete(&sc->paprd_complete);
diff --git a/drivers/net/wireless/ath/carl9170/rx.c b/drivers/net/wireless/ath/carl9170/rx.c
index 939a0e9..84866a4 100644
--- a/drivers/net/wireless/ath/carl9170/rx.c
+++ b/drivers/net/wireless/ath/carl9170/rx.c
@@ -564,7 +564,7 @@ static void carl9170_ps_beacon(struct ar9170 *ar, void *data, unsigned int len)
cam = ieee80211_check_tim(tim_ie, tim_len, ar->common.curaid);
/* 2. Maybe the AP wants to send multicast/broadcast data? */
- cam = !!(tim_ie->bitmap_ctrl & 0x01);
+ cam |= !!(tim_ie->bitmap_ctrl & 0x01);
if (!cam) {
/* back to low-power land. */
diff --git a/drivers/net/wireless/iwlwifi/iwl-6000.c b/drivers/net/wireless/iwlwifi/iwl-6000.c
index af505bc..ef36aff 100644
--- a/drivers/net/wireless/iwlwifi/iwl-6000.c
+++ b/drivers/net/wireless/iwlwifi/iwl-6000.c
@@ -681,6 +681,8 @@ struct iwl_cfg iwl6000i_2bg_cfg = {
.fw_name_pre = IWL6050_FW_PRE, \
.ucode_api_max = IWL6050_UCODE_API_MAX, \
.ucode_api_min = IWL6050_UCODE_API_MIN, \
+ .valid_tx_ant = ANT_AB, /* .cfg overwrite */ \
+ .valid_rx_ant = ANT_AB, /* .cfg overwrite */ \
.ops = &iwl6050_ops, \
.eeprom_ver = EEPROM_6050_EEPROM_VERSION, \
.eeprom_calib_ver = EEPROM_6050_TX_POWER_VERSION, \
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn.c b/drivers/net/wireless/iwlwifi/iwl-agn.c
index f13a83a..a236b8b 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn.c
@@ -1157,6 +1157,9 @@ static void iwl_irq_tasklet_legacy(struct iwl_priv *priv)
/* only Re-enable if diabled by irq */
if (test_bit(STATUS_INT_ENABLED, &priv->status))
iwl_enable_interrupts(priv);
+ /* Re-enable RF_KILL if it occurred */
+ else if (handled & CSR_INT_BIT_RF_KILL)
+ iwl_enable_rfkill_int(priv);
#ifdef CONFIG_IWLWIFI_DEBUG
if (iwl_get_debug_level(priv) & (IWL_DL_ISR)) {
@@ -1371,6 +1374,9 @@ static void iwl_irq_tasklet(struct iwl_priv *priv)
/* only Re-enable if diabled by irq */
if (test_bit(STATUS_INT_ENABLED, &priv->status))
iwl_enable_interrupts(priv);
+ /* Re-enable RF_KILL if it occurred */
+ else if (handled & CSR_INT_BIT_RF_KILL)
+ iwl_enable_rfkill_int(priv);
}
/* the threshold ratio of actual_ack_cnt to expected_ack_cnt in percent */
diff --git a/drivers/net/wireless/wl1251/main.c b/drivers/net/wireless/wl1251/main.c
index 012e1a4..40372ba 100644
--- a/drivers/net/wireless/wl1251/main.c
+++ b/drivers/net/wireless/wl1251/main.c
@@ -1039,6 +1039,9 @@ static void wl1251_op_bss_info_changed(struct ieee80211_hw *hw,
if (changed & BSS_CHANGED_BEACON) {
beacon = ieee80211_beacon_get(hw, vif);
+ if (!beacon)
+ goto out_sleep;
+
ret = wl1251_cmd_template_set(wl, CMD_BEACON, beacon->data,
beacon->len);
diff --git a/drivers/ssb/pcmcia.c b/drivers/ssb/pcmcia.c
index c7345db..f853379 100644
--- a/drivers/ssb/pcmcia.c
+++ b/drivers/ssb/pcmcia.c
@@ -733,7 +733,7 @@ int ssb_pcmcia_get_invariants(struct ssb_bus *bus,
/* Fetch the vendor specific tuples. */
res = pcmcia_loop_tuple(bus->host_pcmcia, SSB_PCMCIA_CIS,
- ssb_pcmcia_do_get_invariants, sprom);
+ ssb_pcmcia_do_get_invariants, iv);
if ((res == 0) || (res == -ENOSPC))
return 0;
diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c
index 4bc8a92..9cd73b1 100644
--- a/net/mac80211/cfg.c
+++ b/net/mac80211/cfg.c
@@ -1822,6 +1822,7 @@ static int ieee80211_mgmt_tx(struct wiphy *wiphy, struct net_device *dev,
*cookie ^= 2;
IEEE80211_SKB_CB(skb)->flags |= IEEE80211_TX_CTL_TX_OFFCHAN;
local->hw_roc_skb = skb;
+ local->hw_roc_skb_for_status = skb;
mutex_unlock(&local->mtx);
return 0;
@@ -1875,6 +1876,7 @@ static int ieee80211_mgmt_tx_cancel_wait(struct wiphy *wiphy,
if (ret == 0) {
kfree_skb(local->hw_roc_skb);
local->hw_roc_skb = NULL;
+ local->hw_roc_skb_for_status = NULL;
}
mutex_unlock(&local->mtx);
diff --git a/net/mac80211/ieee80211_i.h b/net/mac80211/ieee80211_i.h
index c47d7c0..533fd32 100644
--- a/net/mac80211/ieee80211_i.h
+++ b/net/mac80211/ieee80211_i.h
@@ -953,7 +953,7 @@ struct ieee80211_local {
struct ieee80211_channel *hw_roc_channel;
struct net_device *hw_roc_dev;
- struct sk_buff *hw_roc_skb;
+ struct sk_buff *hw_roc_skb, *hw_roc_skb_for_status;
struct work_struct hw_roc_start, hw_roc_done;
enum nl80211_channel_type hw_roc_channel_type;
unsigned int hw_roc_duration;
diff --git a/net/mac80211/status.c b/net/mac80211/status.c
index 38a7972..071ac95 100644
--- a/net/mac80211/status.c
+++ b/net/mac80211/status.c
@@ -323,6 +323,7 @@ void ieee80211_tx_status(struct ieee80211_hw *hw, struct sk_buff *skb)
if (info->flags & IEEE80211_TX_INTFL_NL80211_FRAME_TX) {
struct ieee80211_work *wk;
+ u64 cookie = (unsigned long)skb;
rcu_read_lock();
list_for_each_entry_rcu(wk, &local->work_list, list) {
@@ -334,8 +335,12 @@ void ieee80211_tx_status(struct ieee80211_hw *hw, struct sk_buff *skb)
break;
}
rcu_read_unlock();
+ if (local->hw_roc_skb_for_status == skb) {
+ cookie = local->hw_roc_cookie ^ 2;
+ local->hw_roc_skb_for_status = NULL;
+ }
cfg80211_mgmt_tx_status(
- skb->dev, (unsigned long) skb, skb->data, skb->len,
+ skb->dev, cookie, skb->data, skb->len,
!!(info->flags & IEEE80211_TX_STAT_ACK), GFP_ATOMIC);
}
diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c
index b64b42b..b0beaa5 100644
--- a/net/mac80211/tx.c
+++ b/net/mac80211/tx.c
@@ -1547,7 +1547,7 @@ static int ieee80211_skb_resize(struct ieee80211_local *local,
skb_orphan(skb);
}
- if (skb_header_cloned(skb))
+ if (skb_cloned(skb))
I802_DEBUG_INC(local->tx_expand_skb_head_cloned);
else if (head_need || tail_need)
I802_DEBUG_INC(local->tx_expand_skb_head);
--
John W. Linville Someday the world will need a hero, and you
linville@tuxdriver.com might be all we have. Be ready.
^ permalink raw reply related
* Re: [PATCH v4 0/5] net: Unified offload configuration
From: David Miller @ 2011-02-08 19:40 UTC (permalink / raw)
To: mirq-linux; +Cc: netdev, bhutchings
In-Reply-To: <20110207.133721.48496023.davem@davemloft.net>
BTW, none of your patch postings from today made it to the mailing
lists because there were syntax errors in your email headers.
Therefore, you'll need to resend them.
^ permalink raw reply
* Re: Trouble Shooting ipsec
From: David Miller @ 2011-02-08 19:37 UTC (permalink / raw)
To: sclark46; +Cc: nhorman, netdev
In-Reply-To: <4D519A7D.5010405@earthlink.net>
From: Stephen Clark <sclark46@earthlink.net>
Date: Tue, 08 Feb 2011 14:33:17 -0500
> I'll continue investigating. It just so frustrating when the ipsec
> packets just get dropped and you have no idea why. I wish there were
> some hooks in the kernel so you could at least get some debug
> information about what is happening.
There is a tracepoint (which you can monitor using perf) which tracks
all packet drops.
^ permalink raw reply
* Re: Trouble Shooting ipsec
From: Stephen Clark @ 2011-02-08 19:33 UTC (permalink / raw)
To: Neil Horman; +Cc: Linux Kernel Network Developers
In-Reply-To: <20110208183527.GA7450@hmsreliant.think-freely.org>
On 02/08/2011 01:35 PM, Neil Horman wrote:
> On Mon, Feb 07, 2011 at 02:17:55PM -0500, Stephen Clark wrote:
>
>> Hello,
>>
>> How do I find out what is happening to my packets thru my ipsec tunnel.
>> They just seem to disappear on the remote side.
>>
>> I have successfully got the pings thru
>> when everything has an ipv6 address, but am not successful when trying
>> to connect two ipv4 lans across an ipv6 ipsec tunnel. All fw chains
>> both 4 and 6
>> are set to ACCEPT. NAT is turned off.
>>
>> eth0 eth1
>> eth1 eth0
>> 10.1.254.254/17 2001:xxxx:1628::254<----ipv6 internet ----->
>> 2001:xxxx:e334::254 10.0.254.254/17
>>
>> 12:00:02.296972 IP6 2001:xxxx:1628::254> 2001:xxxx:e334::254:
>> ESP(spi=0x07454bc3,seq=0x28b), length 132
>> 12:00:03.308751 IP6 2001:xxxx:1628::254> 2001:xxxx:e334::254:
>> ESP(spi=0x07454bc3,seq=0x28c), length 132
>> 12:00:04.296857 IP6 2001:xxxx:1628::254> 2001:xxxx:e334::254:
>> ESP(spi=0x07454bc3,seq=0x28d), length 132
>> 12:00:05.293748 IP6 2001:xxxx:1628::254> 2001:xxxx:e334::254:
>> ESP(spi=0x07454bc3,seq=0x28e), length 132
>> 12:00:06.296623 IP6 2001:xxxx:1628::254> 2001:xxxx:e334::254:
>> ESP(spi=0x07454bc3,seq=0x28f), length 132
>>
>> I have posted to the ipsec-devel list and haven't gotten any
>> responses. Also I have spent 2 days googling with
>> no results about the above setup. Is it even possible to tunnel ipv4
>> packet thru an ipv6 ipsec tunnel?
>>
>> Thanks,
>> Steve
>>
>>
> I'd start by looking at your stats counters to see if you're dropping anything
> significat. It appears from what you have above that you're receiving end is
> getting encapsulated packets, so at least your tunnel is functional. Take a
> look at proc/net/snmp and see if any counters get bumped as you send data. I
> expect you're loosing them somewhere during decode (which would show up in
> /proc/net/xfrm_stat), or you're loosing them after you decode them and try to
> receive/forward them (which would likely show up in /proc/net/snmp). That
> should give you a clue as to where to look next
>
> Neil
>
>
>>
>
Thanks for the tip. I wasn't aware of /proc/net/xfrm_stat
I was able to work around by creating an ipv6 to ipv6 ipsec tunnel
and then creating an ipip6 tunnel inside of ipv6-ipv6 ipsec tunnel.
I'll continue investigating. It just so frustrating when the ipsec packets
just get dropped and you have no idea why. I wish there were some hooks
in the kernel so you could at least get some debug information about what is
happening.
--
"They that give up essential liberty to obtain temporary safety,
deserve neither liberty nor safety." (Ben Franklin)
"The course of history shows that as a government grows, liberty
decreases." (Thomas Jefferson)
^ permalink raw reply
* [PATCH v3, RESEND 07/16] sunrpc: get rpc_pipefs mount point for rpcb_create[_local] from callers
From: Kirill A. Shutemov @ 2011-02-08 18:41 UTC (permalink / raw)
To: Trond Myklebust, J. Bruce Fields, Neil Brown
Cc: Pavel Emelyanov, linux-nfs, David S. Miller, Rob Landley, Al Viro,
containers, netdev, linux-kernel, Kirill A. Shutemov
In-Reply-To: <1297190527-19925-1-git-send-email-kas@openvz.org>
Signed-off-by: Kirill A. Shutemov <kas@openvz.org>
Reviewed-by: Rob Landley <rlandley@parallels.com>
---
include/linux/sunrpc/clnt.h | 4 ++--
net/sunrpc/rpcb_clnt.c | 22 ++++++++++++----------
net/sunrpc/svc.c | 34 +++++++++++++++++++++-------------
3 files changed, 35 insertions(+), 25 deletions(-)
diff --git a/include/linux/sunrpc/clnt.h b/include/linux/sunrpc/clnt.h
index dffaaaa..52f6142 100644
--- a/include/linux/sunrpc/clnt.h
+++ b/include/linux/sunrpc/clnt.h
@@ -135,10 +135,10 @@ void rpc_shutdown_client(struct rpc_clnt *);
void rpc_release_client(struct rpc_clnt *);
void rpc_task_release_client(struct rpc_task *);
-int rpcb_register(u32, u32, int, unsigned short);
+int rpcb_register(u32, u32, int, unsigned short, struct vfsmount *);
int rpcb_v4_register(const u32 program, const u32 version,
const struct sockaddr *address,
- const char *netid);
+ const char *netid, struct vfsmount *rpcmount);
void rpcb_getport_async(struct rpc_task *);
void rpc_call_start(struct rpc_task *);
diff --git a/net/sunrpc/rpcb_clnt.c b/net/sunrpc/rpcb_clnt.c
index b059cbe..7fddafa 100644
--- a/net/sunrpc/rpcb_clnt.c
+++ b/net/sunrpc/rpcb_clnt.c
@@ -27,7 +27,6 @@
#include <linux/sunrpc/clnt.h>
#include <linux/sunrpc/sched.h>
#include <linux/sunrpc/xprtsock.h>
-#include <linux/sunrpc/rpc_pipe_fs.h>
#ifdef RPC_DEBUG
# define RPCDBG_FACILITY RPCDBG_BIND
@@ -171,7 +170,7 @@ static DEFINE_MUTEX(rpcb_create_local_mutex);
* Returns zero on success, otherwise a negative errno value
* is returned.
*/
-static int rpcb_create_local(void)
+static int rpcb_create_local(struct vfsmount *rpcmount)
{
struct rpc_create_args args = {
.net = &init_net,
@@ -183,7 +182,7 @@ static int rpcb_create_local(void)
.version = RPCBVERS_2,
.authflavor = RPC_AUTH_UNIX,
.flags = RPC_CLNT_CREATE_NOPING,
- .rpcmount = init_rpc_pipefs,
+ .rpcmount = rpcmount,
};
struct rpc_clnt *clnt, *clnt4;
int result = 0;
@@ -225,7 +224,8 @@ out:
}
static struct rpc_clnt *rpcb_create(char *hostname, struct sockaddr *srvaddr,
- size_t salen, int proto, u32 version)
+ size_t salen, int proto, u32 version,
+ struct vfsmount *rpcmount)
{
struct rpc_create_args args = {
.net = &init_net,
@@ -238,7 +238,7 @@ static struct rpc_clnt *rpcb_create(char *hostname, struct sockaddr *srvaddr,
.authflavor = RPC_AUTH_UNIX,
.flags = (RPC_CLNT_CREATE_NOPING |
RPC_CLNT_CREATE_NONPRIVPORT),
- .rpcmount = init_rpc_pipefs,
+ .rpcmount = rpcmount,
};
switch (srvaddr->sa_family) {
@@ -305,7 +305,8 @@ static int rpcb_register_call(struct rpc_clnt *clnt, struct rpc_message *msg)
* IN6ADDR_ANY (ie available for all AF_INET and AF_INET6
* addresses).
*/
-int rpcb_register(u32 prog, u32 vers, int prot, unsigned short port)
+int rpcb_register(u32 prog, u32 vers, int prot, unsigned short port,
+ struct vfsmount *rpcmount)
{
struct rpcbind_args map = {
.r_prog = prog,
@@ -318,7 +319,7 @@ int rpcb_register(u32 prog, u32 vers, int prot, unsigned short port)
};
int error;
- error = rpcb_create_local();
+ error = rpcb_create_local(rpcmount);
if (error)
return error;
@@ -445,7 +446,8 @@ static int rpcb_unregister_all_protofamilies(struct rpc_message *msg)
* advertises the service on all IPv4 and IPv6 addresses.
*/
int rpcb_v4_register(const u32 program, const u32 version,
- const struct sockaddr *address, const char *netid)
+ const struct sockaddr *address, const char *netid,
+ struct vfsmount *rpcmount)
{
struct rpcbind_args map = {
.r_prog = program,
@@ -458,7 +460,7 @@ int rpcb_v4_register(const u32 program, const u32 version,
};
int error;
- error = rpcb_create_local();
+ error = rpcb_create_local(rpcmount);
if (error)
return error;
if (rpcb_local_clnt4 == NULL)
@@ -594,7 +596,7 @@ void rpcb_getport_async(struct rpc_task *task)
task->tk_pid, __func__, bind_version);
rpcb_clnt = rpcb_create(clnt->cl_server, sap, salen, xprt->prot,
- bind_version);
+ bind_version, clnt->cl_path.mnt);
if (IS_ERR(rpcb_clnt)) {
status = PTR_ERR(rpcb_clnt);
dprintk("RPC: %5u %s: rpcb_create failed, error %ld\n",
diff --git a/net/sunrpc/svc.c b/net/sunrpc/svc.c
index 63abe2b..031f2d4 100644
--- a/net/sunrpc/svc.c
+++ b/net/sunrpc/svc.c
@@ -739,7 +739,8 @@ EXPORT_SYMBOL_GPL(svc_exit_thread);
*/
static int __svc_rpcb_register4(const u32 program, const u32 version,
const unsigned short protocol,
- const unsigned short port)
+ const unsigned short port,
+ struct vfsmount *rpcmount)
{
const struct sockaddr_in sin = {
.sin_family = AF_INET,
@@ -761,14 +762,16 @@ static int __svc_rpcb_register4(const u32 program, const u32 version,
}
error = rpcb_v4_register(program, version,
- (const struct sockaddr *)&sin, netid);
+ (const struct sockaddr *)&sin, netid,
+ rpcmount);
/*
* User space didn't support rpcbind v4, so retry this
* registration request with the legacy rpcbind v2 protocol.
*/
if (error == -EPROTONOSUPPORT)
- error = rpcb_register(program, version, protocol, port);
+ error = rpcb_register(program, version, protocol, port,
+ rpcmount);
return error;
}
@@ -786,7 +789,8 @@ static int __svc_rpcb_register4(const u32 program, const u32 version,
*/
static int __svc_rpcb_register6(const u32 program, const u32 version,
const unsigned short protocol,
- const unsigned short port)
+ const unsigned short port,
+ struct vfsmount *rpcmount)
{
const struct sockaddr_in6 sin6 = {
.sin6_family = AF_INET6,
@@ -808,7 +812,8 @@ static int __svc_rpcb_register6(const u32 program, const u32 version,
}
error = rpcb_v4_register(program, version,
- (const struct sockaddr *)&sin6, netid);
+ (const struct sockaddr *)&sin6, netid,
+ rpcmount);
/*
* User space didn't support rpcbind version 4, so we won't
@@ -831,19 +836,20 @@ static int __svc_register(const char *progname,
const u32 program, const u32 version,
const int family,
const unsigned short protocol,
- const unsigned short port)
+ const unsigned short port,
+ struct vfsmount *rpcmount)
{
int error = -EAFNOSUPPORT;
switch (family) {
case PF_INET:
error = __svc_rpcb_register4(program, version,
- protocol, port);
+ protocol, port, rpcmount);
break;
#if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE)
case PF_INET6:
error = __svc_rpcb_register6(program, version,
- protocol, port);
+ protocol, port, rpcmount);
#endif /* defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) */
}
@@ -889,7 +895,8 @@ int svc_register(const struct svc_serv *serv, const int family,
continue;
error = __svc_register(progp->pg_name, progp->pg_prog,
- i, family, proto, port);
+ i, family, proto, port,
+ serv->sv_rpcmount);
if (error < 0)
break;
}
@@ -906,18 +913,18 @@ int svc_register(const struct svc_serv *serv, const int family,
* in this case to clear all existing entries for [program, version].
*/
static void __svc_unregister(const u32 program, const u32 version,
- const char *progname)
+ const char *progname, struct vfsmount *rpcmount)
{
int error;
- error = rpcb_v4_register(program, version, NULL, "");
+ error = rpcb_v4_register(program, version, NULL, "", rpcmount);
/*
* User space didn't support rpcbind v4, so retry this
* request with the legacy rpcbind v2 protocol.
*/
if (error == -EPROTONOSUPPORT)
- error = rpcb_register(program, version, 0, 0);
+ error = rpcb_register(program, version, 0, 0, rpcmount);
dprintk("svc: %s(%sv%u), error %d\n",
__func__, progname, version, error);
@@ -946,7 +953,8 @@ static void svc_unregister(const struct svc_serv *serv)
if (progp->pg_vers[i]->vs_hidden)
continue;
- __svc_unregister(progp->pg_prog, i, progp->pg_name);
+ __svc_unregister(progp->pg_prog, i, progp->pg_name,
+ serv->sv_rpcmount);
}
}
--
1.7.4
^ permalink raw reply related
* [PATCH v3, RESEND 08/16] sunrpc: tag pipefs field of cache_detail with rpc_pipefs mount point
From: Kirill A. Shutemov @ 2011-02-08 18:41 UTC (permalink / raw)
To: Trond Myklebust, J. Bruce Fields, Neil Brown
Cc: Pavel Emelyanov, linux-nfs, David S. Miller, Rob Landley, Al Viro,
containers, netdev, linux-kernel, Kirill A. Shutemov
In-Reply-To: <1297190527-19925-1-git-send-email-kas@openvz.org>
Signed-off-by: Kirill A. Shutemov <kas@openvz.org>
Reviewed-by: Rob Landley <rlandley@parallels.com>
---
fs/nfs/cache_lib.c | 3 +--
include/linux/sunrpc/cache.h | 9 +++------
net/sunrpc/cache.c | 16 ++++++++++------
3 files changed, 14 insertions(+), 14 deletions(-)
diff --git a/fs/nfs/cache_lib.c b/fs/nfs/cache_lib.c
index dd7ca5f..0944d4e 100644
--- a/fs/nfs/cache_lib.c
+++ b/fs/nfs/cache_lib.c
@@ -123,7 +123,7 @@ int nfs_cache_register(struct cache_detail *cd)
ret = vfs_path_lookup(mnt->mnt_root, mnt, "/cache", 0, &nd);
if (ret)
goto err;
- ret = sunrpc_cache_register_pipefs(nd.path.dentry,
+ ret = sunrpc_cache_register_pipefs(mnt, nd.path.dentry,
cd->name, 0600, cd);
path_put(&nd.path);
if (!ret)
@@ -136,6 +136,5 @@ err:
void nfs_cache_unregister(struct cache_detail *cd)
{
sunrpc_cache_unregister_pipefs(cd);
- mntput(init_rpc_pipefs);
}
diff --git a/include/linux/sunrpc/cache.h b/include/linux/sunrpc/cache.h
index 7898ea1..a5957cb 100644
--- a/include/linux/sunrpc/cache.h
+++ b/include/linux/sunrpc/cache.h
@@ -65,10 +65,6 @@ struct cache_detail_procfs {
struct proc_dir_entry *flush_ent, *channel_ent, *content_ent;
};
-struct cache_detail_pipefs {
- struct dentry *dir;
-};
-
struct cache_detail {
struct module * owner;
int hash_size;
@@ -115,7 +111,7 @@ struct cache_detail {
union {
struct cache_detail_procfs procfs;
- struct cache_detail_pipefs pipefs;
+ struct path pipefs;
} u;
};
@@ -202,7 +198,8 @@ extern int cache_register_net(struct cache_detail *cd, struct net *net);
extern void cache_unregister(struct cache_detail *cd);
extern void cache_unregister_net(struct cache_detail *cd, struct net *net);
-extern int sunrpc_cache_register_pipefs(struct dentry *parent, const char *,
+extern int sunrpc_cache_register_pipefs(struct vfsmount *rpcmount,
+ struct dentry *parent, const char *,
mode_t, struct cache_detail *);
extern void sunrpc_cache_unregister_pipefs(struct cache_detail *);
diff --git a/net/sunrpc/cache.c b/net/sunrpc/cache.c
index 72ad836..cfc225a 100644
--- a/net/sunrpc/cache.c
+++ b/net/sunrpc/cache.c
@@ -28,6 +28,7 @@
#include <linux/workqueue.h>
#include <linux/mutex.h>
#include <linux/pagemap.h>
+#include <linux/mount.h>
#include <asm/ioctls.h>
#include <linux/sunrpc/types.h>
#include <linux/sunrpc/cache.h>
@@ -1777,7 +1778,8 @@ const struct file_operations cache_flush_operations_pipefs = {
.llseek = no_llseek,
};
-int sunrpc_cache_register_pipefs(struct dentry *parent,
+int sunrpc_cache_register_pipefs(struct vfsmount *rpcmount,
+ struct dentry *parent,
const char *name, mode_t umode,
struct cache_detail *cd)
{
@@ -1790,9 +1792,10 @@ int sunrpc_cache_register_pipefs(struct dentry *parent,
q.len = strlen(name);
q.hash = full_name_hash(q.name, q.len);
dir = rpc_create_cache_dir(parent, &q, umode, cd);
- if (!IS_ERR(dir))
- cd->u.pipefs.dir = dir;
- else {
+ if (!IS_ERR(dir)) {
+ cd->u.pipefs.mnt = mntget(rpcmount);
+ cd->u.pipefs.dentry = dir;
+ } else {
sunrpc_destroy_cache_detail(cd);
ret = PTR_ERR(dir);
}
@@ -1802,8 +1805,9 @@ EXPORT_SYMBOL_GPL(sunrpc_cache_register_pipefs);
void sunrpc_cache_unregister_pipefs(struct cache_detail *cd)
{
- rpc_remove_cache_dir(cd->u.pipefs.dir);
- cd->u.pipefs.dir = NULL;
+ rpc_remove_cache_dir(cd->u.pipefs.dentry);
+ cd->u.pipefs.dentry = NULL;
+ mntput(cd->u.pipefs.mnt);
sunrpc_destroy_cache_detail(cd);
}
EXPORT_SYMBOL_GPL(sunrpc_cache_unregister_pipefs);
--
1.7.4
^ permalink raw reply related
* [PATCH v3, RESEND 04/16] sunrpc: tag svc_serv with rpc_pipefs mount point
From: Kirill A. Shutemov @ 2011-02-08 18:41 UTC (permalink / raw)
To: Trond Myklebust, J. Bruce Fields, Neil Brown
Cc: Pavel Emelyanov, linux-nfs, David S. Miller, Rob Landley, Al Viro,
containers, netdev, linux-kernel, Kirill A. Shutemov
In-Reply-To: <1297190527-19925-1-git-send-email-kas@openvz.org>
Signed-off-by: Kirill A. Shutemov <kas@openvz.org>
Reviewed-by: Rob Landley <rlandley@parallels.com>
---
include/linux/sunrpc/svc.h | 1 +
net/sunrpc/svc.c | 4 ++++
2 files changed, 5 insertions(+), 0 deletions(-)
diff --git a/include/linux/sunrpc/svc.h b/include/linux/sunrpc/svc.h
index ea29330..0cfd8e8 100644
--- a/include/linux/sunrpc/svc.h
+++ b/include/linux/sunrpc/svc.h
@@ -64,6 +64,7 @@ struct svc_pool {
*/
struct svc_serv {
struct svc_program * sv_program; /* RPC program */
+ struct vfsmount * sv_rpcmount; /* rpc_pipefs mount point*/
struct svc_stat * sv_stats; /* RPC statistics */
spinlock_t sv_lock;
unsigned int sv_nrthreads; /* # of server threads */
diff --git a/net/sunrpc/svc.c b/net/sunrpc/svc.c
index 08e05a8..370bc46 100644
--- a/net/sunrpc/svc.c
+++ b/net/sunrpc/svc.c
@@ -20,6 +20,7 @@
#include <linux/module.h>
#include <linux/kthread.h>
#include <linux/slab.h>
+#include <linux/mount.h>
#include <linux/sunrpc/types.h>
#include <linux/sunrpc/xdr.h>
@@ -27,6 +28,7 @@
#include <linux/sunrpc/svcsock.h>
#include <linux/sunrpc/clnt.h>
#include <linux/sunrpc/bc_xprt.h>
+#include <linux/sunrpc/rpc_pipe_fs.h>
#define RPCDBG_FACILITY RPCDBG_SVCDSP
@@ -371,6 +373,7 @@ __svc_create(struct svc_program *prog, unsigned int bufsize, int npools,
return NULL;
serv->sv_name = prog->pg_name;
serv->sv_program = prog;
+ serv->sv_rpcmount = mntget(init_rpc_pipefs);
serv->sv_nrthreads = 1;
serv->sv_stats = prog->pg_stats;
if (bufsize > RPCSVC_MAXPAYLOAD)
@@ -488,6 +491,7 @@ svc_destroy(struct svc_serv *serv)
if (svc_serv_is_pooled(serv))
svc_pool_map_put();
+ mntput(serv->sv_rpcmount);
svc_unregister(serv);
kfree(serv->sv_pools);
kfree(serv);
--
1.7.4
^ permalink raw reply related
* [PATCH v3, RESEND 16/16] Rework get_rpc_pipefs() and introduce put_rpc_pipefs()
From: Kirill A. Shutemov @ 2011-02-08 18:42 UTC (permalink / raw)
To: Trond Myklebust, J. Bruce Fields, Neil Brown
Cc: Pavel Emelyanov, linux-nfs, David S. Miller, Rob Landley, Al Viro,
containers, netdev, linux-kernel, Kirill A. Shutemov
In-Reply-To: <1297190527-19925-1-git-send-email-kas@openvz.org>
Now sunrpc module can be removed normally.
Signed-off-by: Kirill A. Shutemov <kas@openvz.org>
Reviewed-by: Rob Landley <rlandley@parallels.com>
---
fs/nfs/client.c | 4 +-
fs/nfs/super.c | 2 +-
fs/nfsd/nfs4callback.c | 2 +-
fs/nfsd/nfssvc.c | 4 +-
include/linux/sunrpc/rpc_pipe_fs.h | 1 +
net/sunrpc/rpc_pipe.c | 51 +++++++++++++++++++++++------------
6 files changed, 40 insertions(+), 24 deletions(-)
diff --git a/fs/nfs/client.c b/fs/nfs/client.c
index 63e3b54..118952d 100644
--- a/fs/nfs/client.c
+++ b/fs/nfs/client.c
@@ -838,7 +838,7 @@ static int nfs_init_server(struct nfs_server *server,
/* Allocate or find a client reference we can use */
clp = nfs_get_client(&cl_init);
- mntput(cl_init.rpcmount);
+ put_rpc_pipefs(cl_init.rpcmount);
if (IS_ERR(clp)) {
dprintk("<-- nfs_init_server() = error %ld\n", PTR_ERR(clp));
return PTR_ERR(clp);
@@ -1528,7 +1528,7 @@ static int nfs4_init_server(struct nfs_server *server,
&timeparms,
data->minorversion,
rpcmount);
- mntput(rpcmount);
+ put_rpc_pipefs(rpcmount);
if (error < 0)
goto error;
diff --git a/fs/nfs/super.c b/fs/nfs/super.c
index be4852b..148843e 100644
--- a/fs/nfs/super.c
+++ b/fs/nfs/super.c
@@ -1668,7 +1668,7 @@ static int nfs_try_mount(struct nfs_parsed_mount_data *args,
* to a file handle.
*/
status = nfs_mount(&request);
- mntput(request.rpcmount);
+ put_rpc_pipefs(request.rpcmount);
if (status != 0) {
dfprintk(MOUNT, "NFS: unable to mount server %s, error %d\n",
request.hostname, status);
diff --git a/fs/nfsd/nfs4callback.c b/fs/nfsd/nfs4callback.c
index 3048988..8c2ba1a 100644
--- a/fs/nfsd/nfs4callback.c
+++ b/fs/nfsd/nfs4callback.c
@@ -670,7 +670,7 @@ static int setup_callback_client(struct nfs4_client *clp, struct nfs4_cb_conn *c
return PTR_ERR(args.rpcmount);
/* Create RPC client */
client = rpc_create(&args);
- mntput(args.rpcmount);
+ put_rpc_pipefs(args.rpcmount);
if (IS_ERR(client)) {
dprintk("NFSD: couldn't create callback client: %ld\n",
PTR_ERR(client));
diff --git a/fs/nfsd/nfssvc.c b/fs/nfsd/nfssvc.c
index a10b1439..7d03e37 100644
--- a/fs/nfsd/nfssvc.c
+++ b/fs/nfsd/nfssvc.c
@@ -227,7 +227,7 @@ static int nfsd_startup(unsigned short port, int nrservs)
goto out_racache;
}
ret = lockd_up(rpcmount);
- mntput(rpcmount);
+ put_rpc_pipefs(rpcmount);
if (ret)
goto out_racache;
ret = nfs4_state_start();
@@ -346,7 +346,7 @@ int nfsd_create_serv(void)
nfsd_serv = svc_create_pooled(&nfsd_program, rpcmount,
nfsd_max_blksize, nfsd_last_thread, nfsd,
THIS_MODULE);
- mntput(rpcmount);
+ put_rpc_pipefs(rpcmount);
if (nfsd_serv == NULL)
return -ENOMEM;
diff --git a/include/linux/sunrpc/rpc_pipe_fs.h b/include/linux/sunrpc/rpc_pipe_fs.h
index a0b9c46..328b3da 100644
--- a/include/linux/sunrpc/rpc_pipe_fs.h
+++ b/include/linux/sunrpc/rpc_pipe_fs.h
@@ -45,6 +45,7 @@ RPC_I(struct inode *inode)
}
extern struct vfsmount *get_rpc_pipefs(const char *path);
+extern void put_rpc_pipefs(struct vfsmount *rpcmount);
extern int rpc_pipefs_add_destroy_cb(struct super_block *sb,
void (*destroy_cb)(void *data), void *data);
diff --git a/net/sunrpc/rpc_pipe.c b/net/sunrpc/rpc_pipe.c
index 7c16261..55ef327 100644
--- a/net/sunrpc/rpc_pipe.c
+++ b/net/sunrpc/rpc_pipe.c
@@ -33,6 +33,7 @@
#include <linux/sunrpc/cache.h>
struct vfsmount *init_rpc_pipefs __read_mostly;
+static int init_rpc_pipefs_count;
static struct file_system_type rpc_pipe_fs_type;
@@ -1005,22 +1006,35 @@ static int check_rpc_pipefs(struct vfsmount *mnt, void *arg)
return 1;
}
-struct vfsmount *get_rpc_pipefs(const char *p)
+static struct vfsmount *find_rpc_pipefs(void)
{
- int error;
struct vfsmount *rpcmount = ERR_PTR(-EINVAL);
- struct path path;
+ int err;
- if (!p) {
- iterate_mounts(check_rpc_pipefs, &rpcmount,
- current->nsproxy->mnt_ns->root);
+ iterate_mounts(check_rpc_pipefs, &rpcmount,
+ current->nsproxy->mnt_ns->root);
- if (IS_ERR(rpcmount) && (current->nsproxy->mnt_ns ==
- init_task.nsproxy->mnt_ns))
- return mntget(init_rpc_pipefs);
+ if (!IS_ERR(rpcmount))
+ return rpcmount;
+ if (current->nsproxy->mnt_ns != init_task.nsproxy->mnt_ns)
return rpcmount;
- }
+
+ err = simple_pin_fs(&rpc_pipe_fs_type, &init_rpc_pipefs,
+ &init_rpc_pipefs_count);
+ if (err)
+ return ERR_PTR(err);
+ return init_rpc_pipefs;
+}
+
+struct vfsmount *get_rpc_pipefs(const char *p)
+{
+ int error;
+ struct vfsmount *rpcmount = ERR_PTR(-EINVAL);
+ struct path path;
+
+ if (!p)
+ return find_rpc_pipefs();
error = kern_path(p, LOOKUP_FOLLOW | LOOKUP_DIRECTORY, &path);
if (error)
@@ -1033,6 +1047,15 @@ struct vfsmount *get_rpc_pipefs(const char *p)
}
EXPORT_SYMBOL_GPL(get_rpc_pipefs);
+void put_rpc_pipefs(struct vfsmount *rpcmount)
+{
+ if (rpcmount == init_rpc_pipefs)
+ simple_release_fs(&init_rpc_pipefs, &init_rpc_pipefs_count);
+ else
+ mntput(rpcmount);
+}
+EXPORT_SYMBOL_GPL(put_rpc_pipefs);
+
struct destroy_cb {
struct list_head list;
void (*callback)(void *data);
@@ -1232,16 +1255,8 @@ int register_rpc_pipefs(void)
if (err)
goto destroy_cache;
- init_rpc_pipefs = kern_mount(&rpc_pipe_fs_type);
- if (IS_ERR(init_rpc_pipefs)) {
- err = PTR_ERR(init_rpc_pipefs);
- goto unregister_fs;
- }
-
return 0;
-unregister_fs:
- unregister_filesystem(&rpc_pipe_fs_type);
destroy_cache:
kmem_cache_destroy(rpc_inode_cachep);
return err;
--
1.7.4
^ permalink raw reply related
* [PATCH v3, RESEND 15/16] sunrpc: remove global init_rpc_pipefs
From: Kirill A. Shutemov @ 2011-02-08 18:42 UTC (permalink / raw)
To: Trond Myklebust, J. Bruce Fields, Neil Brown
Cc: Pavel Emelyanov, linux-nfs, David S. Miller, Rob Landley, Al Viro,
containers, netdev, linux-kernel, Kirill A. Shutemov
In-Reply-To: <1297190527-19925-1-git-send-email-kas@openvz.org>
Replace remaining init_rpc_pipefs references with get_rpc_pipefs(NULL)
and make init_rpc_pipefs static.
Signed-off-by: Kirill A. Shutemov <kas@openvz.org>
Reviewed-by: Rob Landley <rlandley@parallels.com>
---
fs/nfsd/nfs4callback.c | 5 ++++-
fs/nfsd/nfssvc.c | 16 ++++++++++++++--
include/linux/sunrpc/rpc_pipe_fs.h | 2 --
net/sunrpc/rpc_pipe.c | 1 -
4 files changed, 18 insertions(+), 6 deletions(-)
diff --git a/fs/nfsd/nfs4callback.c b/fs/nfsd/nfs4callback.c
index 6636ab2..3048988 100644
--- a/fs/nfsd/nfs4callback.c
+++ b/fs/nfsd/nfs4callback.c
@@ -646,7 +646,6 @@ static int setup_callback_client(struct nfs4_client *clp, struct nfs4_cb_conn *c
.version = 0,
.authflavor = clp->cl_flavor,
.flags = (RPC_CLNT_CREATE_NOPING | RPC_CLNT_CREATE_QUIET),
- .rpcmount = init_rpc_pipefs,
};
struct rpc_clnt *client;
@@ -666,8 +665,12 @@ static int setup_callback_client(struct nfs4_client *clp, struct nfs4_cb_conn *c
args.prognumber = clp->cl_cb_session->se_cb_prog;
args.protocol = XPRT_TRANSPORT_BC_TCP;
}
+ args.rpcmount = get_rpc_pipefs(NULL);
+ if (IS_ERR(args.rpcmount))
+ return PTR_ERR(args.rpcmount);
/* Create RPC client */
client = rpc_create(&args);
+ mntput(args.rpcmount);
if (IS_ERR(client)) {
dprintk("NFSD: couldn't create callback client: %ld\n",
PTR_ERR(client));
diff --git a/fs/nfsd/nfssvc.c b/fs/nfsd/nfssvc.c
index dc11012..a10b1439 100644
--- a/fs/nfsd/nfssvc.c
+++ b/fs/nfsd/nfssvc.c
@@ -206,6 +206,7 @@ static bool nfsd_up = false;
static int nfsd_startup(unsigned short port, int nrservs)
{
int ret;
+ struct vfsmount *rpcmount;
if (nfsd_up)
return 0;
@@ -220,7 +221,13 @@ static int nfsd_startup(unsigned short port, int nrservs)
ret = nfsd_init_socks(port);
if (ret)
goto out_racache;
- ret = lockd_up(init_rpc_pipefs);
+ rpcmount = get_rpc_pipefs(NULL);
+ if (IS_ERR(rpcmount)) {
+ ret = PTR_ERR(rpcmount);
+ goto out_racache;
+ }
+ ret = lockd_up(rpcmount);
+ mntput(rpcmount);
if (ret)
goto out_racache;
ret = nfs4_state_start();
@@ -308,6 +315,7 @@ static void set_max_drc(void)
int nfsd_create_serv(void)
{
int err = 0;
+ struct vfsmount *rpcmount;
WARN_ON(!mutex_is_locked(&nfsd_mutex));
if (nfsd_serv) {
@@ -332,9 +340,13 @@ int nfsd_create_serv(void)
}
nfsd_reset_versions();
- nfsd_serv = svc_create_pooled(&nfsd_program, init_rpc_pipefs,
+ rpcmount = get_rpc_pipefs(NULL);
+ if (IS_ERR(rpcmount))
+ return PTR_ERR(rpcmount);
+ nfsd_serv = svc_create_pooled(&nfsd_program, rpcmount,
nfsd_max_blksize, nfsd_last_thread, nfsd,
THIS_MODULE);
+ mntput(rpcmount);
if (nfsd_serv == NULL)
return -ENOMEM;
diff --git a/include/linux/sunrpc/rpc_pipe_fs.h b/include/linux/sunrpc/rpc_pipe_fs.h
index 4a8830a..a0b9c46 100644
--- a/include/linux/sunrpc/rpc_pipe_fs.h
+++ b/include/linux/sunrpc/rpc_pipe_fs.h
@@ -44,8 +44,6 @@ RPC_I(struct inode *inode)
return container_of(inode, struct rpc_inode, vfs_inode);
}
-extern struct vfsmount *init_rpc_pipefs;
-
extern struct vfsmount *get_rpc_pipefs(const char *path);
extern int rpc_pipefs_add_destroy_cb(struct super_block *sb,
void (*destroy_cb)(void *data), void *data);
diff --git a/net/sunrpc/rpc_pipe.c b/net/sunrpc/rpc_pipe.c
index f824f33..7c16261 100644
--- a/net/sunrpc/rpc_pipe.c
+++ b/net/sunrpc/rpc_pipe.c
@@ -33,7 +33,6 @@
#include <linux/sunrpc/cache.h>
struct vfsmount *init_rpc_pipefs __read_mostly;
-EXPORT_SYMBOL_GPL(init_rpc_pipefs);
static struct file_system_type rpc_pipe_fs_type;
--
1.7.4
^ permalink raw reply related
* [PATCH v3, RESEND 14/16] sunrpc: make rpc_pipefs be mountable multiple times
From: Kirill A. Shutemov @ 2011-02-08 18:42 UTC (permalink / raw)
To: Trond Myklebust, J. Bruce Fields, Neil Brown
Cc: Pavel Emelyanov, linux-nfs-u79uwXL29TY76Z2rM5mHXA,
David S. Miller, Rob Landley, Al Viro,
containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA,
netdev-u79uwXL29TY76Z2rM5mHXA,
linux-kernel-u79uwXL29TY76Z2rM5mHXA, Kirill A. Shutemov
In-Reply-To: <1297190527-19925-1-git-send-email-kas-GEFAQzZX7r8dnm+yROfE0A@public.gmane.org>
To support containers, allow multiple independent instances of
rpc_pipefs. Use '-o newinstance' to create new of the filesystem.
The same semantics as with devpts.
Signed-off-by: Kirill A. Shutemov <kas-GEFAQzZX7r8dnm+yROfE0A@public.gmane.org>
Reviewed-by: Rob Landley <rlandley-bzQdu9zFT3WakBO8gow8eQ@public.gmane.org>
---
net/sunrpc/rpc_pipe.c | 80 ++++++++++++++++++++++++++++++++++++++++++++++++-
1 files changed, 79 insertions(+), 1 deletions(-)
diff --git a/net/sunrpc/rpc_pipe.c b/net/sunrpc/rpc_pipe.c
index 1261f27..f824f33 100644
--- a/net/sunrpc/rpc_pipe.c
+++ b/net/sunrpc/rpc_pipe.c
@@ -19,6 +19,7 @@
#include <linux/nsproxy.h>
#include <linux/mnt_namespace.h>
#include <linux/fs_struct.h>
+#include <linux/parser.h>
#include <asm/ioctls.h>
#include <linux/fs.h>
@@ -41,6 +42,49 @@ static struct kmem_cache *rpc_inode_cachep __read_mostly;
#define RPC_UPCALL_TIMEOUT (30*HZ)
+struct rpc_mount_opts {
+ int newinstance;
+};
+
+enum {
+ Opt_newinstance,
+
+ Opt_err
+};
+
+static const match_table_t tokens = {
+ {Opt_newinstance, "newinstance"},
+
+ {Opt_err, NULL}
+};
+
+static int
+parse_mount_options(char *data, struct rpc_mount_opts *opts)
+{
+ char *p;
+
+ opts->newinstance = 0;
+
+ while ((p = strsep(&data, ",")) != NULL) {
+ substring_t args[MAX_OPT_ARGS];
+ int token;
+
+ if (!*p)
+ continue;
+
+ token = match_token(p, tokens, args);
+ switch (token) {
+ case Opt_newinstance:
+ opts->newinstance = 1;
+ break;
+ default:
+ return -EINVAL;
+ }
+ }
+
+ return 0;
+}
+
static void rpc_purge_list(struct rpc_inode *rpci, struct list_head *head,
void (*destroy_msg)(struct rpc_pipe_msg *), int err)
{
@@ -1093,11 +1137,45 @@ rpc_fill_super(struct super_block *sb, void *data, int silent)
return 0;
}
+static int
+compare_rpc_mnt_sb(struct super_block *s, void *p)
+{
+ if (init_rpc_pipefs)
+ return init_rpc_pipefs->mnt_sb == s;
+ return 0;
+}
+
static struct dentry *
rpc_mount(struct file_system_type *fs_type,
int flags, const char *dev_name, void *data)
{
- return mount_single(fs_type, flags, data, rpc_fill_super);
+ int error;
+ struct rpc_mount_opts opts;
+ struct super_block *s;
+
+ error = parse_mount_options(data, &opts);
+ if (error)
+ return ERR_PTR(error);
+
+ if (opts.newinstance)
+ s = sget(fs_type, NULL, set_anon_super, NULL);
+ else
+ s = sget(fs_type, compare_rpc_mnt_sb, set_anon_super, NULL);
+
+ if (IS_ERR(s))
+ return ERR_CAST(s);
+
+ if (!s->s_root) {
+ s->s_flags = flags;
+ error = rpc_fill_super(s, data, flags & MS_SILENT ? 1 : 0);
+ if (error) {
+ deactivate_locked_super(s);
+ return ERR_PTR(error);
+ }
+ s->s_flags |= MS_ACTIVE;
+ }
+
+ return dget(s->s_root);
}
static void rpc_kill_sb(struct super_block *sb)
--
1.7.4
--
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 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