stable.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: linux-kernel@vger.kernel.org
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	stable@vger.kernel.org, Jeff Layton <jlayton@redhat.com>,
	"J. Bruce Fields" <bfields@redhat.com>
Subject: [PATCH 3.13 049/120] sunrpc: dont wait for write before allowing reads from use-gss-proxy file
Date: Tue, 11 Feb 2014 11:04:50 -0800	[thread overview]
Message-ID: <20140211184825.019351164@linuxfoundation.org> (raw)
In-Reply-To: <20140211184823.492407127@linuxfoundation.org>

3.13-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Jeff Layton <jlayton@redhat.com>

commit 1654a04cd702fd19c297c36300a6ab834cf8c072 upstream.

It doesn't make much sense to make reads from this procfile hang. As
far as I can tell, only gssproxy itself will open this file and it
never reads from it. Change it to just give the present setting of
sn->use_gss_proxy without waiting for anything.

Note that we do not want to call use_gss_proxy() in this codepath
since an inopportune read of this file could cause it to be disabled
prematurely.

Signed-off-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 net/sunrpc/auth_gss/gss_rpc_upcall.c |    2 --
 net/sunrpc/auth_gss/svcauth_gss.c    |   33 ++-------------------------------
 net/sunrpc/netns.h                   |    1 -
 3 files changed, 2 insertions(+), 34 deletions(-)

--- a/net/sunrpc/auth_gss/gss_rpc_upcall.c
+++ b/net/sunrpc/auth_gss/gss_rpc_upcall.c
@@ -137,7 +137,6 @@ void init_gssp_clnt(struct sunrpc_net *s
 {
 	mutex_init(&sn->gssp_lock);
 	sn->gssp_clnt = NULL;
-	init_waitqueue_head(&sn->gssp_wq);
 }
 
 int set_gssp_clnt(struct net *net)
@@ -154,7 +153,6 @@ int set_gssp_clnt(struct net *net)
 		sn->gssp_clnt = clnt;
 	}
 	mutex_unlock(&sn->gssp_lock);
-	wake_up(&sn->gssp_wq);
 	return ret;
 }
 
--- a/net/sunrpc/auth_gss/svcauth_gss.c
+++ b/net/sunrpc/auth_gss/svcauth_gss.c
@@ -1295,34 +1295,9 @@ static int set_gss_proxy(struct net *net
 	else
 		ret = -EBUSY;
 	spin_unlock(&use_gssp_lock);
-	wake_up(&sn->gssp_wq);
 	return ret;
 }
 
