mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jiri Slaby <jslaby@suse.cz>
To: stable@vger.kernel.org
Cc: linux-kernel@vger.kernel.org,
	Mikulas Patocka <mpatocka@redhat.com>,
	Mike Snitzer <snitzer@redhat.com>, Jiri Slaby <jslaby@suse.cz>
Subject: [PATCH 3.12 046/101] dm bufio: change __GFP_IO to __GFP_FS in shrinker callbacks
Date: Wed,  3 Dec 2014 12:26:08 +0100	[thread overview]
Message-ID: <d1bb12f652136abaa633ca8a8e2cd700c960fefb.1417605922.git.jslaby@suse.cz> (raw)
In-Reply-To: <f9a3dbb8fd1853c16930b2c95eefa34a324eca19.1417605922.git.jslaby@suse.cz>
In-Reply-To: <cover.1417605922.git.jslaby@suse.cz>

From: Mikulas Patocka <mpatocka@redhat.com>

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

===============

commit 9d28eb12447ee08bb5d1e8bb3195cf20e1ecd1c0 upstream.

The shrinker uses gfp flags to indicate what kind of operation can the
driver wait for. If __GFP_IO flag is present, the driver can wait for
block I/O operations, if __GFP_FS flag is present, the driver can wait on
operations involving the filesystem.

dm-bufio tested for __GFP_IO. However, dm-bufio can run on a loop block
device that makes calls into the filesystem. If __GFP_IO is present and
__GFP_FS isn't, dm-bufio could still block on filesystem operations if it
runs on a loop block device.

The change from __GFP_IO to __GFP_FS supposedly fixes one observed (though
unreproducible) deadlock involving dm-bufio and loop device.

Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 drivers/md/dm-bufio.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/md/dm-bufio.c b/drivers/md/dm-bufio.c
index a42efc7f69ed..140be2dd3e23 100644
--- a/drivers/md/dm-bufio.c
+++ b/drivers/md/dm-bufio.c
@@ -1418,9 +1418,9 @@ static void drop_buffers(struct dm_bufio_client *c)
 
 /*
  * Test if the buffer is unused and too old, and commit it.
- * At if noio is set, we must not do any I/O because we hold
- * dm_bufio_clients_lock and we would risk deadlock if the I/O gets rerouted to
- * different bufio client.
+ * And if GFP_NOFS is used, we must not do any I/O because we hold
+ * dm_bufio_clients_lock and we would risk deadlock if the I/O gets
+ * rerouted to different bufio client.
  */
 static int __cleanup_old_buffer(struct dm_buffer *b, gfp_t gfp,
 				unsigned long max_jiffies)
