public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Greg KH <gregkh@suse.de>
To: linux-kernel@vger.kernel.org, stable@kernel.org
Cc: stable-review@kernel.org, torvalds@linux-foundation.org,
	akpm@linux-foundation.org, alan@lxorguk.ukuu.org.uk,
	Jiaying Zhang <jiayingz@google.com>,
	"Theodore Tso" <tytso@mit.edu>, Chuck Ebbert <cebbert@redhat.com>
Subject: [020/129] ext4: move aio completion after unwritten extent conversion
Date: Sat, 18 Sep 2010 12:11:58 -0700	[thread overview]
Message-ID: <20100918191258.972260079@clark.site> (raw)
In-Reply-To: <20100918191317.GA11386@kroah.com>

2.6.35-stable review patch.  If anyone has any objections, please let us know.

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

From: Jiaying Zhang <jiayingz@google.com>

commit 5b3ff237bef43b9e7fb7d1eb858e29b73fd664f9 upstream.

This patch is to be applied upon Christoph's "direct-io: move aio_complete
into ->end_io" patch. It adds iocb and result fields to struct ext4_io_end_t,
so that we can call aio_complete from  ext4_end_io_nolock() after the extent
conversion has finished.

I have verified with Christoph's aio-dio test that used to fail after a few
runs on an original kernel but now succeeds on the patched kernel.

See http://thread.gmane.org/gmane.comp.file-systems.ext4/19659 for details.

Signed-off-by: Jiaying Zhang <jiayingz@google.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Cc: Chuck Ebbert <cebbert@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 fs/ext4/ext4.h  |    4 +++-
 fs/ext4/inode.c |   17 ++++++++++++-----
 2 files changed, 15 insertions(+), 6 deletions(-)

--- a/fs/ext4/ext4.h
+++ b/fs/ext4/ext4.h
@@ -167,13 +167,15 @@ struct mpage_da_data {
 };
 #define	EXT4_IO_UNWRITTEN	0x1
 typedef struct ext4_io_end {
-	struct list_head	list;		/* per-file finished AIO list */
+	struct list_head	list;		/* per-file finished IO list */
 	struct inode		*inode;		/* file being written to */
 	unsigned int		flag;		/* unwritten or not */
 	struct page		*page;		/* page struct for buffer write */
 	loff_t			offset;		/* offset in the file */
 	ssize_t			size;		/* size of the extent */
 	struct work_struct	work;		/* data work queue */
+	struct kiocb		*iocb;		/* iocb struct for AIO */
+	int			result;		/* error value for AIO */
 } ext4_io_end_t;
 
 /*
--- a/fs/ext4/inode.c
+++ b/fs/ext4/inode.c
@@ -3668,6 +3668,8 @@ static int ext4_end_io_nolock(ext4_io_en
 		return ret;
 	}
 
+	if (io->iocb)
+		aio_complete(io->iocb, io->result, 0);
 	/* clear the DIO AIO unwritten flag */
 	io->flag = 0;
 	return ret;
@@ -3767,6 +3769,8 @@ static ext4_io_end_t *ext4_init_io_end (
 		io->offset = 0;
 		io->size = 0;
 		io->page = NULL;
+		io->iocb = NULL;
+		io->result = 0;
 		INIT_WORK(&io->work, ext4_end_io_work);
 		INIT_LIST_HEAD(&io->list);
 	}