-static inline bool gssp_ready(struct sunrpc_net *sn)
-{
-	switch (sn->use_gss_proxy) {
-		case -1:
-			return false;
-		case 0:
-			return true;
-		case 1:
-			return sn->gssp_clnt;
-	}
-	WARN_ON_ONCE(1);
-	return false;
-}
-
-static int wait_for_gss_proxy(struct net *net, struct file *file)
-{
-	struct sunrpc_net *sn = net_generic(net, sunrpc_net_id);
-
-	if (file->f_flags & O_NONBLOCK && !gssp_ready(sn))
-		return -EAGAIN;
-	return wait_event_interruptible(sn->gssp_wq, gssp_ready(sn));
-}
-
-
 static ssize_t write_gssp(struct file *file, const char __user *buf,
 			 size_t count, loff_t *ppos)
 {
@@ -1355,16 +1330,12 @@ static ssize_t read_gssp(struct file *fi
 			 size_t count, loff_t *ppos)
 {
 	struct net *net = PDE_DATA(file_inode(file));
+	struct sunrpc_net *sn = net_generic(net, sunrpc_net_id);
 	unsigned long p = *ppos;
 	char tbuf[10];
 	size_t len;
-	int ret;
-
-	ret = wait_for_gss_proxy(net, file);
-	if (ret)
-		return ret;
 
-	snprintf(tbuf, sizeof(tbuf), "%d\n", use_gss_proxy(net));
+	snprintf(tbuf, sizeof(tbuf), "%d\n", sn->use_gss_proxy);
 	len = strlen(tbuf);
 	if (p >= len)
 		return 0;
--- a/net/sunrpc/netns.h
+++ b/net/sunrpc/netns.h
@@ -26,7 +26,6 @@ struct sunrpc_net {
 	unsigned int rpcb_is_af_local : 1;
 
 	struct mutex gssp_lock;
-	wait_queue_head_t gssp_wq;
 	struct rpc_clnt *gssp_clnt;
 	int use_gss_proxy;
 	int pipe_version;



  parent reply	other threads:[~2014-02-11 19:04 UTC|newest]

Thread overview: 126+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-11 19:04 [PATCH 3.13 000/120] 3.13.3-stable review Greg Kroah-Hartman
2014-02-11 19:04 ` [PATCH 3.13 001/120] mei: mei_hbm_dispatch() returns void Greg Kroah-Hartman
2014-02-11 19:04 ` [PATCH 3.13 002/120] SELinux: Fix memory leak upon loading policy Greg Kroah-Hartman
2014-02-11 19:04 ` [PATCH 3.13 003/120] tracing: Have trace buffer point back to trace_array Greg Kroah-Hartman
2014-02-11 19:04 ` [PATCH 3.13 004/120] tracing: Check if tracing is enabled in trace_puts() Greg Kroah-Hartman
2014-02-11 19:04 ` [PATCH 3.13 005/120] arch/sh/kernel/kgdb.c: add missing #include <linux/sched.h> Greg Kroah-Hartman
2014-02-11 19:04 ` [PATCH 3.13 006/120] intel-iommu: fix off-by-one in pagetable freeing Greg Kroah-Hartman
2014-02-11 19:04 ` [PATCH 3.13 007/120] Revert "EISA: Initialize device before its resources" Greg Kroah-Hartman
2014-02-11 19:04 ` [PATCH 3.13 008/120] fuse: fix pipe_buf_operations Greg Kroah-Hartman
2014-02-11 19:04 ` [PATCH 3.13 009/120] audit: reset audit backlog wait time after error recovery Greg Kroah-Hartman
2014-02-11 19:04 ` [PATCH 3.13 010/120] audit: correct a type mismatch in audit_syscall_exit() Greg Kroah-Hartman
2014-02-11 19:04 ` [PATCH 3.13 011/120] xen/pvhvm: If xen_platform_pci=0 is set dont blow up (v4) Greg Kroah-Hartman
2014-02-11 19:04 ` [PATCH 3.13 012/120] mm/memory-failure.c: shift page lock from head page to tail page after thp split Greg Kroah-Hartman
2014-02-11 19:04 ` [PATCH 3.13 013/120] mm/memcg: iteration skip memcgs not yet fully initialized Greg Kroah-Hartman
2014-02-11 19:04 ` [PATCH 3.13 014/120] mm/page-writeback.c: fix dirty_balance_reserve subtraction from dirtyable memory Greg Kroah-Hartman
2014-02-11 19:04 ` [PATCH 3.13 015/120] mm/page-writeback.c: do not count anon pages as " Greg Kroah-Hartman
2014-02-11 19:04 ` [PATCH 3.13 016/120] memcg: fix endless loop caused by mem_cgroup_iter Greg Kroah-Hartman
2014-02-11 19:04 ` [PATCH 3.13 017/120] memcg: fix css reference leak and endless loop in mem_cgroup_iter Greg Kroah-Hartman
2014-02-11 19:04 ` [PATCH 3.13 018/120] mm: ignore VM_SOFTDIRTY on VMA merging Greg Kroah-Hartman
2014-02-11 19:04 ` [PATCH 3.13 019/120] mm: dont lose the SOFT_DIRTY flag on mprotect Greg Kroah-Hartman
2014-02-11 19:04 ` [PATCH 3.13 020/120] mmc: fix host release issue after discard operation Greg Kroah-Hartman
2014-02-11 19:04 ` [PATCH 3.13 021/120] mmc: atmel-mci: fix timeout errors in SDIO mode when using DMA Greg Kroah-Hartman
2014-02-11 19:04 ` [PATCH 3.13 022/120] mmc: core: sd: implement proper support for sd3.0 au sizes Greg Kroah-Hartman
2014-02-11 19:04 ` [PATCH 3.13 023/120] ARM: orion: provide C-style interrupt handler for MULTI_IRQ_HANDLER Greg Kroah-Hartman
2014-02-11 19:04 ` [PATCH 3.13 024/120] ARM: mvebu: Fix kernel hang in mvebu_soc_id_init() when of_iomap failed Greg Kroah-Hartman
2014-02-11 19:04 ` [PATCH 3.13 025/120] slub: Fix calculation of cpu slabs Greg Kroah-Hartman
2014-02-11 19:04 ` [PATCH 3.13 026/120] turbostat: Dont put unprocessed uapi headers in the include path Greg Kroah-Hartman
2014-02-11 19:04 ` [PATCH 3.13 028/120] ACPI / init: Flag use of ACPI and ACPI idioms for power supplies to regulator API Greg Kroah-Hartman
2014-02-11 19:04 ` [PATCH 3.13 029/120] compat: fix sys_fanotify_mark Greg Kroah-Hartman
2014-02-11 19:04 ` [PATCH 3.13 030/120] fs/compat: fix parameter handling for compat readv/writev syscalls Greg Kroah-Hartman
2014-02-11 19:04 ` [PATCH 3.13 031/120] fs/compat: fix lookup_dcookie() parameter handling Greg Kroah-Hartman
2014-02-11 19:04 ` [PATCH 3.13 032/120] tile: remove compat_sys_lookup_dcookie declaration to fix compile error Greg Kroah-Hartman
2014-02-11 19:04 ` [PATCH 3.13 033/120] lib/genalloc.c: add check gen_pool_dma_alloc() if dma pointer is not NULL Greg Kroah-Hartman
2014-02-11 19:04 ` [PATCH 3.13 034/120] mtd: mxc_nand: remove duplicated ecc_stats counting Greg Kroah-Hartman
2014-02-11 19:04 ` [PATCH 3.13 035/120] ore: Fix wrong math in allocation of per device BIO Greg Kroah-Hartman
2014-02-11 19:04 ` [PATCH 3.13 036/120] xtensa: xtfpga: fix definitions of platform devices Greg Kroah-Hartman
2014-02-11 19:04 ` [PATCH 3.13 037/120] IB/qib: Fix QP check when looping back to/from QP1 Greg Kroah-Hartman
2014-02-11 19:04 ` [PATCH 3.13 038/120] spi/bcm63xx: dont substract prepend length from total length Greg Kroah-Hartman
2014-02-11 19:04 ` [PATCH 3.13 039/120] spidev: fix hang when transfer_one_message fails Greg Kroah-Hartman
2014-02-11 19:04 ` [PATCH 3.13 040/120] spi/pxa2xx: initialize DMA channels to -1 to prevent inadvertent match Greg Kroah-Hartman
2014-02-11 19:04 ` [PATCH 3.13 041/120] NFSv4: OPEN must handle the NFS4ERR_IO return code correctly Greg Kroah-Hartman
2014-02-11 19:04 ` [PATCH 3.13 042/120] nfs4.1: properly handle ENOTSUP in SECINFO_NO_NAME Greg Kroah-Hartman
2014-02-11 19:04 ` [PATCH 3.13 044/120] NFSv4.1: Handle errors correctly in nfs41_walk_client_list Greg Kroah-Hartman
2014-02-11 19:04 ` [PATCH 3.13 045/120] nfs4: fix discover_server_trunking use after free Greg Kroah-Hartman
2014-02-11 19:04 ` [PATCH 3.13 046/120] pnfs: Proper delay for NFS4ERR_RECALLCONFLICT in layout_get_done Greg Kroah-Hartman
2014-02-11 19:04 ` [PATCH 3.13 047/120] NFSv4: Fix a slot leak in nfs40_sequence_done Greg Kroah-Hartman
2014-02-11 19:04 ` [PATCH 3.13 048/120] sunrpc: Fix infinite loop in RPC state machine Greg Kroah-Hartman
2014-02-11 19:04 ` Greg Kroah-Hartman [this message]
2014-02-11 19:04 ` [PATCH 3.13 050/120] dm thin: fix discard support to a previously shared block Greg Kroah-Hartman
2014-02-11 19:04 ` [PATCH 3.13 051/120] dm thin: initialize dm_thin_new_mapping returned by get_next_mapping Greg Kroah-Hartman
2014-02-11 19:04 ` [PATCH 3.13 052/120] dm thin: fix set_pool_mode exposed pool operation races Greg Kroah-Hartman
2014-02-11 19:04 ` [PATCH 3.13 053/120] dm: wait until embedded kobject is released before destroying a device Greg Kroah-Hartman
2014-02-11 19:04 ` [PATCH 3.13 054/120] dm space map common: make sure new space is used during extend Greg Kroah-Hartman
2014-02-11 19:04 ` [PATCH 3.13 055/120] dm space map metadata: fix extending the space map Greg Kroah-Hartman
2014-02-11 19:04 ` [PATCH 3.13 056/120] dm space map metadata: fix bug in resizing of thin metadata Greg Kroah-Hartman
2014-02-11 19:04 ` [PATCH 3.13 058/120] drm/radeon/dpm: disable mclk switching on desktop RV770 Greg Kroah-Hartman
2014-02-11 19:05 ` [PATCH 3.13 060/120] percpu_ida: Make percpu_ida_alloc + callers accept task state bitmask Greg Kroah-Hartman
2014-02-11 19:05 ` [PATCH 3.13 061/120] iscsi-target: Fix connection reset hang with percpu_ida_alloc Greg Kroah-Hartman
2014-02-11 19:05 ` [PATCH 3.13 062/120] numa: add a sysctl for numa_balancing Greg Kroah-Hartman
2014-02-11 19:05 ` [PATCH 3.13 063/120] mm: numa: initialise numa balancing after jump label initialisation Greg Kroah-Hartman
2014-02-11 19:05 ` [PATCH 3.13 064/120] mm, oom: base root bonus on current usage Greg Kroah-Hartman
2014-02-11 19:05 ` [PATCH 3.13 065/120] media: media: v4l2-dev: fix video device index assignment Greg Kroah-Hartman
2014-02-11 19:05 ` [PATCH 3.13 066/120] media: anysee: fix non-working E30 Combo Plus DVB-T Greg Kroah-Hartman
2014-02-11 19:05 ` [PATCH 3.13 067/120] [media] dib8000: make 32 bits read atomic Greg Kroah-Hartman
2014-02-11 19:05 ` [PATCH 3.13 068/120] [media] media: s5p_mfc: remove s5p_mfc_get_node_type() function Greg Kroah-Hartman
2014-02-11 19:05 ` [PATCH 3.13 069/120] [media] it913x: Add support for Avermedia H335 id 0x0335 Greg Kroah-Hartman
2014-02-11 19:05 ` [PATCH 3.13 070/120] [media] nxt200x: increase write buffer size Greg Kroah-Hartman
2014-02-11 19:05 ` [PATCH 3.13 071/120] [media] dib8000: fix regression with dib807x Greg Kroah-Hartman
2014-02-11 19:05 ` [PATCH 3.13 072/120] [media] m88rs2000: add m88rs2000_set_carrieroffset Greg Kroah-Hartman
2014-02-11 19:05 ` [PATCH 3.13 073/120] [media] m88rs2000: set symbol rate accurately Greg Kroah-Hartman
2014-02-11 19:05 ` [PATCH 3.13 075/120] Revert "drm/radeon: disable CIK CP semaphores for now" Greg Kroah-Hartman
2014-02-11 19:05 ` [PATCH 3.13 076/120] drm/radeon: disable dpm on BTC Greg Kroah-Hartman
2014-02-11 19:05 ` [PATCH 3.13 077/120] drm/radeon: disable ss on DP for DCE3.x Greg Kroah-Hartman
2014-02-11 19:05 ` [PATCH 3.13 078/120] drm/radeon: fix surface sync in fence on cayman (v2) Greg Kroah-Hartman
2014-02-11 19:05 ` [PATCH 3.13 079/120] drm/radeon: set the full cache bit for fences on r7xx+ Greg Kroah-Hartman
2014-02-11 19:05 ` [PATCH 3.13 080/120] drm/radeon: add UVD support for OLAND Greg Kroah-Hartman
2014-02-11 19:05 ` [PATCH 3.13 081/120] drm/radeon/runpm: dont runtime suspend non-PX cards Greg Kroah-Hartman
2014-02-11 19:05 ` [PATCH 3.13 082/120] drm/radeon: fix DAC interrupt handling on DCE5+ Greg Kroah-Hartman
2014-02-11 19:05 ` [PATCH 3.13 083/120] drm/radeon: set si_notify_smc_display_change properly Greg Kroah-Hartman
2014-02-11 19:05 ` [PATCH 3.13 084/120] drm/radeon/DCE4+: clear bios scratch dpms bit (v2) Greg Kroah-Hartman
2014-02-11 19:05 ` [PATCH 3.13 085/120] drm/radeon/dce8: workaround for atom BlankCrtc table Greg Kroah-Hartman
2014-02-11 19:05 ` [PATCH 3.13 086/120] dm sysfs: fix a module unload race Greg Kroah-Hartman
2014-02-11 19:05 ` [PATCH 3.13 087/120] target: Fix percpu_ref_put race in transport_lun_remove_cmd Greg Kroah-Hartman
2014-02-11 19:05 ` [PATCH 3.13 088/120] drm/nouveau: fix m2mf copy to tiled gart Greg Kroah-Hartman
2014-02-11 19:05 ` [PATCH 3.13 089/120] drm/nouveau/falcon: use vmalloc to create firwmare copies Greg Kroah-Hartman
2014-02-11 19:05 ` [PATCH 3.13 090/120] drm/nouveau: hold mutex while syncing to kernel channel Greg Kroah-Hartman
2014-02-11 19:05 ` [PATCH 3.13 091/120] drm/nouveau: fix lock unbalance in nouveau_crtc_page_flip Greg Kroah-Hartman
2014-02-11 19:05 ` [PATCH 3.13 092/120] drm/i915: Flush outstanding requests before allocating new seqno Greg Kroah-Hartman
2014-02-11 19:05 ` [PATCH 3.13 093/120] drm/i915: Fix the offset issue for the stolen GEM objects Greg Kroah-Hartman
2014-02-11 19:05 ` [PATCH 3.13 094/120] drm/i915: VLV2 - Fix hotplug detect bits Greg Kroah-Hartman
2014-02-11 19:05 ` [PATCH 3.13 095/120] i915: remove pm_qos request on error Greg Kroah-Hartman
2014-02-11 19:05 ` [PATCH 3.13 097/120] drm/cirrus: correct register values for 16bpp Greg Kroah-Hartman
2014-02-11 19:05 ` [PATCH 3.13 098/120] drm/gem: Always initialize the gem object in object_init Greg Kroah-Hartman
2014-02-11 19:05 ` [PATCH 3.13 099/120] drm/rcar-du: Update plane pitch in .mode_set_base() operation Greg Kroah-Hartman
2014-02-11 19:05 ` [PATCH 3.13 100/120] drm/gma500: Lock struct_mutex around cursor updates Greg Kroah-Hartman
2014-02-11 19:05 ` [PATCH 3.13 101/120] drm: ast,cirrus,mgag200: use drm_can_sleep Greg Kroah-Hartman
2014-02-11 19:05 ` [PATCH 3.13 102/120] drm/vmwgfx: Fix the driver for large dma addresses Greg Kroah-Hartman
2014-02-11 19:05 ` [PATCH 3.13 103/120] drm/vmwgfx: Fix regression caused by "drm/ttm: make ttm reservation calls behave like reservation calls" Greg Kroah-Hartman
2014-02-11 19:05 ` [PATCH 3.13 104/120] drm/mgag200: fix oops in cursor code Greg Kroah-Hartman
2014-02-11 19:05 ` [PATCH 3.13 105/120] drm/mgag200: fix typo causing bw limits to be ignored on some chips Greg Kroah-Hartman
2014-02-11 19:05 ` [PATCH 3.13 106/120] drm/mgag200,ast,cirrus: fix regression with drm_can_sleep conversion Greg Kroah-Hartman
2014-02-11 19:05 ` [PATCH 3.13 107/120] ftrace: Synchronize setting function_trace_op with ftrace_trace_function Greg Kroah-Hartman
2014-02-11 19:05 ` [PATCH 3.13 108/120] ftrace: Fix synchronization location disabling and freeing ftrace_ops Greg Kroah-Hartman
2014-02-11 19:05 ` [PATCH 3.13 109/120] ftrace: Have function graph only trace based on global_ops filters Greg Kroah-Hartman
2014-02-11 19:05 ` [PATCH 3.13 110/120] powerpc/thp: Fix crash on mremap Greg Kroah-Hartman
2014-02-11 19:05 ` [PATCH 3.13 111/120] powerpc/mm: Fix compile error of pgtable-ppc64.h Greg Kroah-Hartman
2014-02-11 19:05 ` [PATCH 3.13 112/120] timekeeping: Fix lost updates to tai adjustment Greg Kroah-Hartman
2014-02-11 19:05 ` [PATCH 3.13 113/120] timekeeping: Fix potential lost pv notification of time change Greg Kroah-Hartman
2014-02-11 19:05 ` [PATCH 3.13 114/120] timekeeping: Avoid possible deadlock from clock_was_set_delayed Greg Kroah-Hartman
2014-02-11 19:05 ` [PATCH 3.13 115/120] 3.13.y: timekeeping: Fix clock_set/clock_was_set think-o Greg Kroah-Hartman
2014-02-11 19:05 ` [PATCH 3.13 116/120] timekeeping: Fix CLOCK_TAI timer/nanosleep delays Greg Kroah-Hartman
2014-02-11 19:05 ` [PATCH 3.13 117/120] timekeeping: Fix missing timekeeping_update in suspend path Greg Kroah-Hartman
2014-02-11 19:05 ` [PATCH 3.13 118/120] rtc-cmos: Add an alarm disable quirk Greg Kroah-Hartman
2014-02-11 19:06 ` [PATCH 3.13 119/120] mmc: sdhci-pci: Fix BYT sd card getting stuck in runtime suspend Greg Kroah-Hartman
2014-02-11 19:06 ` [PATCH 3.13 120/120] mmc: sdhci-pci: Fix possibility of chip->fixes being null Greg Kroah-Hartman
2014-02-12  4:29 ` [PATCH 3.13 000/120] 3.13.3-stable review Guenter Roeck
2014-02-12 16:27   ` Greg Kroah-Hartman
2014-02-12 16:45     ` Guenter Roeck
2014-02-12  8:32 ` Willy Tarreau
2014-02-12 16:26   ` Greg Kroah-Hartman
2014-02-12 16:29     ` Willy Tarreau
2014-02-12 20:21       ` Willy Tarreau
2014-02-12 18:49 ` Shuah Khan
2014-02-12 19:16   ` Greg Kroah-Hartman
2014-02-12 23:11 ` Andre Tomt
2014-02-13 11:04 ` Jörg-Volker Peetz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20140211184825.019351164@linuxfoundation.org \
    --to=gregkh@linuxfoundation.org \
    --cc=bfields@redhat.com \
    --cc=jlayton@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=stable@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).