public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* Re: Linux 2.6.27.32
@ 2009-09-09 14:40 Jayson King
  0 siblings, 0 replies; 5+ messages in thread
From: Jayson King @ 2009-09-09 14:40 UTC (permalink / raw)
  To: gregkh; +Cc: LKML

[-- Attachment #1: Type: text/plain, Size: 311 bytes --]

Greg KH wrote:
 >Yes, this was just reported :)
 >
 >Do you have a proposed fix that is also upstream?

Revert the incomplete version of "ocfs2: Initialize the..." patch which 
is in -stable now and apply this one instead.

Jayson R. King

(sorry if I am dropping anyone from CC. I am not subscribed to LKML)



[-- Attachment #2: aops-new.patch --]
[-- Type: text/plain, Size: 5455 bytes --]

From: Sunil Mushran <sunil.mushran@oracle.com>

commit e7432675f8ca868a4af365759a8d4c3779a3d922 upstream.

In a non-sparse extend, we correctly allocate (and zero) the clusters between
the old_i_size and pos, but we don't zero the portions of the cluster we're
writing to outside of pos<->len.

It handles clustersize > pagesize and blocksize < pagesize.

[Cleaned up by Joel Becker.]

Signed-off-by: Sunil Mushran <sunil.mushran@oracle.com>
Signed-off-by: Joel Becker <joel.becker@oracle.com>

---
 fs/ocfs2/aops.c |   66 +++++++++++++++++++++++++++++++++++++++-----------------
 1 file changed, 47 insertions(+), 19 deletions(-)

--- a/fs/ocfs2/aops.c
+++ b/fs/ocfs2/aops.c
@@ -908,18 +908,17 @@ struct ocfs2_write_cluster_desc {
 	 */
 	unsigned	c_new;
 	unsigned	c_unwritten;
+	unsigned	c_needs_zero;
 };
 
-static inline int ocfs2_should_zero_cluster(struct ocfs2_write_cluster_desc *d)
-{
-	return d->c_new || d->c_unwritten;
-}
-
 struct ocfs2_write_ctxt {
 	/* Logical cluster position / len of write */
 	u32				w_cpos;
 	u32				w_clen;
 
+	/* First cluster allocated in a nonsparse extend */
+	u32				w_first_new_cpos;
+
 	struct ocfs2_write_cluster_desc	w_desc[OCFS2_MAX_CLUSTERS_PER_PAGE];
 
 	/*
@@ -997,6 +996,7 @@ static int ocfs2_alloc_write_ctxt(struct
 		return -ENOMEM;
 
 	wc->w_cpos = pos >> osb->s_clustersize_bits;
+	wc->w_first_new_cpos = UINT_MAX;
 	cend = (pos + len - 1) >> osb->s_clustersize_bits;
 	wc->w_clen = cend - wc->w_cpos + 1;
 	get_bh(di_bh);
@@ -1234,19 +1234,17 @@ out:
  */
 static int ocfs2_write_cluster(struct address_space *mapping,
 			       u32 phys, unsigned int unwritten,
+			       unsigned int should_zero,
 			       struct ocfs2_alloc_context *data_ac,
 			       struct ocfs2_alloc_context *meta_ac,
 			       struct ocfs2_write_ctxt *wc, u32 cpos,
 			       loff_t user_pos, unsigned user_len)
 {
-	int ret, i, new, should_zero = 0;
+	int ret, i, new;
 	u64 v_blkno, p_blkno;
 	struct inode *inode = mapping->host;
 
 	new = phys == 0 ? 1 : 0;
-	if (new || unwritten)
-		should_zero = 1;
-
 	if (new) {
 		u32 tmp_pos;
 
@@ -1356,7 +1354,9 @@ static int ocfs2_write_cluster_by_desc(s
 			local_len = osb->s_clustersize - cluster_off;
 
 		ret = ocfs2_write_cluster(mapping, desc->c_phys,
-					  desc->c_unwritten, data_ac, meta_ac,
+					  desc->c_unwritten,
+					  desc->c_needs_zero,
+					  data_ac, meta_ac,
 					  wc, desc->c_cpos, pos, local_len);
 		if (ret) {
 			mlog_errno(ret);
@@ -1406,14 +1406,14 @@ static void ocfs2_set_target_boundaries(
 		 * newly allocated cluster.
 		 */
 		desc = &wc->w_desc[0];
-		if (ocfs2_should_zero_cluster(desc))
+		if (desc->c_needs_zero)
 			ocfs2_figure_cluster_boundaries(osb,
 							desc->c_cpos,
 							&wc->w_target_from,
 							NULL);
 
 		desc = &wc->w_desc[wc->w_clen - 1];
-		if (ocfs2_should_zero_cluster(desc))
+		if (desc->c_needs_zero)
 			ocfs2_figure_cluster_boundaries(osb,
 							desc->c_cpos,
 							NULL,
@@ -1481,13 +1481,28 @@ static int ocfs2_populate_write_desc(str
 			phys++;
 		}
 
+		/*
+		 * If w_first_new_cpos is < UINT_MAX, we have a non-sparse
+		 * file that got extended.  w_first_new_cpos tells us
+		 * where the newly allocated clusters are so we can
+		 * zero them.
+		 */
+		if (desc->c_cpos >= wc->w_first_new_cpos) {
+			BUG_ON(phys == 0);
+			desc->c_needs_zero = 1;
+		}
+
 		desc->c_phys = phys;
 		if (phys == 0) {
 			desc->c_new = 1;
+			desc->c_needs_zero = 1;
 			*clusters_to_alloc = *clusters_to_alloc + 1;
 		}
-		if (ext_flags & OCFS2_EXT_UNWRITTEN)
+
+		if (ext_flags & OCFS2_EXT_UNWRITTEN) {
 			desc->c_unwritten = 1;
+			desc->c_needs_zero = 1;
+		}
 
 		num_clusters--;
 	}
@@ -1644,10 +1659,13 @@ static int ocfs2_expand_nonsparse_inode(
 	if (newsize <= i_size_read(inode))
 		return 0;
 
-	ret = ocfs2_extend_no_holes(inode, newsize, newsize - len);
+	ret = ocfs2_extend_no_holes(inode, newsize, pos);
 	if (ret)
 		mlog_errno(ret);
 
+	wc->w_first_new_cpos =
+		ocfs2_clusters_for_bytes(inode->i_sb, i_size_read(inode));
+
 	return ret;
 }
 
@@ -1656,7 +1674,7 @@ int ocfs2_write_begin_nolock(struct addr
 			     struct page **pagep, void **fsdata,
 			     struct buffer_head *di_bh, struct page *mmap_page)
 {
-	int ret, credits = OCFS2_INODE_UPDATE_CREDITS;
+	int ret, cluster_of_pages, credits = OCFS2_INODE_UPDATE_CREDITS;
 	unsigned int clusters_to_alloc, extents_to_split;
 	struct ocfs2_write_ctxt *wc;
 	struct inode *inode = mapping->host;
@@ -1724,8 +1742,19 @@ int ocfs2_write_begin_nolock(struct addr
 
 	}
 
-	ocfs2_set_target_boundaries(osb, wc, pos, len,
-				    clusters_to_alloc + extents_to_split);
+	/*
+	 * We have to zero sparse allocated clusters, unwritten extent clusters,
+	 * and non-sparse clusters we just extended.  For non-sparse writes,
+	 * we know zeros will only be needed in the first and/or last cluster.
+	 */
+	if (clusters_to_alloc || extents_to_split ||
+	    wc->w_desc[0].c_needs_zero ||
+	    wc->w_desc[wc->w_clen - 1].c_needs_zero)
+		cluster_of_pages = 1;
+	else
+		cluster_of_pages = 0;
+
+	ocfs2_set_target_boundaries(osb, wc, pos, len, cluster_of_pages);
 
 	handle = ocfs2_start_trans(osb, credits);
 	if (IS_ERR(handle)) {
@@ -1753,8 +1782,7 @@ int ocfs2_write_begin_nolock(struct addr
 	 * extent.
 	 */
 	ret = ocfs2_grab_pages_for_write(mapping, wc, wc->w_cpos, pos,
-					 clusters_to_alloc + extents_to_split,
-					 mmap_page);
+					 cluster_of_pages, mmap_page);
 	if (ret) {
 		mlog_errno(ret);
 		goto out_commit;

^ permalink raw reply	[flat|nested] 5+ messages in thread
* Linux 2.6.27.32
@ 2009-09-09  4:08 Greg KH
  2009-09-09  4:08 ` Greg KH
  2009-09-09  7:10 ` Arkadiusz Miskiewicz
  0 siblings, 2 replies; 5+ messages in thread
From: Greg KH @ 2009-09-09  4:08 UTC (permalink / raw)
  To: linux-kernel, Andrew Morton, torvalds, stable; +Cc: lwn

I'm announcing the release of the 2.6.27.32 kernel.  All users of the
2.6.27 kernel series are very strongly encouraged to upgrade.

I'll also be replying to this message with a copy of the patch between
2.6.27.31 and 2.6.27.32

The updated 2.6.27.y git tree can be found at:
        git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-2.6.27.y.git
and can be browsed at the normal kernel.org git web browser:
        http://git.kernel.org/?p=linux/kernel/git/stable/linux-2.6.27.y.git;a=summary

thanks,

greg k-h

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

 Makefile                              |    2 
 arch/x86/kvm/mmu.c                    |   63 +++++++-------
 arch/x86/kvm/svm.c                    |    1 
 arch/x86/kvm/vmx.c                    |   25 ++++-
 arch/x86/kvm/vmx.h                    |    1 
 arch/x86/kvm/x86.c                    |  146 +++++++++++++++++++++++-----------
 drivers/char/mxser.c                  |    2 
 drivers/char/nozomi.c                 |    1 
 drivers/net/ehea/ehea_main.c          |    3 
 drivers/parport/share.c               |   13 ++-
 drivers/scsi/sr_ioctl.c               |    5 +
 drivers/usb/serial/cyberjack.c        |    7 -
 drivers/usb/serial/cypress_m8.c       |    4 
 drivers/usb/serial/empeg.c            |    6 -
 drivers/usb/serial/garmin_gps.c       |    8 -
 drivers/usb/serial/generic.c          |    6 -
 drivers/usb/serial/io_edgeport.c      |    8 -
 drivers/usb/serial/io_ti.c            |    8 -
 drivers/usb/serial/ipaq.c             |    6 -
 drivers/usb/serial/ipw.c              |    3 
 drivers/usb/serial/iuu_phoenix.c      |    1 
 drivers/usb/serial/kobil_sct.c        |    6 -
 drivers/usb/serial/mos7720.c          |    7 -
 drivers/usb/serial/mos7840.c          |    6 -
 drivers/usb/serial/option.c           |    3 
 drivers/usb/serial/sierra.c           |    3 
 drivers/usb/serial/ti_usb_3410_5052.c |   17 ---
 drivers/usb/serial/visor.c            |    8 -
 fs/ocfs2/aops.c                       |   64 ++++++++++----
 include/asm-x86/kvm_host.h            |   10 ++
 include/linux/parport.h               |    4 
 include/linux/sunrpc/xprt.h           |    1 
 kernel/fork.c                         |   21 +---
 kernel/kthread.c                      |    2 
 kernel/signal.c                       |   15 +--
 net/appletalk/ddp.c                   |    1 
 net/can/raw.c                         |    1 
 net/econet/af_econet.c                |    1 
 net/irda/af_irda.c                    |    1 
 net/llc/af_llc.c                      |    1 
 net/netrom/af_netrom.c                |    1 
 net/rose/af_rose.c                    |    1 
 net/sunrpc/clnt.c                     |    1 
 net/sunrpc/xprt.c                     |    6 -
 net/sunrpc/xprtsock.c                 |   37 +++++++-
 sound/core/pcm_lib.c                  |   39 +--------
 sound/pci/hda/patch_realtek.c         |   36 +++++---
 virt/kvm/kvm_main.c                   |   57 ++++++++-----
 48 files changed, 362 insertions(+), 307 deletions(-)


Alan Cox (1):
      parport: quickfix the proc registration bug

Avi Kivity (14):
      KVM: VMX: Change cs reset state to be a data segment
      KVM: VMX: Change segment dpl at reset to 3
      KVM: Load real mode segments correctly
      KVM: Allocate guest memory as MAP_PRIVATE, not MAP_SHARED
      KVM: Don't call get_user_pages(.force = 1)
      KVM: MMU: Add locking around kvm_mmu_slot_remove_write_access()
      KVM: MMU: Flush tlbs after clearing write permission when accessing dirty log
      KVM: MMU: Fix setting the accessed bit on non-speculative sptes
      KVM: VMX: Don't allow uninhibited access to EFER on i386
      KVM: SVM: Remove port 80 passthrough
      KVM: Make EFER reads safe when EFER does not exist
      KVM: VMX: Handle vmx instruction vmexits
      KVM: Make paravirt tlb flush also reload the PAE PDPTRs
      KVM: Fix PDPTR reloading on CR4 writes

Chuck Ebbert (1):
      Remove low_latency flag setting from nozomi and mxser drivers

Clemens Ladisch (1):
      sound: pcm_lib: fix unsorted list constraint handling

Dave Hansen (4):
      KVM: Reduce kvm stack usage in kvm_arch_vm_ioctl()
      KVM: Reduce stack usage in kvm_vcpu_ioctl()
      KVM: Reduce stack usage in kvm_arch_vcpu_ioctl()
      KVM: Reduce stack usage in kvm_pv_mmu_op()

Eric Dumazet (6):
      appletalk: fix atalk_getname() leak
      can: Fix raw_getname() leak
      econet: Fix econet_getname() leak
      irda: Fix irda_getname() leak
      netrom: Fix nr_getname() leak
      rose: Fix rose_getname() leak

Glauber Costa (1):
      KVM: Don't destroy vcpu in case vcpu_setup fails

Gleb Natapov (1):
      KVM: MMU: do not free active mmu pages in free_mmu_pages()

Greg Kroah-Hartman (1):
      Linux 2.6.27.32

Hannes Hering (1):
      ehea: Fix napi list corruption on ifconfig down

Izik Eidus (1):
      KVM: Fix dirty bit tracking for slots with large pages

Jiri Slaby (1):
      NET: llc, zero sockaddr_llc struct

Joerg Roedel (1):
      KVM: add MC5_MISC msr read support

Linus Torvalds (1):
      do_sigaltstack: avoid copying 'stack_t' as a structure to user space

Marcelo Tosatti (4):
      KVM: set debug registers after "schedulable" section
      KVM: MMU: increase per-vcpu rmap cache alloc size
      KVM: x86: check for cr3 validity in mmu_alloc_roots
      KVM: MMU: protect kvm_mmu_change_mmu_pages with mmu_lock

Oleg Nesterov (2):
      clone(): fix race between copy_process() and de_thread()
      kthreads: fix kthread_create() vs kthread_stop() race

Oliver Neukum (1):
      USB: removal of tty->low_latency hack dating back to the old serial code

Peter Jones (1):
      SCSI: sr: report more accurate drive status after closing the tray.

Sheng Yang (1):
      KVM: VMX: Set IGMT bit in EPT entry

Sunil Mushran (2):
      ocfs2: Initialize the cluster we're writing to in a non-sparse extend
      ocfs2: ocfs2_write_begin_nolock() should handle len=0

Takashi Iwai (2):
      ALSA: hda - Fix MacBookPro 3,1/4,1 quirk with ALC889A
      ALSA: hda - Add missing vmaster initialization for ALC269

Trond Myklebust (2):
      SUNRPC: Fix rpc_task_force_reencode
      SUNRPC: Fix tcp reconnection


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2009-09-09 15:19 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-09-09 14:40 Linux 2.6.27.32 Jayson King
  -- strict thread matches above, loose matches on Subject: below --
2009-09-09  4:08 Greg KH
2009-09-09  4:08 ` Greg KH
2009-09-09  7:10 ` Arkadiusz Miskiewicz
2009-09-09 13:28   ` Greg KH

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox