From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: linux-kernel@vger.kernel.org
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
stable@vger.kernel.org,
Bernd Schubert <bernd.schubert@itwm.fraunhofer.de>,
Miklos Szeredi <mszeredi@suse.cz>,
Feng Shuo <steve.shuo.feng@gmail.com>
Subject: [ 116/127] fuse: fix readdirplus Oops in fuse_dentry_revalidate
Date: Wed, 5 Jun 2013 14:34:43 -0700 [thread overview]
Message-ID: <20130605213231.156897031@linuxfoundation.org> (raw)
In-Reply-To: <20130605213217.966891866@linuxfoundation.org>
3.9-stable review patch. If anyone has any objections, please let me know.
------------------
From: Miklos Szeredi <mszeredi@suse.cz>
commit 28420dad233520811c0e0860e7fb4975ed863fc4 upstream.
Fix bug introduced by commit 4582a4ab2a "FUSE: Adapt readdirplus to application
usage patterns".
We need to check for a positive dentry; negative dentries are not added by
readdirplus. Secondly we need to advise the use of readdirplus on the *parent*,
otherwise the whole thing is useless. Thirdly all this is only relevant if
"readdirplus_auto" mode is selected by the filesystem.
We advise the use of readdirplus only if the dentry was still valid. If we had
to redo the lookup then there was no use in doing the -plus version.
Reported-by: Bernd Schubert <bernd.schubert@itwm.fraunhofer.de>
Signed-off-by: Miklos Szeredi <mszeredi@suse.cz>
CC: Feng Shuo <steve.shuo.feng@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
fs/fuse/dir.c | 12 +++++++++---
fs/fuse/inode.c | 7 ++++---
2 files changed, 13 insertions(+), 6 deletions(-)
--- a/fs/fuse/dir.c
+++ b/fs/fuse/dir.c
@@ -180,6 +180,8 @@ u64 fuse_get_attr_version(struct fuse_co
static int fuse_dentry_revalidate(struct dentry *entry, unsigned int flags)
{
struct inode *inode;
+ struct dentry *parent;
+ struct fuse_conn *fc;
inode = ACCESS_ONCE(entry->d_inode);
if (inode && is_bad_inode(inode))
@@ -187,10 +189,8 @@ static int fuse_dentry_revalidate(struct
else if (fuse_dentry_time(entry) < get_jiffies_64()) {
int err;
struct fuse_entry_out outarg;
- struct fuse_conn *fc;
struct fuse_req *req;
struct fuse_forget_link *forget;
- struct dentry *parent;
u64 attr_version;
/* For negative dentries, always do a fresh lookup */
@@ -241,8 +241,14 @@ static int fuse_dentry_revalidate(struct
entry_attr_timeout(&outarg),
attr_version);
fuse_change_entry_timeout(entry, &outarg);
+ } else if (inode) {
+ fc = get_fuse_conn(inode);
+ if (fc->readdirplus_auto) {
+ parent = dget_parent(entry);
+ fuse_advise_use_readdirplus(parent->d_inode);
+ dput(parent);
+ }
}
- fuse_advise_use_readdirplus(inode);
return 1;
}
--- a/fs/fuse/inode.c
+++ b/fs/fuse/inode.c
@@ -864,10 +864,11 @@ static void process_init_reply(struct fu
fc->dont_mask = 1;
if (arg->flags & FUSE_AUTO_INVAL_DATA)
fc->auto_inval_data = 1;
- if (arg->flags & FUSE_DO_READDIRPLUS)
+ if (arg->flags & FUSE_DO_READDIRPLUS) {
fc->do_readdirplus = 1;
- if (arg->flags & FUSE_READDIRPLUS_AUTO)
- fc->readdirplus_auto = 1;
+ if (arg->flags & FUSE_READDIRPLUS_AUTO)
+ fc->readdirplus_auto = 1;
+ }
} else {
ra_pages = fc->max_read / PAGE_CACHE_SIZE;
fc->no_lock = 1;
next prev parent reply other threads:[~2013-06-05 21:41 UTC|newest]
Thread overview: 128+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-06-05 21:32 [ 000/127] 3.9.5-stable review Greg Kroah-Hartman
2013-06-05 21:32 ` [ 001/127] avr32: fix relocation check for signed 18-bit offset Greg Kroah-Hartman
2013-06-05 21:32 ` [ 002/127] USB: OHCI: fix logic for scheduling isochronous URBs Greg Kroah-Hartman
2013-06-05 21:32 ` [ 003/127] USB: fix latency in uhci-hcd and ohci-hcd Greg Kroah-Hartman
2013-06-05 21:32 ` [ 004/127] ARM: plat-orion: Fix num_resources and id for ge10 and ge11 Greg Kroah-Hartman
2013-06-05 21:32 ` [ 005/127] ARM: OMAP: fix __init section mismatch for _enable_preprogram Greg Kroah-Hartman
2013-06-05 21:32 ` [ 006/127] ARM: AM33XX: Add missing .clkdm_name to clkdiv32k_ick clock Greg Kroah-Hartman
2013-06-05 21:32 ` [ 007/127] ARM: 7723/1: crypto: sha1-armv4-large.S: fix SP handling Greg Kroah-Hartman
2013-06-05 21:32 ` [ 008/127] ARM: at91/trivial: fix model name for SAM9X25-EK Greg Kroah-Hartman
2013-06-05 21:32 ` [ 009/127] ARM: at91: rm9200 fix time support Greg Kroah-Hartman
2013-06-05 21:32 ` [ 010/127] ARM: at91/dt: fix macb pinctrl_macb_rmii_mii_alt definition Greg Kroah-Hartman
2013-06-05 21:32 ` [ 011/127] cfg80211: fix WoWLAN wakeup tracing Greg Kroah-Hartman
2013-06-05 21:32 ` [ 012/127] cfg80211: fix wiphy_register error path Greg Kroah-Hartman
2013-06-05 21:33 ` [ 013/127] cfg80211: fix sending WoWLAN TCP wakeup settings Greg Kroah-Hartman
2013-06-05 21:33 ` [ 014/127] mac80211: use just spin_lock() in ieee80211_get_tkip_p2k() Greg Kroah-Hartman
2013-06-05 21:33 ` [ 015/127] mac80211: fix AP-mode frame matching Greg Kroah-Hartman
2013-06-05 21:33 ` [ 016/127] iwlwifi: mvm: Always use SCAN_TYPE_FORCED Greg Kroah-Hartman
2013-06-05 21:33 ` [ 017/127] iwlwifi: mvm: Prevent setting assoc flag in MAC_CONTEXT_CMD Greg Kroah-Hartman
2013-06-05 21:33 ` [ 018/127] staging: vt6656: [bug] Fix missing spin lock in iwctl_siwpower Greg Kroah-Hartman
2013-06-05 21:33 ` [ 019/127] staging: vt6656: use free_netdev instead of kfree Greg Kroah-Hartman
2013-06-05 21:33 ` [ 020/127] usb, chipidea: fix link error when USB_EHCI_HCD is a module Greg Kroah-Hartman
2013-06-05 21:33 ` [ 021/127] usb: option: Add Telewell TW-LTE 4G Greg Kroah-Hartman
2013-06-05 21:33 ` [ 022/127] USB: option: add device IDs for Dell 5804 (Novatel E371) WWAN card Greg Kroah-Hartman
2013-06-05 21:33 ` [ 023/127] USB: ftdi_sio: Add support for Newport CONEX motor drivers Greg Kroah-Hartman
2013-06-05 21:33 ` [ 024/127] USB: cxacru: potential underflow in cxacru_cm_get_array() Greg Kroah-Hartman
2013-06-05 21:33 ` [ 025/127] TTY: Fix tty miss restart after we turn off flow-control Greg Kroah-Hartman
2013-06-05 21:33 ` [ 026/127] USB: Blacklisted Cinterions PLxx WWAN Interface Greg Kroah-Hartman
2013-06-05 21:33 ` [ 027/127] USB: reset resume quirk needed by a hub Greg Kroah-Hartman
2013-06-05 21:33 ` [ 028/127] USB: xHCI: override bogus bulk wMaxPacketSize values Greg Kroah-Hartman
2013-06-05 21:33 ` [ 029/127] USB: UHCI: fix for suspend of virtual HP controller Greg Kroah-Hartman
2013-06-05 21:33 ` [ 030/127] Input: egalax_ts - ABS_MT_POSITION_Y not reported well Greg Kroah-Hartman
2013-06-05 21:33 ` [ 031/127] Drivers: hv: Fix a bug in get_vp_index() Greg Kroah-Hartman
2013-06-05 21:33 ` [ 032/127] cifs: only set ops for inodes in I_NEW state Greg Kroah-Hartman
2013-06-05 21:33 ` [ 033/127] ARC: copy_(to|from)_user() to honor usermode-access permissions Greg Kroah-Hartman
2013-06-05 21:33 ` [ 034/127] drivers/char/random.c: fix priming of last_data Greg Kroah-Hartman
2013-06-05 21:33 ` [ 035/127] random: fix accounting race condition with lockless irq entropy_count update Greg Kroah-Hartman
2013-06-05 21:33 ` [ 036/127] fat: fix possible overflow for fat_clusters Greg Kroah-Hartman
2013-06-05 21:33 ` [ 037/127] tg3: Skip powering down function 0 on certain serdes devices Greg Kroah-Hartman
2013-06-05 21:33 ` [ 038/127] tg3: Fix data corruption on 5725 with TSO Greg Kroah-Hartman
2013-06-05 21:33 ` [ 039/127] perf: net_dropmonitor: Fix trace parameter order Greg Kroah-Hartman
2013-06-05 21:33 ` [ 040/127] perf: net_dropmonitor: Fix symbol-relative addresses Greg Kroah-Hartman
2013-06-05 21:33 ` [ 041/127] ath9k: Fix crash on module unload Greg Kroah-Hartman
2013-06-05 21:33 ` [ 042/127] ath9k_hw: Enable manual peak calibration for AR9485 Greg Kroah-Hartman
2013-06-05 21:33 ` [ 043/127] ocfs2: goto out_unlock if ocfs2_get_clusters_nocache() failed in ocfs2_fiemap() Greg Kroah-Hartman
2013-06-05 21:33 ` [ 044/127] Kirkwood: Enable PCIe port 1 on QNAP TS-11x/TS-21x Greg Kroah-Hartman
2013-06-05 21:33 ` [ 045/127] drivers/leds/leds-ot200.c: fix error caused by shifted mask Greg Kroah-Hartman
2013-06-05 21:33 ` [ 046/127] rapidio/tsi721: fix bug in MSI interrupt handling Greg Kroah-Hartman
2013-06-05 21:33 ` [ 047/127] mm compaction: fix of improper cache flush in migration code Greg Kroah-Hartman
2013-06-05 21:33 ` [ 048/127] klist: del waiter from klist_remove_waiters before wakeup waitting process Greg Kroah-Hartman
2013-06-05 21:33 ` [ 049/127] wait: fix false timeouts when using wait_event_timeout() Greg Kroah-Hartman
2013-06-05 21:33 ` [ 050/127] nilfs2: fix issue of nilfs_set_page_dirty() for page at EOF boundary Greg Kroah-Hartman
2013-06-05 21:33 ` [ 051/127] mm: mmu_notifier: re-fix freed page still mapped in secondary MMU Greg Kroah-Hartman
2013-06-05 21:33 ` [ 052/127] mm: memcg: remove incorrect VM_BUG_ON for swap cache pages in uncharge Greg Kroah-Hartman
2013-06-05 21:33 ` [ 053/127] drivers/block/brd.c: fix brd_lookup_page() race Greg Kroah-Hartman
2013-06-05 21:33 ` [ 054/127] mm/pagewalk.c: walk_page_range should avoid VM_PFNMAP areas Greg Kroah-Hartman
2013-06-05 21:33 ` [ 055/127] mm/THP: use pmd_populate() to update the pmd with pgtable_t pointer Greg Kroah-Hartman
2013-06-05 21:33 ` [ 056/127] SCSI: ipr: Need to reset adapter after the 6th EEH error Greg Kroah-Hartman
2013-06-05 21:33 ` [ 057/127] x86: Allow FPU to be used at interrupt time even with eagerfpu Greg Kroah-Hartman
2013-06-05 21:33 ` [ 058/127] x86-64, init: Fix a possible wraparound bug in switchover in head_64.S Greg Kroah-Hartman
2013-06-05 21:33 ` [ 059/127] x86, range: fix missing merge during add range Greg Kroah-Hartman
2013-06-05 21:33 ` [ 060/127] x86, crc32-pclmul: Fix build with older binutils Greg Kroah-Hartman
2013-06-05 21:33 ` [ 061/127] module: dont unlink the module until weve removed all exposure Greg Kroah-Hartman
2013-06-05 21:33 ` [ 062/127] xfs: kill suid/sgid through the truncate path Greg Kroah-Hartman
2013-06-05 21:33 ` [ 063/127] arm64: dont kill the kernel on a bad esr from el0 Greg Kroah-Hartman
2013-06-05 21:33 ` [ 064/127] ARM: SAMSUNG: Export MIPI CSIS/DSIM PHY control functions Greg Kroah-Hartman
2013-06-05 21:33 ` [ 065/127] SUNRPC: Prevent an rpc_task wakeup race Greg Kroah-Hartman
2013-06-05 21:33 ` [ 066/127] svcrpc: fix failures to handle -1 uids and gids Greg Kroah-Hartman
2013-06-05 21:33 ` [ 067/127] ASoC: cs42l52: fix default value for MASTERA_VOL Greg Kroah-Hartman
2013-06-05 21:33 ` [ 068/127] ASoC: wm5110: Correct DSP4R Mixer control name Greg Kroah-Hartman
2013-06-05 21:33 ` [ 069/127] drm/i915: Adding more reserved PCI IDs for Haswell Greg Kroah-Hartman
2013-06-05 21:33 ` [ 070/127] drm/radeon: fix typo in cu_per_sh on verde Greg Kroah-Hartman
2013-06-05 21:33 ` [ 071/127] drm/radeon: fix card_posted check for newer asics Greg Kroah-Hartman
2013-06-05 21:33 ` [ 072/127] crypto: caam - fix inconsistent assoc dma mapping direction Greg Kroah-Hartman
2013-06-05 21:34 ` [ 073/127] cifs: fix potential buffer overrun when composing a new options string Greg Kroah-Hartman
2013-06-05 21:34 ` [ 074/127] sata_rcar: clear STOP bit in bmdma_start() method Greg Kroah-Hartman
2013-06-05 21:34 ` [ 075/127] sata_rcar: fix interrupt handling Greg Kroah-Hartman
2013-06-05 21:34 ` [ 076/127] ata_piix: add PCI IDs for Intel BayTail Greg Kroah-Hartman
2013-06-05 21:34 ` [ 077/127] libata: make ata_exec_internal_sg honor DMADIR Greg Kroah-Hartman
2013-06-05 21:34 ` [ 078/127] m68k/mac: Fix unexpected interrupt with CONFIG_EARLY_PRINTK Greg Kroah-Hartman
2013-06-05 21:34 ` [ 079/127] s390/pgtable: Fix check for pgste/storage key handling Greg Kroah-Hartman
2013-06-05 21:34 ` [ 080/127] cgroup: initialize xattr before calling d_instantiate() Greg Kroah-Hartman
2013-06-05 21:34 ` [ 081/127] cgroup: fix a subtle bug in descendant pre-order walk Greg Kroah-Hartman
2013-06-05 21:34 ` [ 082/127] powerpc/32bit:Store temporary result in r0 instead of r8 Greg Kroah-Hartman
2013-06-05 21:34 ` [ 083/127] powerpc/tm: Make room for hypervisor in abort cause codes Greg Kroah-Hartman
2013-06-05 21:34 ` [ 084/127] powerpc/tm: Update cause codes documentation Greg Kroah-Hartman
2013-06-05 21:34 ` [ 085/127] powerpc/tm: Fix userspace stack corruption on signal delivery for active transactions Greg Kroah-Hartman
2013-06-05 21:34 ` [ 086/127] powerpc/tm: Abort on emulation and alignment faults Greg Kroah-Hartman
2013-06-05 21:34 ` [ 087/127] powerpc/tm: Move TM abort cause codes to uapi Greg Kroah-Hartman
2013-06-05 21:34 ` [ 088/127] iscsi-target: fix heap buffer overflow on error Greg Kroah-Hartman
2013-06-05 21:34 ` [ 089/127] ib_srpt: Call target_sess_cmd_list_set_waiting during shutdown_session Greg Kroah-Hartman
2013-06-05 21:34 ` [ 090/127] NFSv4: Fix a thinko in nfs4_try_open_cached Greg Kroah-Hartman
2013-06-05 21:34 ` [ 091/127] KVM: Emulate multibyte NOP Greg Kroah-Hartman
2013-06-05 21:34 ` [ 092/127] KVM: fix sil/dil/bpl/spl in the mod/rm fields Greg Kroah-Hartman
2013-06-05 21:34 ` [ 093/127] regulator: palmas: Fix "enable_reg" to point to the correct reg for SMPS10 Greg Kroah-Hartman
2013-06-05 21:34 ` [ 094/127] powerpc/pseries: Always enable CONFIG_HOTPLUG_CPU on PSERIES SMP Greg Kroah-Hartman
2013-06-05 21:34 ` [ 095/127] reiserfs: fix deadlock with nfs racing on create/lookup Greg Kroah-Hartman
2013-06-05 21:34 ` [ 096/127] reiserfs: fix problems with chowning setuid file w/ xattrs Greg Kroah-Hartman
2013-06-05 21:34 ` [ 097/127] reiserfs: fix spurious multiple-fill in reiserfs_readdir_dentry Greg Kroah-Hartman
2013-06-05 21:34 ` [ 098/127] jfs: fix a couple races Greg Kroah-Hartman
2013-06-05 21:34 ` [ 099/127] xen-netback: remove skb in xen_netbk_alloc_page Greg Kroah-Hartman
2013-06-05 21:34 ` [ 100/127] iwlwifi: mvm: fix aggregation drain flow Greg Kroah-Hartman
2013-06-05 21:34 ` [ 101/127] iommu/amd: Re-enable IOMMU event log interrupt after handling Greg Kroah-Hartman
2013-06-05 21:34 ` [ 102/127] iommu/amd: Workaround for ERBT1312 Greg Kroah-Hartman
2013-06-05 21:34 ` [ 103/127] ACPI / PM: Allow device power states to be used for CONFIG_PM unset Greg Kroah-Hartman
2013-06-05 21:34 ` [ 104/127] ACPI / video: Add "Asus UL30A" to ACPI video detect blacklist Greg Kroah-Hartman
2013-06-05 21:34 ` [ 105/127] drm/nvc0/ce: disable ce1 on a number of chipsets Greg Kroah-Hartman
2013-06-05 21:34 ` [ 106/127] mac80211: fix direct probe auth Greg Kroah-Hartman
2013-06-05 21:34 ` [ 107/127] mac80211: close AP_VLAN interfaces before unregistering all Greg Kroah-Hartman
2013-06-05 21:34 ` [ 108/127] iwlwifi: dvm: fix zero LQ CMD sending avoidance Greg Kroah-Hartman
2013-06-05 21:34 ` [ 109/127] iwlwifi: mvm: tell firmware to let multicast frames in Greg Kroah-Hartman
2013-06-05 21:34 ` [ 110/127] cfg80211: check wdev->netdev in connection work Greg Kroah-Hartman
2013-06-05 21:34 ` [ 111/127] ath9k: use correct OTP register offsets for AR9550 Greg Kroah-Hartman
2013-06-05 21:34 ` [ 112/127] tg3: Add read dma workaround for 5720 Greg Kroah-Hartman
2013-06-05 21:34 ` [ 113/127] net: can: kvaser_usb: fix reception on "USBcan Pro" and "USBcan R" type hardware Greg Kroah-Hartman
2013-06-05 21:34 ` [ 114/127] IB/iser: Return error to upper layers on EAGAIN registration failures Greg Kroah-Hartman
2013-06-05 21:34 ` [ 115/127] ASoC: davinci: fix sample rotation Greg Kroah-Hartman
2013-06-05 21:34 ` Greg Kroah-Hartman [this message]
2013-06-05 21:34 ` [ 117/127] target: Re-instate sess_wait_list for target_wait_for_sess_cmds Greg Kroah-Hartman
2013-06-05 21:34 ` [ 118/127] target/file: Fix off-by-one READ_CAPACITY bug for !S_ISBLK export Greg Kroah-Hartman
2013-06-05 21:34 ` [ 119/127] leds: leds-gpio: reserve gpio before using it Greg Kroah-Hartman
2013-06-05 21:34 ` [ 120/127] xen-netback: coalesce slots in TX path and fix regressions Greg Kroah-Hartman
2013-06-05 21:34 ` [ 121/127] xen-netback: dont disconnect frontend when seeing oversize packet Greg Kroah-Hartman
2013-06-05 21:34 ` [ 122/127] xen-netback: remove redundent parameter in netbk_count_requests Greg Kroah-Hartman
2013-06-05 21:34 ` [ 123/127] xen-netback: avoid allocating variable size array on stack Greg Kroah-Hartman
2013-06-05 21:34 ` [ 124/127] xen-netfront: reduce gso_max_size to account for max TCP header Greg Kroah-Hartman
2013-06-05 21:34 ` [ 125/127] iwlwifi: mvm: remove P2P_DEVICE support Greg Kroah-Hartman
2013-06-05 21:34 ` [ 126/127] mac80211_hwsim: " Greg Kroah-Hartman
2013-06-05 21:34 ` [ 127/127] xen-netback: better names for thresholds Greg Kroah-Hartman
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=20130605213231.156897031@linuxfoundation.org \
--to=gregkh@linuxfoundation.org \
--cc=bernd.schubert@itwm.fraunhofer.de \
--cc=linux-kernel@vger.kernel.org \
--cc=mszeredi@suse.cz \
--cc=stable@vger.kernel.org \
--cc=steve.shuo.feng@gmail.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