From: Kamal Mostafa <kamal@canonical.com>
To: linux-kernel@vger.kernel.org, stable@vger.kernel.org,
kernel-team@lists.ubuntu.com
Cc: Peng Tao <tao.peng@primarydata.com>,
Trond Myklebust <trond.myklebust@primarydata.com>,
Kamal Mostafa <kamal@canonical.com>
Subject: [PATCH 3.13.y-ckt 074/121] nfs: fix pnfs direct write memory leak
Date: Tue, 2 Dec 2014 11:19:13 -0800 [thread overview]
Message-ID: <1417548000-1794-75-git-send-email-kamal@canonical.com> (raw)
In-Reply-To: <1417548000-1794-1-git-send-email-kamal@canonical.com>
3.13.11-ckt12 -stable review patch. If anyone has any objections, please let me know.
------------------
From: Peng Tao <tao.peng@primarydata.com>
commit 8c393f9a721c30a030049a680e1bf896669bb279 upstream.
For pNFS direct writes, layout driver may dynamically allocate ds_cinfo.buckets.
So we need to take care to free them when freeing dreq.
Ideally this needs to be done inside layout driver where ds_cinfo.buckets
are allocated. But buckets are attached to dreq and reused across LD IO iterations.
So I feel it's OK to free them in the generic layer.
Signed-off-by: Peng Tao <tao.peng@primarydata.com>
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
fs/nfs/direct.c | 1 +
include/linux/nfs_xdr.h | 11 +++++++++++
2 files changed, 12 insertions(+)
diff --git a/fs/nfs/direct.c b/fs/nfs/direct.c
index d71d66c..a74e888 100644
--- a/fs/nfs/direct.c
+++ b/fs/nfs/direct.c
@@ -178,6 +178,7 @@ static void nfs_direct_req_free(struct kref *kref)
{
struct nfs_direct_req *dreq = container_of(kref, struct nfs_direct_req, kref);
+ nfs_free_pnfs_ds_cinfo(&dreq->ds_cinfo);
if (dreq->l_ctx != NULL)
nfs_put_lock_context(dreq->l_ctx);
if (dreq->ctx != NULL)
diff --git a/include/linux/nfs_xdr.h b/include/linux/nfs_xdr.h
index 5624e4e..53988cb 100644
--- a/include/linux/nfs_xdr.h
+++ b/include/linux/nfs_xdr.h
@@ -1247,11 +1247,22 @@ struct nfs41_free_stateid_res {
unsigned int status;
};
+static inline void
+nfs_free_pnfs_ds_cinfo(struct pnfs_ds_commit_info *cinfo)
+{
+ kfree(cinfo->buckets);
+}
+
#else
struct pnfs_ds_commit_info {
};
+static inline void
+nfs_free_pnfs_ds_cinfo(struct pnfs_ds_commit_info *cinfo)
+{
+}
+
#endif /* CONFIG_NFS_V4_1 */
struct nfs_page;
--
1.9.1
next prev parent reply other threads:[~2014-12-02 19:39 UTC|newest]
Thread overview: 124+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-12-02 19:17 [3.13.y-ckt stable] Linux 3.13.11-ckt12 stable review Kamal Mostafa
2014-12-02 19:18 ` [PATCH 3.13.y-ckt 001/121] ALSA: usb-audio: Fix device_del() sysfs warnings at disconnect Kamal Mostafa
2014-12-02 19:18 ` [PATCH 3.13.y-ckt 002/121] [3.13-stable only] regmap: fix kernel hang on regmap_bulk_write with zero val_count Kamal Mostafa
2014-12-02 19:18 ` [PATCH 3.13.y-ckt 003/121] ALSA: hda - Add mute LED pin quirk for HP 15 touchsmart Kamal Mostafa
2014-12-02 19:18 ` [PATCH 3.13.y-ckt 004/121] Revert "ALSA: hda - restore BCLK M/N values when resuming HSW/BDW display controller" Kamal Mostafa
2014-12-02 19:18 ` [PATCH 3.13.y-ckt 005/121] drm/i915, HD-audio: Don't continue probing when nomodeset is given Kamal Mostafa
2014-12-02 19:18 ` [PATCH 3.13.y-ckt 006/121] drm/i915: provide interface for audio driver to query cdclk Kamal Mostafa
2014-12-02 19:18 ` [PATCH 3.13.y-ckt 007/121] ALSA: hda - restore BCLK M/N value as per CDCLK for HSW/BDW display HDA controller Kamal Mostafa
2014-12-02 19:18 ` [PATCH 3.13.y-ckt 008/121] rcu: Make callers awaken grace-period kthread Kamal Mostafa
2014-12-02 19:18 ` [PATCH 3.13.y-ckt 009/121] rcu: Use rcu_gp_kthread_wake() to wake up grace period kthreads Kamal Mostafa
2014-12-02 19:18 ` [PATCH 3.13.y-ckt 010/121] net: sctp: fix NULL pointer dereference in af->from_addr_param on malformed packet Kamal Mostafa
2014-12-02 19:18 ` [PATCH 3.13.y-ckt 011/121] KVM: x86: Don't report guest userspace emulation error to userspace Kamal Mostafa
2014-12-02 19:18 ` [PATCH 3.13.y-ckt 012/121] [media] ttusb-dec: buffer overflow in ioctl Kamal Mostafa
2014-12-02 19:18 ` [PATCH 3.13.y-ckt 013/121] arm64: __clear_user: handle exceptions on strb Kamal Mostafa
2014-12-02 19:18 ` [PATCH 3.13.y-ckt 014/121] ARM: pxa: fix hang on startup with DEBUG_LL Kamal Mostafa
2014-12-02 19:18 ` [PATCH 3.13.y-ckt 015/121] samsung-laptop: Add broken-acpi-video quirk for NC210/NC110 Kamal Mostafa
2014-12-02 19:18 ` [PATCH 3.13.y-ckt 016/121] acer-wmi: Add Aspire 5741 to video_vendor_dmi_table Kamal Mostafa
2014-12-02 19:18 ` [PATCH 3.13.y-ckt 017/121] acer-wmi: Add acpi_backlight=video quirk for the Acer KAV80 Kamal Mostafa
2014-12-02 19:18 ` [PATCH 3.13.y-ckt 018/121] rbd: Fix error recovery in rbd_obj_read_sync() Kamal Mostafa
2014-12-02 19:18 ` [PATCH 3.13.y-ckt 019/121] [media] ds3000: fix LNB supply voltage on Tevii S480 on initialization Kamal Mostafa
2014-12-02 19:18 ` [PATCH 3.13.y-ckt 020/121] powerpc: do_notify_resume can be called with bad thread_info flags argument Kamal Mostafa
2014-12-02 19:18 ` [PATCH 3.13.y-ckt 021/121] USB: kobil_sct: fix non-atomic allocation in write path Kamal Mostafa
2014-12-02 19:18 ` [PATCH 3.13.y-ckt 022/121] USB: opticon: " Kamal Mostafa
2014-12-02 19:18 ` [PATCH 3.13.y-ckt 023/121] regulator: max77693: Fix use of uninitialized regulator config Kamal Mostafa
2014-12-02 19:18 ` [PATCH 3.13.y-ckt 024/121] USB: cdc-acm: add device id for GW Instek AFG-2225 Kamal Mostafa
2014-12-02 19:18 ` [PATCH 3.13.y-ckt 025/121] usb: Do not allow usb_alloc_streams on unconfigured devices Kamal Mostafa
2014-12-02 19:18 ` [PATCH 3.13.y-ckt 026/121] usb-storage: handle a skipped data phase Kamal Mostafa
2014-12-02 19:18 ` [PATCH 3.13.y-ckt 027/121] xhci: Switch only Intel Lynx Point-LP ports to EHCI on shutdown Kamal Mostafa
2014-12-02 19:18 ` [PATCH 3.13.y-ckt 028/121] xhci: no switching back on non-ULT Haswell Kamal Mostafa
2014-12-02 19:18 ` [PATCH 3.13.y-ckt 029/121] of: Fix overflow bug in string property parsing functions Kamal Mostafa
2014-12-02 19:18 ` [PATCH 3.13.y-ckt 030/121] spi: fsl-dspi: Fix CTAR selection Kamal Mostafa
2014-12-02 19:18 ` [PATCH 3.13.y-ckt 031/121] Btrfs: fix kfree on list_head in btrfs_lookup_csums_range error cleanup Kamal Mostafa
2014-12-02 19:18 ` [PATCH 3.13.y-ckt 032/121] staging:iio:ade7758: Fix NULL pointer deref when enabling buffer Kamal Mostafa
2014-12-02 19:18 ` [PATCH 3.13.y-ckt 033/121] staging:iio:ade7758: Fix check if channels are enabled in prenable Kamal Mostafa
2014-12-02 19:18 ` [PATCH 3.13.y-ckt 034/121] staging:iio:ade7758: Remove "raw" from channel name Kamal Mostafa
2014-12-02 19:18 ` [PATCH 3.13.y-ckt 035/121] USB: cdc-acm: only raise DTR on transitions from B0 Kamal Mostafa
2014-12-02 19:18 ` [PATCH 3.13.y-ckt 036/121] serial: Fix divide-by-zero fault in uart_get_divisor() Kamal Mostafa
2014-12-02 19:18 ` [PATCH 3.13.y-ckt 037/121] tty: Fix high cpu load if tty is unreleaseable Kamal Mostafa
2014-12-02 19:18 ` [PATCH 3.13.y-ckt 038/121] tty: Prevent "read/write wait queue active!" log flooding Kamal Mostafa
2014-12-02 19:18 ` [PATCH 3.13.y-ckt 039/121] tty/vt: don't set font mappings on vc not supporting this Kamal Mostafa
2014-12-02 19:18 ` [PATCH 3.13.y-ckt 040/121] spi: pxa2xx: toggle clocks on suspend if not disabled by runtime PM Kamal Mostafa
2014-12-02 19:18 ` [PATCH 3.13.y-ckt 041/121] sysfs: driver core: Fix glue dir race condition by gdp_mutex Kamal Mostafa
2014-12-02 19:18 ` [PATCH 3.13.y-ckt 042/121] i2c: at91: don't account as iowait Kamal Mostafa
2014-12-02 19:18 ` [PATCH 3.13.y-ckt 043/121] nfsd: don't try to reuse an expired DRC entry off the list Kamal Mostafa
2014-12-02 19:18 ` [PATCH 3.13.y-ckt 044/121] nfsd: don't halt scanning the DRC LRU list when there's an RC_INPROG entry Kamal Mostafa
2014-12-02 19:18 ` [PATCH 3.13.y-ckt 045/121] dm bufio: change __GFP_IO to __GFP_FS in shrinker callbacks Kamal Mostafa
2014-12-02 19:18 ` [PATCH 3.13.y-ckt 046/121] xtensa: re-wire umount syscall to sys_oldumount Kamal Mostafa
2014-12-02 19:18 ` [PATCH 3.13.y-ckt 047/121] dm raid: ensure superblock's size matches device's logical block size Kamal Mostafa
2014-12-02 19:18 ` [PATCH 3.13.y-ckt 048/121] ahci: disable MSI instead of NCQ on Samsung pci-e SSDs on macbooks Kamal Mostafa
2014-12-02 19:18 ` [PATCH 3.13.y-ckt 049/121] ahci: Add Device IDs for Intel Sunrise Point PCH Kamal Mostafa
2014-12-02 19:18 ` [PATCH 3.13.y-ckt 050/121] power: charger-manager: Fix accessing invalidated power supply after charger unbind Kamal Mostafa
2014-12-02 19:18 ` [PATCH 3.13.y-ckt 051/121] mac80211: use secondary channel offset IE also beacons during CSA Kamal Mostafa
2014-12-02 19:18 ` [PATCH 3.13.y-ckt 052/121] mac80211: schedule the actual switch of the station before CSA count 0 Kamal Mostafa
2014-12-02 19:18 ` [PATCH 3.13.y-ckt 053/121] mac80211: properly flush delayed scan work on interface removal Kamal Mostafa
2014-12-02 19:18 ` [PATCH 3.13.y-ckt 054/121] mac80211: fix use-after-free in defragmentation Kamal Mostafa
2014-12-02 19:18 ` [PATCH 3.13.y-ckt 055/121] tun: Fix csum_start with VLAN acceleration Kamal Mostafa
2014-12-02 19:18 ` [PATCH 3.13.y-ckt 056/121] macvtap: Fix csum_start when VLAN tags are present Kamal Mostafa
2014-12-02 19:18 ` [PATCH 3.13.y-ckt 057/121] dm thin: grab a virtual cell before looking up the mapping Kamal Mostafa
2014-12-02 19:18 ` [PATCH 3.13.y-ckt 058/121] KVM: x86: Fix uninitialized op->type for some immediate values Kamal Mostafa
2014-12-02 19:18 ` [PATCH 3.13.y-ckt 059/121] crypto: caam - fix missing dma unmap on error path Kamal Mostafa
2014-12-02 19:18 ` [PATCH 3.13.y-ckt 060/121] hwrng: pseries - port to new read API and fix stack corruption Kamal Mostafa
2014-12-02 19:19 ` [PATCH 3.13.y-ckt 061/121] drm/radeon: set correct CE ram size for CIK Kamal Mostafa
2014-12-02 19:19 ` [PATCH 3.13.y-ckt 062/121] drm/radeon: make sure mode init is complete in bandwidth_update Kamal Mostafa
2014-12-02 19:19 ` [PATCH 3.13.y-ckt 063/121] drm/radeon: use gart for DMA IB tests Kamal Mostafa
2014-12-02 19:19 ` [PATCH 3.13.y-ckt 064/121] drm/radeon: add missing crtc unlock when setting up the MC Kamal Mostafa
2014-12-02 19:19 ` [PATCH 3.13.y-ckt 065/121] ALSA: hda_intel: Add Device IDs for Intel Sunrise Point PCH Kamal Mostafa
2014-12-02 19:19 ` [PATCH 3.13.y-ckt 066/121] ALSA: hda_intel: Add DeviceIDs for Sunrise Point-LP Kamal Mostafa
2014-12-02 19:19 ` [PATCH 3.13.y-ckt 067/121] Input: alps - ignore potential bare packets when device is out of sync Kamal Mostafa
2014-12-02 19:19 ` [PATCH 3.13.y-ckt 068/121] Input: alps - allow up to 2 invalid packets without resetting device Kamal Mostafa
2014-12-02 19:19 ` [PATCH 3.13.y-ckt 069/121] scsi: only re-lock door after EH on devices that were reset Kamal Mostafa
2014-12-02 19:19 ` [PATCH 3.13.y-ckt 070/121] dm btree: fix a recursion depth bug in btree walking code Kamal Mostafa
2014-12-02 19:19 ` [PATCH 3.13.y-ckt 071/121] parisc: Use compat layer for msgctl, shmat, shmctl and semtimedop syscalls Kamal Mostafa
2014-12-02 19:19 ` [PATCH 3.13.y-ckt 072/121] ALSA: usb-audio: Fix memory leak in FTU quirk Kamal Mostafa
2014-12-02 19:19 ` [PATCH 3.13.y-ckt 073/121] audit: keep inode pinned Kamal Mostafa
2014-12-02 19:19 ` Kamal Mostafa [this message]
2014-12-02 19:19 ` [PATCH 3.13.y-ckt 075/121] nfs: Fix use of uninitialized variable in nfs_getattr() Kamal Mostafa
2014-12-02 19:19 ` [PATCH 3.13.y-ckt 076/121] NFSv4: Ensure that we remove NFSv4.0 delegations when state has expired Kamal Mostafa
2014-12-02 19:19 ` [PATCH 3.13.y-ckt 077/121] NFSv4.1: nfs41_clear_delegation_stateid shouldn't trust NFS_DELEGATED_STATE Kamal Mostafa
2014-12-02 19:19 ` [PATCH 3.13.y-ckt 078/121] NFSv4: Fix races between nfs_remove_bad_delegation() and delegation return Kamal Mostafa
2014-12-02 19:19 ` [PATCH 3.13.y-ckt 079/121] NFSv4: Ensure that we call FREE_STATEID when NFSv4.x stateids are revoked Kamal Mostafa
2014-12-02 19:19 ` [PATCH 3.13.y-ckt 080/121] NFS: Don't try to reclaim delegation open state if recovery failed Kamal Mostafa
2014-12-02 19:19 ` [PATCH 3.13.y-ckt 081/121] libceph: do not crash on large auth tickets Kamal Mostafa
2014-12-02 19:19 ` [PATCH 3.13.y-ckt 082/121] ARM: 8191/1: decompressor: ensure I-side picks up relocated code Kamal Mostafa
2014-12-02 19:19 ` [PATCH 3.13.y-ckt 083/121] ARM: 8198/1: make kuser helpers depend on MMU Kamal Mostafa
2014-12-02 19:19 ` [PATCH 3.13.y-ckt 084/121] zram: avoid kunmap_atomic() of a NULL pointer Kamal Mostafa
2014-12-02 19:19 ` [PATCH 3.13.y-ckt 085/121] Input: alps - ignore bad data on Dell Latitudes E6440 and E7440 Kamal Mostafa
2014-12-02 19:19 ` [PATCH 3.13.y-ckt 086/121] firewire: cdev: prevent kernel stack leaking into ioctl arguments Kamal Mostafa
2014-12-02 19:19 ` [PATCH 3.13.y-ckt 087/121] md: Always set RECOVERY_NEEDED when clearing RECOVERY_FROZEN Kamal Mostafa
2014-12-02 19:19 ` [PATCH 3.13.y-ckt 088/121] nfs: Don't busy-wait on SIGKILL in __nfs_iocounter_wait Kamal Mostafa
2014-12-02 19:19 ` [PATCH 3.13.y-ckt 089/121] x86: kvm: use alternatives for VMCALL vs. VMMCALL if kernel text is read-only Kamal Mostafa
2014-12-02 19:19 ` [PATCH 3.13.y-ckt 090/121] target: Don't call TFO->write_pending if data_length == 0 Kamal Mostafa
2014-12-02 19:19 ` [PATCH 3.13.y-ckt 091/121] vhost-scsi: Take configfs group dependency during VHOST_SCSI_SET_ENDPOINT Kamal Mostafa
2014-12-02 19:19 ` [PATCH 3.13.y-ckt 092/121] srp-target: Retry when QP creation fails with ENOMEM Kamal Mostafa
2014-12-02 19:19 ` [PATCH 3.13.y-ckt 093/121] ASoC: fsi: remove unsupported PAUSE flag Kamal Mostafa
2014-12-02 19:19 ` [PATCH 3.13.y-ckt 094/121] ASoC: rsnd: " Kamal Mostafa
2014-12-02 19:19 ` [PATCH 3.13.y-ckt 095/121] ib_isert: Add max_send_sge=2 minimum for control PDU responses Kamal Mostafa
2014-12-02 19:19 ` [PATCH 3.13.y-ckt 096/121] iser-target: Handle DEVICE_REMOVAL event on network portal listener correctly Kamal Mostafa
2014-12-02 19:19 ` [PATCH 3.13.y-ckt 097/121] ASoC: dpcm: Fix race between FE/BE updates and trigger Kamal Mostafa
2014-12-02 19:19 ` [PATCH 3.13.y-ckt 098/121] mac80211: Fix regression that triggers a kernel BUG with CCMP Kamal Mostafa
2014-12-02 19:19 ` [PATCH 3.13.y-ckt 099/121] rt2x00: do not align payload on modern H/W Kamal Mostafa
2014-12-02 19:19 ` [PATCH 3.13.y-ckt 100/121] ath9k: Add version/revision macros for QCA9531 Kamal Mostafa
2014-12-02 19:19 ` [PATCH 3.13.y-ckt 101/121] ath9k: Fix RTC_DERIVED_CLK usage Kamal Mostafa
2014-12-02 19:19 ` [PATCH 3.13.y-ckt 102/121] ASoC: sgtl5000: Fix SMALL_POP bit definition Kamal Mostafa
2014-12-02 19:19 ` [PATCH 3.13.y-ckt 103/121] ALSA: usb-audio: Add ctrl message delay quirk for Marantz/Denon devices Kamal Mostafa
2014-12-02 19:19 ` [PATCH 3.13.y-ckt 104/121] bitops: Fix shift overflow in GENMASK macros Kamal Mostafa
2014-12-02 19:19 ` [PATCH 3.13.y-ckt 105/121] x86: Require exact match for 'noxsave' command line option Kamal Mostafa
2014-12-02 19:19 ` [PATCH 3.13.y-ckt 106/121] drm/i915: drop WaSetupGtModeTdRowDispatch:snb Kamal Mostafa
2014-12-02 19:19 ` [PATCH 3.13.y-ckt 107/121] ASoC: wm_adsp: Avoid attempt to free buffers that might still be in use Kamal Mostafa
2014-12-02 19:19 ` [PATCH 3.13.y-ckt 108/121] can: dev: avoid calling kfree_skb() from interrupt context Kamal Mostafa
2014-12-02 19:19 ` [PATCH 3.13.y-ckt 109/121] can: esd_usb2: fix memory leak on disconnect Kamal Mostafa
2014-12-02 19:19 ` [PATCH 3.13.y-ckt 110/121] x86, microcode: Update BSPs microcode on resume Kamal Mostafa
2014-12-02 19:19 ` [PATCH 3.13.y-ckt 111/121] x86, mm: Set NX across entire PMD at boot Kamal Mostafa
2014-12-02 19:19 ` [PATCH 3.13.y-ckt 112/121] of/irq: Drop obsolete 'interrupts' vs 'interrupts-extended' text Kamal Mostafa
2014-12-02 19:19 ` [PATCH 3.13.y-ckt 113/121] of/base: Fix PowerPC address parsing hack Kamal Mostafa
2014-12-02 19:19 ` [PATCH 3.13.y-ckt 114/121] clockevent: sun4i: Fix race condition in the probe code Kamal Mostafa
2014-12-02 19:19 ` [PATCH 3.13.y-ckt 115/121] MIPS: oprofile: Fix backtrace on 64-bit kernel Kamal Mostafa
2014-12-02 19:19 ` [PATCH 3.13.y-ckt 116/121] ACPI / PM: Ignore wakeup setting if the ACPI companion can't wake up Kamal Mostafa
2014-12-02 19:19 ` [PATCH 3.13.y-ckt 117/121] IB/isert: Adjust CQ size to HW limits Kamal Mostafa
2014-12-02 19:19 ` [PATCH 3.13.y-ckt 118/121] drm/radeon: fix endian swapping in vbios fetch for tdp table Kamal Mostafa
2014-12-02 19:19 ` [PATCH 3.13.y-ckt 119/121] x86_64, traps: Fix the espfix64 #DF fixup and rewrite it in C Kamal Mostafa
2014-12-02 19:34 ` Andy Lutomirski
2014-12-02 21:20 ` Kamal Mostafa
2014-12-02 19:19 ` [PATCH 3.13.y-ckt 120/121] x86_64, traps: Stop using IST for #SS Kamal Mostafa
2014-12-02 19:20 ` [PATCH 3.13.y-ckt 121/121] x86_64, traps: Rework bad_iret Kamal Mostafa
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=1417548000-1794-75-git-send-email-kamal@canonical.com \
--to=kamal@canonical.com \
--cc=kernel-team@lists.ubuntu.com \
--cc=linux-kernel@vger.kernel.org \
--cc=stable@vger.kernel.org \
--cc=tao.peng@primarydata.com \
--cc=trond.myklebust@primarydata.com \
/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®