@@ -3796,12 +3800,18 @@ static void ext4_end_io_dio(struct kiocb
 	if (io_end->flag != EXT4_IO_UNWRITTEN){
 		ext4_free_io_end(io_end);
 		iocb->private = NULL;
-		goto out;
+out:
+		if (is_async)
+			aio_complete(iocb, ret, 0);
+		return;
 	}
 
 	io_end->offset = offset;
 	io_end->size = size;
-	io_end->flag = EXT4_IO_UNWRITTEN;
+	if (is_async) {
+		io_end->iocb = iocb;
+		io_end->result = ret;
+	}
 	wq = EXT4_SB(io_end->inode->i_sb)->dio_unwritten_wq;
 
 	/* queue the work to convert unwritten extents to written */
@@ -3813,9 +3823,6 @@ static void ext4_end_io_dio(struct kiocb
 	list_add_tail(&io_end->list, &ei->i_completed_io_list);
 	spin_unlock_irqrestore(&ei->i_completed_io_lock, flags);
 	iocb->private = NULL;
-out:
-	if (is_async)
-		aio_complete(iocb, ret, 0);
 }
 
 static void ext4_end_io_buffer_write(struct buffer_head *bh, int uptodate)



  parent reply	other threads:[~2010-09-18 19:37 UTC|newest]

Thread overview: 132+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-09-18 19:13 [000/129] 2.6.35.5 -stable review Greg KH
2010-09-18 19:11 ` [001/129] hwmon: (ads7871) Fix ads7871_probe error paths Greg KH
2010-09-18 19:11 ` [002/129] hwmon: (k8temp) Differentiate between AM2 and ASB1 Greg KH
2010-09-18 19:11 ` [003/129] xen: handle events as edge-triggered Greg KH
2010-09-18 19:11 ` [004/129] xen: use percpu interrupts for IPIs and VIRQs Greg KH
2010-09-18 19:11 ` [005/129] xfs: fix untrusted inode number lookup Greg KH
2010-09-18 19:11 ` [006/129] xfs: ensure we mark all inodes in a freed cluster XFS_ISTALE Greg KH
2010-09-18 19:11 ` [007/129] ALSA: hda - Add Sony VAIO quirk for ALC269 Greg KH
2010-09-18 19:11 ` [008/129] ALSA: HDA: Use model=auto for LG R510 Greg KH
2010-09-18 19:11 ` [009/129] ALSA: hda - Rename iMic to Int Mic on Lenovo NB0763 Greg KH
2010-09-18 19:11 ` [010/129] libata-sff: remove harmful BUG_ON from ata_bmdma_qc_issue Greg KH
2010-09-18 19:11 ` [011/129] sata_mv: fix broken DSM/TRIM support (v2) Greg KH
2010-09-18 19:11 ` [012/129] pata_cmd64x: revert commit d62f5576 Greg KH
2010-09-18 19:11 ` [013/129] writeback: write_cache_pages doesnt terminate at nr_to_write <= 0 Greg KH
2010-09-18 19:11 ` [014/129] x86, tsc, sched: Recompute cyc2ns_offsets during resume from sleep states Greg KH
2010-09-18 19:11 ` [015/129] perf, x86, Pentium4: Clear the P4_CCCR_FORCE_OVF flag Greg KH
2010-09-18 19:11 ` [016/129] netfilter: fix CONFIG_COMPAT support Greg KH
2010-09-18 19:11 ` [017/129] PCI: MSI: Remove unsafe and unnecessary hardware access Greg KH
2010-09-18 19:11 ` [018/129] PCI: MSI: Restore read_msi_msg_desc(); add get_cached_msi_msg_desc() Greg KH
2010-09-18 19:11 ` [019/129] direct-io: move aio_complete into ->end_io Greg KH
2010-09-18 19:11 ` Greg KH [this message]
2010-09-18 19:11 ` [021/129] xfs: move aio completion after unwritten extent conversion Greg KH
2010-09-18 19:12 ` [022/129] Revert "Input: appletouch - fix integer overflow issue" Greg KH
2010-09-18 19:12 ` [023/129] ALSA: hda - Handle missing NID 0x1b on ALC259 codec Greg KH
2010-09-18 19:12 ` [024/129] ALSA: hda - Handle pin NID 0x1a on ALC259/269 Greg KH
2010-09-18 19:12 ` [025/129] Staging: rt2870sta: Add more device IDs from vendor drivers Greg KH
2010-09-18 19:12 ` [026/129] staging: hv: Fix missing functions for net_device_ops Greg KH
2010-09-18 19:12 ` [027/129] staging: hv: Fixed bounce kmap problem by using correct index Greg KH
2010-09-18 19:12 ` [028/129] staging: hv: Fixed the value of the 64bit-hole inside ring buffer Greg KH
2010-09-18 19:12 ` [029/129] staging: hv: Increased storvsc ringbuffer and max_io_requests Greg KH
2010-09-18 19:12 ` [030/129] staging: hv: Fixed lockup problem with bounce_buffer scatter list Greg KH
2010-09-18 19:12 ` [031/129] fuse: flush background queue on connection close Greg KH
2010-09-18 19:12 ` [032/129] mac80211: delete work timer Greg KH
2010-09-18 19:12 ` [033/129] ath9k_htc: Fix disconnect issue in HT40 mode Greg KH
2010-09-18 19:12 ` [034/129] ath9k_hw: Fix EEPROM uncompress block reading on AR9003 Greg KH
2010-09-18 19:12 ` [035/129] ath9k_hw: fix parsing of HT40 5 GHz CTLs Greg KH
2010-09-18 19:12 ` [036/129] ocfs2: Fix incorrect checksum validation error Greg KH
2010-09-18 19:12 ` [037/129] serial: bfin_sport_uart: restore transmit frame sync fix Greg KH
2010-09-18 19:12 ` [038/129] USB: ehci-ppc-of: problems in unwind Greg KH
2010-09-18 19:12 ` [039/129] USB: Fix kernel oops with g_ether and Windows Greg KH
2010-09-18 19:12 ` [040/129] USB: CP210x Add new device ID Greg KH
2010-09-18 19:12 ` [041/129] USB: cp210x: Add B&G H3000 link cable ID Greg KH
2010-09-18 19:12 ` [042/129] usb: allow drivers to use allocated bandwidth until unbound Greg KH
2010-09-18 19:12 ` [043/129] USB: ftdi_sio: Added custom PIDs for ChamSys products Greg KH
2010-09-18 19:12 ` [044/129] usb: serial: mos7840: Add USB ID to support the B&B Electronics USOPTL4-2P Greg KH
2010-09-18 19:12 ` [045/129] usb: serial: mos7840: Add USB IDs to support more B&B USB/RS485 converters Greg KH
2010-09-18 19:12 ` [046/129] ima: always maintain counters Greg KH
2010-09-18 19:12 ` [047/129] USB: cxacru: Use a bulk/int URB to access the command endpoint Greg KH
2010-09-18 19:12 ` [048/129] USB: cdc-acm: Adding second ACM channel support for various Nokia and one Samsung phones Greg KH
2010-09-18 19:12 ` [049/129] USB: cdc-acm: Add pseudo modem without AT command capabilities Greg KH
2010-09-18 19:12 ` [050/129] USB: cdc-acm: Fixing crash when ACM probing interfaces with no endpoint descriptors Greg KH
2010-09-18 19:12 ` [051/129] ALSA: hda - Add a new hp-laptop model for Conexant 5066, tested on HP G60 Greg KH
2010-09-18 19:12 ` [052/129] ALSA: usb-audio: fix detection of vendor-specific device protocol settings Greg KH
2010-09-18 19:12 ` [053/129] ALSA: virtuoso: work around missing reset in the Xonar DS Windows driver Greg KH
2010-09-18 19:12 ` [054/129] ALSA: virtuoso: fix setting of Xonar DS line-in/mic-in controls Greg KH
2010-09-18 19:12 ` [055/129] ALSA: seq/oss - Fix double-free at error path of snd_seq_oss_open() Greg KH
2010-09-18 19:12 ` [056/129] ALSA: usb - Release capture substream URBs properly Greg KH
2010-09-18 19:12 ` [057/129] ALSA: hda - Add quirk for Lenovo T400s Greg KH
2010-09-18 19:12 ` [058/129] ALSA: hda - Add errata initverb sequence for CS42xx codecs Greg KH
2010-09-18 19:12 ` [059/129] ALSA: hda - Fix wrong HP pin detection in snd_hda_parse_pin_def_config() Greg KH
2010-09-18 19:12 ` [060/129] ALSA: usb-audio: Assume first control interface is for audio Greg KH
2010-09-18 19:12 ` [061/129] ALSA: hda - patch_nvhdmi.c: Add missing codec IDs, unify names Greg KH
2010-09-18 19:12 ` [062/129] swap: prevent reuse during hibernation Greg KH
2010-09-18 19:12 ` [063/129] swap: discard while swapping only if SWAP_FLAG_DISCARD Greg KH
2010-09-18 19:12 ` [064/129] swap: do not send discards as barriers Greg KH
2010-09-18 19:12 ` [065/129] sysfs: checking for NULL instead of ERR_PTR Greg KH
2010-09-18 19:12 ` [066/129] oprofile: fix crash when accessing freed task structs Greg KH
2010-09-18 19:12 ` [067/129] oprofile, x86: fix init_sysfs error handling Greg KH
2010-09-18 19:12 ` [068/129] oprofile, x86: fix init_sysfs() function stub Greg KH
2010-09-18 19:12 ` [069/129] HID: Set Report ID properly for Output reports on the Control endpoint Greg KH
2010-09-18 19:12 ` [070/129] libata: skip EH autopsy and recovery during suspend Greg KH
2010-09-18 19:12 ` [071/129] libata,pata_via: revert ata_wait_idle() removal from ata_sff/via_tf_load() Greg KH
2010-09-18 19:12 ` [072/129] ahci: fix hang on failed softreset Greg KH
2010-09-18 19:12 ` [073/129] O_DIRECT: fix the splitting up of contiguous I/O Greg KH
2010-09-18 19:12 ` [074/129] tracing: Fix a race in function profile Greg KH
2010-09-18 19:12 ` [075/129] tracing: Do not allow llseek to set_ftrace_filter Greg KH
2010-09-18 19:12 ` [076/129] tracing: t_start: reset FTRACE_ITER_HASH in case of seek/pread Greg KH
2010-09-18 19:12 ` [077/129] irda: off by one Greg KH
2010-09-18 19:12 ` [078/129] hp_accel: add quirks for HP ProBook 532x and HP Mini 5102 Greg KH
2010-09-18 19:12 ` [079/129] gcov: fix null-pointer dereference for certain module types Greg KH
2010-09-18 19:12 ` [080/129] tmio_mmc: dont clear unhandled pending interrupts Greg KH
2010-09-18 19:12 ` [081/129] mmc: fix the use of kunmap_atomic() in tmio_mmc.h Greg KH
2010-09-18 19:13 ` [082/129] mmc: fix all hangs related to mmc/sd card insert/removal during suspend/resume Greg KH
2010-09-18 19:13 ` [083/129] mmc: build fix: mmc_pm_notify is only available with CONFIG_PM=y Greg KH
2010-09-18 19:13 ` [084/129] statfs() gives ESTALE error Greg KH
2010-09-18 19:13 ` [085/129] minix: fix regression in minix_mkdir() Greg KH
2010-09-18 19:13 ` [086/129] bounce: call flush_dcache_page() after bounce_copy_vec() Greg KH
2010-09-18 19:13 ` [087/129] mm: compaction: handle active and inactive fairly in too_many_isolated Greg KH
2010-09-18 19:13 ` [088/129] kernel/groups.c: fix integer overflow in groups_search Greg KH
2010-09-18 19:13 ` [089/129] binfmt_misc: fix binfmt_misc priority Greg KH
2010-09-18 19:13 ` [090/129] Input: i8042 - fix device removal on unload Greg KH
2010-09-18 19:13 ` [091/129] Input: i8042 - reset keyboard controller wehen resuming from S2R Greg KH
2010-09-18 19:13 ` [092/129] memory hotplug: fix next block calculation in is_removable Greg KH
2010-09-18 19:13 ` [093/129] perf: Initialize callchains rootss childen hits Greg KH
2010-09-18 19:13 ` [094/129] powerpc/perf_event: Reduce latency of calling perf_event_do_pending Greg KH
2010-09-18 19:13 ` [095/129] p54: fix tx feedback status flag check Greg KH
2010-09-18 19:13 ` [096/129] ath5k: check return value of ieee80211_get_tx_rate Greg KH
2010-09-18 19:13 ` [097/129] wireless extensions: fix kernel heap content leak Greg KH
2010-09-18 19:13 ` [098/129] RDMA/cxgb3: Dont exceed the max HW CQ depth Greg KH
2010-09-18 19:13 ` [099/129] x86, tsc: Fix a preemption leak in restore_sched_clock_state() Greg KH
2010-09-18 19:13 ` [100/129] x86-64, compat: Test %rax for the syscall number, not %eax Greg KH
2010-09-18 19:13 ` [101/129] compat: Make compat_alloc_user_space() incorporate the access_ok() Greg KH
2010-09-18 19:13 ` [102/129] x86-64, compat: Retruncate rax after ia32 syscall entry tracing Greg KH
2010-09-18 19:13 ` [103/129] ALSA: HDA: Enable internal speaker on Dell M101z Greg KH
2010-09-18 19:13 ` [104/129] x86: hpet: Work around hardware stupidity Greg KH
2010-09-18 19:13 ` [105/129] arm: fix really nasty sigreturn bug Greg KH
2010-09-18 19:13 ` [106/129] hwmon: (emc1403) Remove unnecessary hwmon_device_unregister Greg KH
2010-09-18 19:13 ` [107/129] hwmon: (f75375s) Shift control mode to the correct bit position Greg KH
2010-09-18 19:13 ` [108/129] hwmon: (f75375s) Do not overwrite values read from registers Greg KH
2010-09-18 19:13 ` [109/129] apm_power: Add missing break statement Greg KH
2010-09-18 19:13 ` [110/129] cifs: fix potential double put of TCP session reference Greg KH
2010-09-18 19:13 ` [111/129] NFS: Fix a typo in nfs_sockaddr_match_ipaddr6 Greg KH
2010-09-18 19:13 ` [112/129] SUNRPC: Fix race corrupting rpc upcall Greg KH
2010-09-18 19:13 ` [113/129] agp/intel: Promote warning about failure to setup flush to error Greg KH
2010-09-18 19:13 ` [114/129] drm/radeon/kms: fix a regression on r7xx AGP due to the HDP flush fix Greg KH
2010-09-18 19:13 ` [115/129] drm/i915: Enable MI_FLUSH on Sandybridge Greg KH
2010-09-18 19:13 ` [116/129] drm/radeon/kms: force legacy pll algo for RV515 LVDS Greg KH
2010-09-18 19:13 ` [117/129] drm/radeon/kms: force legacy pll algo for RV620 LVDS Greg KH
2010-09-18 19:13 ` [118/129] drm/radeon/kms: properly set crtc high base on r7xx Greg KH
2010-09-18 19:13 ` [119/129] drm/radeon/kms/evergreen: fix gpu hangs in userspace accel code Greg KH
2010-09-18 19:13 ` [120/129] drm/radeon/kms/evergreen: fix backend setup Greg KH
2010-09-18 19:13 ` [121/129] i915: return -EFAULT if copy_to_user fails Greg KH
2010-09-18 19:13 ` [122/129] i915_gem: " Greg KH
2010-09-18 19:13 ` [123/129] drm/i915/dp: Really try 5 times before giving up Greg KH
2010-09-18 19:13 ` [124/129] drm/i915: Allocate the PCI resource for the MCHBAR Greg KH
2010-09-18 19:13 ` [125/129] drm/i915: overlay on gen2 cant address above 1G Greg KH
2010-09-18 19:13 ` [126/129] drm/i915: Prevent double dpms on Greg KH
2010-09-18 19:13 ` [127/129] drm/i915: dont enable self-refresh on Ironlake Greg KH
2010-09-18 19:13 ` [128/129] Revert "drm/i915: Allow LVDS on pipe A on gen4+" Greg KH
2010-09-18 19:13 ` [129/129] drm: Only decouple the old_fb from the crtc is we call mode_set* Greg KH
2010-09-18 21:08 ` [000/129] 2.6.35.5 -stable review Marcin Slusarz
2010-09-19  4:04   ` Greg KH

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=20100918191258.972260079@clark.site \
    --to=gregkh@suse.de \
    --cc=akpm@linux-foundation.org \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=cebbert@redhat.com \
    --cc=jiayingz@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=stable-review@kernel.org \
    --cc=stable@kernel.org \
    --cc=torvalds@linux-foundation.org \
    --cc=tytso@mit.edu \
    /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