mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Kamal Mostafa <kamal@canonical.com>
To: linux-kernel@vger.kernel.org, stable@vger.kernel.org,
	kernel-team@lists.ubuntu.com
Cc: "J. Bruce Fields" <bfields@fieldses.org>,
	Jeff Layton <jlayton@redhat.com>,
	Kamal Mostafa <kamal@canonical.com>
Subject: [PATCH 3.8 028/121] locks: allow __break_lease to sleep even when break_time is 0
Date: Tue, 17 Jun 2014 09:13:41 -0700	[thread overview]
Message-ID: <1403021714-16320-29-git-send-email-kamal@canonical.com> (raw)
In-Reply-To: <1403021714-16320-1-git-send-email-kamal@canonical.com>

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

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

From: Jeff Layton <jlayton@redhat.com>

commit f1c6bb2cb8b81013e8979806f8e15e3d53efb96d upstream.

A fl->fl_break_time of 0 has a special meaning to the lease break code
that basically means "never break the lease". knfsd uses this to ensure
that leases don't disappear out from under it.

Unfortunately, the code in __break_lease can end up passing this value
to wait_event_interruptible as a timeout, which prevents it from going
to sleep at all. This makes __break_lease to spin in a tight loop and
causes soft lockups.

Fix this by ensuring that we pass a minimum value of 1 as a timeout
instead.

Cc: J. Bruce Fields <bfields@fieldses.org>
Reported-by: Terry Barnaby <terry1@beam.ltd.uk>
Signed-off-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 fs/locks.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/fs/locks.c b/fs/locks.c
index a94e331..7e5fa22 100644
--- a/fs/locks.c
+++ b/fs/locks.c
@@ -1243,11 +1243,10 @@ int __break_lease(struct inode *inode, unsigned int mode)
 
 restart:
 	break_time = flock->fl_break_time;
-	if (break_time != 0) {
+	if (break_time != 0)
 		break_time -= jiffies;
-		if (break_time == 0)
-			break_time++;
-	}
+	if (break_time == 0)
+		break_time++;
 	locks_insert_block(flock, new_fl);
 	unlock_flocks();
 	error = wait_event_interruptible_timeout(new_fl->fl_wait,
-- 
1.9.1


      parent reply	other threads:[~2014-06-17 16:16 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-17 16:13 [3.8.y.z extended stable] Linux 3.8.13.24 stable review Kamal Mostafa
2014-06-17 16:13 ` [PATCH 3.8 001/121] ACPI / EC: Clear stale EC events on Samsung systems Kamal Mostafa
2014-06-17 16:13 ` [PATCH 3.8 002/121] ACPI / EC: Process rather than discard events in acpi_ec_clear Kamal Mostafa
2014-06-17 16:13 ` [PATCH 3.8 003/121] mac80211: fix software remain-on-channel implementation Kamal Mostafa
2014-06-17 16:13 ` [PATCH 3.8 004/121] mac80211: exclude AP_VLAN interfaces from tx power calculation Kamal Mostafa
2014-06-17 16:13 ` [PATCH 3.8 005/121] parisc: fix epoll_pwait syscall on compat kernel Kamal Mostafa
2014-06-17 16:13 ` [PATCH 3.8 006/121] ALSA: hda/realtek - Add support of ALC288 codec Kamal Mostafa
2014-06-17 16:13 ` [PATCH 3.8 007/121] user namespace: fix incorrect memory barriers Kamal Mostafa
2014-06-17 16:13 ` [PATCH 3.8 008/121] mlx4_en: don't use napi_synchronize inside mlx4_en_netpoll Kamal Mostafa
2014-06-17 16:13 ` [PATCH 3.8 009/121] mei: ignore client writing state during cb completion Kamal Mostafa
2014-06-17 16:13 ` [PATCH 3.8 010/121] staging: r8712u: Fix case where ethtype was never obtained and always be checked against 0 Kamal Mostafa
2014-06-17 16:13 ` [PATCH 3.8 011/121] USB: serial: ftdi_sio: add id for Brainboxes serial cards Kamal Mostafa
2014-06-17 16:13 ` [PATCH 3.8 012/121] Revert "USB: serial: add usbid for dell wwan card to sierra.c" Kamal Mostafa
2014-06-17 16:13 ` [PATCH 3.8 013/121] usb: option driver, add support for Telit UE910v2 Kamal Mostafa
2014-06-17 16:13 ` [PATCH 3.8 014/121] USB: cp210x: Add 8281 (Nanotec Plug & Drive) Kamal Mostafa
2014-06-17 16:13 ` [PATCH 3.8 015/121] USB: pl2303: add ids for Hewlett-Packard HP POS pole displays Kamal Mostafa
2014-06-17 16:13 ` [PATCH 3.8 016/121] USB: usb_wwan: fix handling of missing bulk endpoints Kamal Mostafa
2014-06-17 16:13 ` [PATCH 3.8 017/121] USB: fix crash during hotplug of PCI USB controller card Kamal Mostafa
2014-06-17 16:13 ` [PATCH 3.8 018/121] USB: cdc-acm: Remove Motorola/Telit H24 serial interfaces from ACM driver Kamal Mostafa
2014-06-17 16:13 ` [PATCH 3.8 019/121] drm/radeon: memory leak on bo reservation failure. v2 Kamal Mostafa
2014-06-17 16:13 ` [PATCH 3.8 020/121] drm/radeon/si: make sure mc ucode is loaded before checking the size Kamal Mostafa
2014-06-17 16:13 ` [PATCH 3.8 021/121] mm/hugetlb.c: add cond_resched_lock() in return_unused_surplus_pages() Kamal Mostafa
2014-06-17 16:13 ` [PATCH 3.8 022/121] mm: use paravirt friendly ops for NUMA hinting ptes Kamal Mostafa
2014-06-17 16:13 ` [PATCH 3.8 023/121] iio: querying buffer scan_mask should return 0/1 Kamal Mostafa
2014-06-17 16:13 ` [PATCH 3.8 024/121] pata_at91: fix ata_host_activate() failure handling Kamal Mostafa
2014-06-17 16:13 ` [PATCH 3.8 025/121] ext4: note the error in ext4_end_bio() Kamal Mostafa
2014-06-17 16:13 ` [PATCH 3.8 026/121] ext4: fix jbd2 warning under heavy xattr load Kamal Mostafa
2014-06-17 16:13 ` [PATCH 3.8 027/121] ext4: use i_size_read in ext4_unaligned_aio() Kamal Mostafa
2014-06-17 16:13 ` Kamal Mostafa [this message]

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=1403021714-16320-29-git-send-email-kamal@canonical.com \
    --to=kamal@canonical.com \
    --cc=bfields@fieldses.org \
    --cc=jlayton@redhat.com \
    --cc=kernel-team@lists.ubuntu.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

all inboxes | Powered by JetHome®