@@ -1428,7 +1428,7 @@ static int __cleanup_old_buffer(struct dm_buffer *b, gfp_t gfp,
 	if (jiffies - b->last_accessed < max_jiffies)
 		return 0;
 
-	if (!(gfp & __GFP_IO)) {
+	if (!(gfp & __GFP_FS)) {
 		if (test_bit(B_READING, &b->state) ||
 		    test_bit(B_WRITING, &b->state) ||
 		    test_bit(B_DIRTY, &b->state))
@@ -1470,7 +1470,7 @@ dm_bufio_shrink_scan(struct shrinker *shrink, struct shrink_control *sc)
 	unsigned long freed;
 
 	c = container_of(shrink, struct dm_bufio_client, shrinker);
-	if (sc->gfp_mask & __GFP_IO)
+	if (sc->gfp_mask & __GFP_FS)
 		dm_bufio_lock(c);
 	else if (!dm_bufio_trylock(c))
 		return SHRINK_STOP;
@@ -1487,7 +1487,7 @@ dm_bufio_shrink_count(struct shrinker *shrink, struct shrink_control *sc)
 	unsigned long count;
 
 	c = container_of(shrink, struct dm_bufio_client, shrinker);
-	if (sc->gfp_mask & __GFP_IO)
+	if (sc->gfp_mask & __GFP_FS)
 		dm_bufio_lock(c);
 	else if (!dm_bufio_trylock(c))
 		return 0;
-- 
2.1.3


  parent reply	other threads:[~2014-12-03 11:58 UTC|newest]

Thread overview: 105+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-12-03 11:26 [PATCH 3.12 000/101] 3.12.34-stable review Jiri Slaby
2014-12-03 11:25 ` [PATCH 3.12 001/101] Input: evdev - fix EVIOCG{type} ioctl Jiri Slaby
2014-12-03 11:25 ` [PATCH 3.12 002/101] ip6_tunnel: Use ip6_tnl_dev_init as the ndo_init function Jiri Slaby
2014-12-03 11:25 ` [PATCH 3.12 003/101] sit: Use ipip6_tunnel_init " Jiri Slaby
2014-12-03 11:25 ` [PATCH 3.12 004/101] gre6: Move the setting of dev->iflink into the ndo_init functions Jiri Slaby
2014-12-03 11:25 ` [PATCH 3.12 005/101] vxlan: Do not reuse sockets for a different address family Jiri Slaby
2014-12-03 11:25 ` [PATCH 3.12 006/101] net: sctp: fix NULL pointer dereference in af->from_addr_param on malformed packet Jiri Slaby
2014-12-03 11:25 ` [PATCH 3.12 007/101] net: sctp: fix memory leak in auth key management Jiri Slaby
2014-12-03 11:25 ` [PATCH 3.12 008/101] sunvdc: add cdrom and v1.1 protocol support Jiri Slaby
2014-12-03 11:25 ` [PATCH 3.12 009/101] sunvdc: compute vdisk geometry from capacity Jiri Slaby
2014-12-03 11:25 ` [PATCH 3.12 010/101] sunvdc: limit each sg segment to a page Jiri Slaby
2014-12-03 11:25 ` [PATCH 3.12 011/101] vio: fix reuse of vio_dring slot Jiri Slaby
2014-12-03 11:25 ` [PATCH 3.12 012/101] sunvdc: don't call VD_OP_GET_VTOC Jiri Slaby
2014-12-03 11:25 ` [PATCH 3.12 013/101] sparc64: Fix crashes in schizo_pcierr_intr_other() Jiri Slaby
2014-12-03 11:25 ` [PATCH 3.12 014/101] sparc64: Do irq_{enter,exit}() around generic_smp_call_function*() Jiri Slaby
2014-12-03 11:25 ` [PATCH 3.12 015/101] sparc32: Implement xchg and atomic_xchg using ATOMIC_HASH locks Jiri Slaby
2014-12-03 11:25 ` [PATCH 3.12 016/101] hwrng: pseries - Return errors to upper levels in pseries-rng.c Jiri Slaby
2014-12-03 11:25 ` [PATCH 3.12 017/101] iwlwifi: configure the LTR Jiri Slaby
2014-12-03 11:25 ` [PATCH 3.12 018/101] zram: avoid kunmap_atomic() of a NULL pointer Jiri Slaby
2014-12-03 11:25 ` [PATCH 3.12 019/101] crypto: caam - remove duplicated sg copy functions Jiri Slaby
2014-12-03 11:25 ` [PATCH 3.12 020/101] hwrng: pseries - port to new read API and fix stack corruption Jiri Slaby
2014-12-03 11:25 ` [PATCH 3.12 021/101] tun: Fix csum_start with VLAN acceleration Jiri Slaby
2014-12-03 11:25 ` [PATCH 3.12 022/101] x86, x32, audit: Fix x32's AUDIT_ARCH wrt audit Jiri Slaby
2014-12-03 11:25 ` [PATCH 3.12 023/101] audit: keep inode pinned Jiri Slaby
2014-12-03 11:25 ` [PATCH 3.12 024/101] ahci: Add Device IDs for Intel Sunrise Point PCH Jiri Slaby
2014-12-03 11:25 ` [PATCH 3.12 025/101] ahci: disable MSI instead of NCQ on Samsung pci-e SSDs on macbooks Jiri Slaby
2014-12-03 11:25 ` [PATCH 3.12 026/101] ALSA: usb-audio: Fix memory leak in FTU quirk Jiri Slaby
2014-12-03 11:25 ` [PATCH 3.12 027/101] xtensa: re-wire umount syscall to sys_oldumount Jiri Slaby
2014-12-03 11:25 ` [PATCH 3.12 028/101] libceph: do not crash on large auth tickets Jiri Slaby
2014-12-03 11:25 ` [PATCH 3.12 029/101] macvtap: Fix csum_start when VLAN tags are present Jiri Slaby
2014-12-03 11:25 ` [PATCH 3.12 030/101] mac80211_hwsim: release driver when ieee80211_register_hw fails Jiri Slaby
2014-12-03 11:25 ` [PATCH 3.12 031/101] mac80211: properly flush delayed scan work on interface removal Jiri Slaby
2014-12-03 11:25 ` [PATCH 3.12 032/101] mac80211: schedule the actual switch of the station before CSA count 0 Jiri Slaby
2014-12-03 11:25 ` [PATCH 3.12 033/101] mac80211: fix use-after-free in defragmentation Jiri Slaby
2014-12-03 11:25 ` [PATCH 3.12 034/101] drm/radeon: set correct CE ram size for CIK Jiri Slaby
2014-12-03 11:25 ` [PATCH 3.12 035/101] drm/radeon: make sure mode init is complete in bandwidth_update Jiri Slaby
2014-12-03 11:25 ` [PATCH 3.12 036/101] drm/radeon: add missing crtc unlock when setting up the MC Jiri Slaby
2014-12-03 11:25 ` [PATCH 3.12 037/101] ARM: 8198/1: make kuser helpers depend on MMU Jiri Slaby
2014-12-03 11:26 ` [PATCH 3.12 038/101] ARM: 8191/1: decompressor: ensure I-side picks up relocated code Jiri Slaby
2014-12-03 11:26 ` [PATCH 3.12 039/101] dm thin: grab a virtual cell before looking up the mapping Jiri Slaby
2014-12-03 11:26 ` [PATCH 3.12 040/101] arm64: __clear_user: handle exceptions on strb Jiri Slaby
2014-12-03 11:26 ` [PATCH 3.12 041/101] firewire: cdev: prevent kernel stack leaking into ioctl arguments Jiri Slaby
2014-12-03 11:26 ` [PATCH 3.12 042/101] nfs: fix pnfs direct write memory leak Jiri Slaby
2014-12-03 11:26 ` [PATCH 3.12 043/101] scsi: only re-lock door after EH on devices that were reset Jiri Slaby
2014-12-03 11:26 ` [PATCH 3.12 044/101] parisc: Use compat layer for msgctl, shmat, shmctl and semtimedop syscalls Jiri Slaby
2014-12-03 11:26 ` [PATCH 3.12 045/101] block: Fix computation of merged request priority Jiri Slaby
2014-12-03 11:26 ` Jiri Slaby [this message]
2014-12-03 11:26 ` [PATCH 3.12 047/101] dm btree: fix a recursion depth bug in btree walking code Jiri Slaby
2014-12-03 11:26 ` [PATCH 3.12 048/101] dm raid: ensure superblock's size matches device's logical block size Jiri Slaby
2014-12-03 11:26 ` [PATCH 3.12 049/101] Input: alps - ignore potential bare packets when device is out of sync Jiri Slaby
2014-12-03 11:26 ` [PATCH 3.12 050/101] Input: alps - allow up to 2 invalid packets without resetting device Jiri Slaby
2014-12-03 11:26 ` [PATCH 3.12 051/101] Input: alps - ignore bad data on Dell Latitudes E6440 and E7440 Jiri Slaby
2014-12-03 11:26 ` [PATCH 3.12 052/101] NFSv4: Ensure that we remove NFSv4.0 delegations when state has expired Jiri Slaby
2014-12-03 11:26 ` [PATCH 3.12 053/101] NFS: Don't try to reclaim delegation open state if recovery failed Jiri Slaby
2014-12-03 11:26 ` [PATCH 3.12 054/101] nfs: Fix use of uninitialized variable in nfs_getattr() Jiri Slaby
2014-12-03 11:26 ` [PATCH 3.12 055/101] NFSv4: Fix races between nfs_remove_bad_delegation() and delegation return Jiri Slaby
2014-12-03 11:26 ` [PATCH 3.12 056/101] NFSv4.1: nfs41_clear_delegation_stateid shouldn't trust NFS_DELEGATED_STATE Jiri Slaby
2014-12-03 11:26 ` [PATCH 3.12 057/101] vmcore: Remove "weak" from function declarations Jiri Slaby
2014-12-03 11:26 ` [PATCH 3.12 058/101] kgdb: Remove "weak" from kgdb_arch_pc() declaration Jiri Slaby
2014-12-03 11:26 ` [PATCH 3.12 059/101] clocksource: Remove "weak" from clocksource_default_clock() declaration Jiri Slaby
2014-12-03 11:26 ` [PATCH 3.12 060/101] ipc: always handle a new value of auto_msgmni Jiri Slaby
2014-12-03 11:26 ` [PATCH 3.12 061/101] netfilter: nf_log: account for size of NLMSG_DONE attribute Jiri Slaby
2014-12-03 11:26 ` [PATCH 3.12 062/101] netfilter: nfnetlink_log: fix maximum packet length logged to userspace Jiri Slaby
2014-12-03 11:26 ` [PATCH 3.12 063/101] netfilter: nf_log: release skbuff on nlmsg put failure Jiri Slaby
2014-12-03 11:26 ` [PATCH 3.12 064/101] netfilter: xt_bpf: add mising opaque struct sk_filter definition Jiri Slaby
2014-12-03 11:26 ` [PATCH 3.12 065/101] ARM: probes: fix instruction fetch order with <asm/opcodes.h> Jiri Slaby
2014-12-03 11:26 ` [PATCH 3.12 066/101] rcu: Make callers awaken grace-period kthread Jiri Slaby
2014-12-03 11:26 ` [PATCH 3.12 067/101] rcu: Use rcu_gp_kthread_wake() to wake up grace period kthreads Jiri Slaby
2014-12-03 11:26 ` [PATCH 3.12 068/101] KVM: x86: Don't report guest userspace emulation error to userspace Jiri Slaby
2014-12-03 11:26 ` [PATCH 3.12 069/101] net: sctp: fix remote memory pressure from excessive queueing Jiri Slaby
2014-12-03 11:26 ` [PATCH 3.12 070/101] net: sctp: fix panic on duplicate ASCONF chunks Jiri Slaby
2014-12-03 11:26 ` [PATCH 3.12 071/101] net: sctp: fix skb_over_panic when receiving malformed " Jiri Slaby
2014-12-03 11:26 ` [PATCH 3.12 072/101] drivers/memstick/host/rtsx_pci_ms.c: add cancel_work when remove driver Jiri Slaby
2014-12-03 11:26 ` [PATCH 3.12 073/101] [media] usbvision-video: two use after frees Jiri Slaby
2014-12-03 11:26 ` [PATCH 3.12 074/101] Input: altera_ps2 - write to correct register when disabling interrupts Jiri Slaby
2014-12-03 11:26 ` [PATCH 3.12 075/101] Input: wm97xx - adapt parameters to tosa touchscreen Jiri Slaby
2014-12-03 11:26 ` [PATCH 3.12 076/101] pcmcia: at91_cf: fix deferred probe from __init Jiri Slaby
2014-12-03 11:26 ` [PATCH 3.12 077/101] pcmcia: sa1100: H3100 and H3600 share a driver Jiri Slaby
2014-12-03 11:26 ` [PATCH 3.12 078/101] pcmcia: pxa2xx: fix logic for lubbock Jiri Slaby
2014-12-03 11:26 ` [PATCH 3.12 079/101] pcmcia: journada720: use sa1100 pin interfaces correctly Jiri Slaby
2014-12-03 11:26 ` [PATCH 3.12 080/101] parport: Add support for the WCH353 1S/1P multi-IO card Jiri Slaby
2014-12-03 11:26 ` [PATCH 3.12 081/101] vme_tsi148: Fix PCI address mapping assumption Jiri Slaby
2014-12-03 11:26 ` [PATCH 3.12 082/101] vme_tsi148: Fix typo in tsi148_slave_get() Jiri Slaby
2014-12-03 11:26 ` [PATCH 3.12 083/101] VME: Stop using memcpy_[to|from]io() due to unwanted behaviour Jiri Slaby
2014-12-03 11:26 ` [PATCH 3.12 084/101] drivers/vlynq/vlynq.c: fix another resource size off by 1 error Jiri Slaby
2014-12-03 11:26 ` [PATCH 3.12 085/101] hfsplus: fix remount issue Jiri Slaby
2014-12-03 11:26 ` [PATCH 3.12 086/101] fs/hfsplus/extents.c: fix concurrent acess of alloc_blocks Jiri Slaby
2014-12-03 11:26 ` [PATCH 3.12 087/101] hfsplus: emit proper file type from readdir Jiri Slaby
2014-12-03 11:26 ` [PATCH 3.12 088/101] pvpanic: Set high notifier priority Jiri Slaby
2014-12-03 11:26 ` [PATCH 3.12 089/101] sparc64: Fix constraints on swab helpers Jiri Slaby
2014-12-03 11:26 ` [PATCH 3.12 090/101] inetdevice: fixed signed integer overflow Jiri Slaby
2014-12-03 11:26 ` [PATCH 3.12 091/101] ipv4: Fix incorrect error code when adding an unreachable route Jiri Slaby
2014-12-03 11:26 ` [PATCH 3.12 092/101] ieee802154: fix error handling in ieee802154fake_probe() Jiri Slaby
2014-12-03 11:26 ` [PATCH 3.12 093/101] qmi_wwan: Add support for HP lt4112 LTE/HSPA+ Gobi 4G Modem Jiri Slaby
2014-12-03 11:26 ` [PATCH 3.12 094/101] pptp: fix stack info leak in pptp_getname() Jiri Slaby
2014-12-03 11:26 ` [PATCH 3.12 095/101] ipx: fix locking regression in ipx_sendmsg and ipx_recvmsg Jiri Slaby
2014-12-03 11:26 ` [PATCH 3.12 096/101] fix O_SYNC|O_APPEND syncing the wrong range on write() Jiri Slaby
2014-12-03 11:26 ` [PATCH 3.12 097/101] nilfs2: add missing blkdev_issue_flush() to nilfs_sync_fs() Jiri Slaby
2014-12-03 11:27 ` [PATCH 3.12 098/101] minix zmap block counts calculation fix Jiri Slaby
2014-12-03 11:27 ` [PATCH 3.12 099/101] ext4: atomically set inode->i_flags in ext4_set_inode_flags() Jiri Slaby
2014-12-03 11:27 ` [PATCH 3.12 100/101] fs/jfs/jfs_inode.c: atomically set inode->i_flags Jiri Slaby
2014-12-03 11:27 ` [PATCH 3.12 101/101] x86: kvm: use alternatives for VMCALL vs. VMMCALL if kernel text is read-only Jiri Slaby
2014-12-03 19:47 ` [PATCH 3.12 000/101] 3.12.34-stable review Guenter Roeck
2014-12-05 12:22   ` Jiri Slaby
2014-12-04 21:14 ` Shuah Khan

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=d1bb12f652136abaa633ca8a8e2cd700c960fefb.1417605922.git.jslaby@suse.cz \
    --to=jslaby@suse.cz \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mpatocka@redhat.com \
    --cc=snitzer@redhat.com \
    --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®