]> git.pld-linux.org Git - packages/kernel.git/commitdiff
- use official stable@ patches for xfs + one symlink mem corruption fix
authorArkadiusz Miśkiewicz <arekm@maven.pl>
Tue, 18 Oct 2011 10:03:21 +0000 (10:03 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
Changed files:
    kernel-small_fixes.patch -> 1.42

kernel-small_fixes.patch

index f5100293fce80bcf5d9c7ab9f072e164282916a7..d4125a27afce4859b18987c9086cbe7e75819a60 100644 (file)
@@ -59,104 +59,6 @@ index 2494842..edf37aa 100644
        /* block receiver */
        sky2_write8(hw, SK_REG(port, RX_GMF_CTRL_T), GMF_RST_SET);
  }
-Date: Mon, 11 Jul 2011 09:59:57 -0400
-From: Christoph Hellwig <hch@infradead.org>
-To: xfs@oss.sgi.com
-Cc: arekm@maven.pl
-Subject: [PATCH] xfs: start periodic workers later
-Message-ID: <20110711135957.GA23737@infradead.org>
-MIME-Version: 1.0
-Content-Type: text/plain;
-  charset=us-ascii
-Content-Disposition: inline
-User-Agent: Mutt/1.5.21 (2010-09-15)
-
-Start the periodic sync workers only after we have finished xfs_mountfs
-and thus fully set up the filesystem structures.  Without this we can
-call into xfs_qm_sync before the quotainfo strucute is set up if the
-mount takes unusually long, and probably hit other incomplete states
-as well.
-
-Also clean up the xfs_fs_fill_super error path by using consistent
-label names, and removing an impossible to reach case.
-
-Reported-by: Arkadiusz Miskiewicz <arekm@maven.pl>
-Signed-off-by: Christoph Hellwig <hch@lst.de>
-
-Index: xfs/fs/xfs/linux-2.6/xfs_super.c
-===================================================================
---- xfs.orig/fs/xfs/linux-2.6/xfs_super.c      2011-07-11 12:02:56.762758869 +0200
-+++ xfs/fs/xfs/linux-2.6/xfs_super.c   2011-07-11 12:09:20.817344934 +0200
-@@ -1411,37 +1411,35 @@ xfs_fs_fill_super(
-       sb->s_time_gran = 1;
-       set_posix_acl_flag(sb);
--      error = xfs_syncd_init(mp);
--      if (error)
--              goto out_filestream_unmount;
--
-       xfs_inode_shrinker_register(mp);
-       error = xfs_mountfs(mp);
-       if (error)
--              goto out_syncd_stop;
-+              goto out_filestream_unmount;
-+
-+      error = xfs_syncd_init(mp);
-+      if (error)
-+              goto out_unmount;
-       root = igrab(VFS_I(mp->m_rootip));
-       if (!root) {
-               error = ENOENT;
--              goto fail_unmount;
-+              goto out_syncd_stop;
-       }
-       if (is_bad_inode(root)) {
-               error = EINVAL;
--              goto fail_vnrele;
-+              goto out_syncd_stop;
-       }
-       sb->s_root = d_alloc_root(root);
-       if (!sb->s_root) {
-               error = ENOMEM;
--              goto fail_vnrele;
-+              goto out_iput;
-       }
-       return 0;
-- out_syncd_stop:
--      xfs_inode_shrinker_unregister(mp);
--      xfs_syncd_stop(mp);
-  out_filestream_unmount:
-+      xfs_inode_shrinker_unregister(mp);
-       xfs_filestream_unmount(mp);
-  out_free_sb:
-       xfs_freesb(mp);
-@@ -1455,17 +1453,12 @@ xfs_fs_fill_super(
-  out:
-       return -error;
-- fail_vnrele:
--      if (sb->s_root) {
--              dput(sb->s_root);
--              sb->s_root = NULL;
--      } else {
--              iput(root);
--      }
--
-- fail_unmount:
--      xfs_inode_shrinker_unregister(mp);
-+ out_iput:
-+      iput(root);
-+ out_syncd_stop:
-       xfs_syncd_stop(mp);
-+ out_unmount:
-+      xfs_inode_shrinker_unregister(mp);
-       /*
-        * Blow away any referenced inode in the filestreams cache.
 On Sat, 2 Jul 2011, Andi Kleen wrote:
 
 > > The problem is that blk_peek_request() calls scsi_prep_fn(), which 
@@ -446,35 +348,191 @@ index e64cd9c..e55df30 100644
                                exit
                        fi
                done
-commit 1d8c95a363bf8cd4d4182dd19c01693b635311c2
+commit 37b652ec6445be99d0193047d1eda129a1a315d3
 Author: Dave Chinner <dchinner@redhat.com>
-Date:   Mon Jul 18 03:40:16 2011 +0000
+Date:   Thu Aug 25 07:17:01 2011 +0000
 
-    xfs: use a cursor for bulk AIL insertion
-    
-    Delayed logging can insert tens of thousands of log items into the
-    AIL at the same LSN. When the committing of log commit records
-    occur, we can get insertions occurring at an LSN that is not at the
-    end of the AIL. If there are thousands of items in the AIL on the
-    tail LSN, each insertion has to walk the AIL to find the correct
-    place to insert the new item into the AIL. This can consume large
-    amounts of CPU time and block other operations from occurring while
-    the traversals are in progress.
+    xfs: don't serialise direct IO reads on page cache checks
     
-    To avoid this repeated walk, use a AIL cursor to record
-    where we should be inserting the new items into the AIL without
-    having to repeat the walk. The cursor infrastructure already
-    provides this functionality for push walks, so is a simple extension
-    of existing code. While this will not avoid the initial walk, it
-    will avoid repeating it tens of thousands of times during a single
-    checkpoint commit.
+    There is no need to grab the i_mutex of the IO lock in exclusive
+    mode if we don't need to invalidate the page cache. Taking these
+    locks on every direct IO effective serialises them as taking the IO
+    lock in exclusive mode has to wait for all shared holders to drop
+    the lock. That only happens when IO is complete, so effective it
+    prevents dispatch of concurrent direct IO reads to the same inode.
     
-    This version includes logic improvements from Christoph Hellwig.
+    Fix this by taking the IO lock shared to check the page cache state,
+    and only then drop it and take the IO lock exclusively if there is
+    work to be done. Hence for the normal direct IO case, no exclusive
+    locking will occur.
     
     Signed-off-by: Dave Chinner <dchinner@redhat.com>
+    Tested-by: Joern Engel <joern@logfs.org>
     Reviewed-by: Christoph Hellwig <hch@lst.de>
     Signed-off-by: Alex Elder <aelder@sgi.com>
 
+diff --git a/fs/xfs/linux-2.6/xfs_file.c b/fs/xfs/linux-2.6/xfs_file.c
+index 7f7b424..8fd4a07 100644
+--- a/fs/xfs/linux-2.6/xfs_file.c
++++ b/fs/xfs/linux-2.6/xfs_file.c
+@@ -317,7 +317,19 @@ xfs_file_aio_read(
+       if (XFS_FORCED_SHUTDOWN(mp))
+               return -EIO;
+-      if (unlikely(ioflags & IO_ISDIRECT)) {
++      /*
++       * Locking is a bit tricky here. If we take an exclusive lock
++       * for direct IO, we effectively serialise all new concurrent
++       * read IO to this file and block it behind IO that is currently in
++       * progress because IO in progress holds the IO lock shared. We only
++       * need to hold the lock exclusive to blow away the page cache, so
++       * only take lock exclusively if the page cache needs invalidation.
++       * This allows the normal direct IO case of no page cache pages to
++       * proceeed concurrently without serialisation.
++       */
++      xfs_rw_ilock(ip, XFS_IOLOCK_SHARED);
++      if ((ioflags & IO_ISDIRECT) && inode->i_mapping->nrpages) {
++              xfs_rw_iunlock(ip, XFS_IOLOCK_SHARED);
+               xfs_rw_ilock(ip, XFS_IOLOCK_EXCL);
+               if (inode->i_mapping->nrpages) {
+@@ -330,8 +342,7 @@ xfs_file_aio_read(
+                       }
+               }
+               xfs_rw_ilock_demote(ip, XFS_IOLOCK_EXCL);
+-      } else
+-              xfs_rw_ilock(ip, XFS_IOLOCK_SHARED);
++      }
+       trace_xfs_file_read(ip, size, iocb->ki_pos, ioflags);
+
+
+
+Start the periodic sync workers only after we have finished xfs_mountfs
+and thus fully set up the filesystem structures.  Without this we can
+call into xfs_qm_sync before the quotainfo strucute is set up if the
+mount takes unusually long, and probably hit other incomplete states
+as well.
+    
+Also clean up the xfs_fs_fill_super error path by using consistent
+label names, and removing an impossible to reach case.
+
+Signed-off-by: Christoph Hellwig <hch@lst.de>
+Reported-by: Arkadiusz Miskiewicz <arekm@maven.pl>
+Reviewed-by: Alex Elder <aelder@sgi.com>
+
+diff --git a/fs/xfs/linux-2.6/xfs_super.c b/fs/xfs/linux-2.6/xfs_super.c
+index a1a881e..3ebb458 100644
+--- a/fs/xfs/linux-2.6/xfs_super.c
++++ b/fs/xfs/linux-2.6/xfs_super.c
+@@ -1412,37 +1412,35 @@ xfs_fs_fill_super(
+       sb->s_time_gran = 1;
+       set_posix_acl_flag(sb);
+-      error = xfs_syncd_init(mp);
+-      if (error)
+-              goto out_filestream_unmount;
+-
+       xfs_inode_shrinker_register(mp);
+       error = xfs_mountfs(mp);
+       if (error)
+-              goto out_syncd_stop;
++              goto out_filestream_unmount;
++
++      error = xfs_syncd_init(mp);
++      if (error)
++              goto out_unmount;
+       root = igrab(VFS_I(mp->m_rootip));
+       if (!root) {
+               error = ENOENT;
+-              goto fail_unmount;
++              goto out_syncd_stop;
+       }
+       if (is_bad_inode(root)) {
+               error = EINVAL;
+-              goto fail_vnrele;
++              goto out_syncd_stop;
+       }
+       sb->s_root = d_alloc_root(root);
+       if (!sb->s_root) {
+               error = ENOMEM;
+-              goto fail_vnrele;
++              goto out_iput;
+       }
+       return 0;
+- out_syncd_stop:
+-      xfs_inode_shrinker_unregister(mp);
+-      xfs_syncd_stop(mp);
+  out_filestream_unmount:
++      xfs_inode_shrinker_unregister(mp);
+       xfs_filestream_unmount(mp);
+  out_free_sb:
+       xfs_freesb(mp);
+@@ -1456,17 +1454,12 @@ xfs_fs_fill_super(
+  out:
+       return -error;
+- fail_vnrele:
+-      if (sb->s_root) {
+-              dput(sb->s_root);
+-              sb->s_root = NULL;
+-      } else {
+-              iput(root);
+-      }
+-
+- fail_unmount:
+-      xfs_inode_shrinker_unregister(mp);
++ out_iput:
++      iput(root);
++ out_syncd_stop:
+       xfs_syncd_stop(mp);
++ out_unmount:
++      xfs_inode_shrinker_unregister(mp);
+       /*
+        * Blow away any referenced inode in the filestreams cache.
+
+_______________________________________________
+xfs mailing list
+xfs@oss.sgi.com
+http://oss.sgi.com/mailman/listinfo/xfs
+
+
+From: Dave Chinner <dchinner@redhat.com>
+
+commit 1d8c95a363bf8cd4d4182dd19c01693b635311c2 upstream
+
+
+xfs: use a cursor for bulk AIL insertion
+
+Delayed logging can insert tens of thousands of log items into the
+AIL at the same LSN. When the committing of log commit records
+occur, we can get insertions occurring at an LSN that is not at the
+end of the AIL. If there are thousands of items in the AIL on the
+tail LSN, each insertion has to walk the AIL to find the correct
+place to insert the new item into the AIL. This can consume large
+amounts of CPU time and block other operations from occurring while
+the traversals are in progress.
+
+To avoid this repeated walk, use a AIL cursor to record
+where we should be inserting the new items into the AIL without
+having to repeat the walk. The cursor infrastructure already
+provides this functionality for push walks, so is a simple extension
+of existing code. While this will not avoid the initial walk, it
+will avoid repeating it tens of thousands of times during a single
+checkpoint commit.
+
+This version includes logic improvements from Christoph Hellwig.
+
+Signed-off-by: Dave Chinner <dchinner@redhat.com>
+Reviewed-by: Christoph Hellwig <hch@lst.de>
+Signed-off-by: Alex Elder <aelder@sgi.com>
+
 diff --git a/fs/xfs/xfs_trans.c b/fs/xfs/xfs_trans.c
 index c83f63b..efc147f 100644
 --- a/fs/xfs/xfs_trans.c
@@ -743,67 +801,14 @@ index 6b164e9..c0cb408 100644
                                        struct xfs_ail_cursor *cur);
  void                  xfs_trans_ail_cursor_done(struct xfs_ail *ailp,
                                        struct xfs_ail_cursor *cur);
-commit 37b652ec6445be99d0193047d1eda129a1a315d3
-Author: Dave Chinner <dchinner@redhat.com>
-Date:   Thu Aug 25 07:17:01 2011 +0000
 
-    xfs: don't serialise direct IO reads on page cache checks
-    
-    There is no need to grab the i_mutex of the IO lock in exclusive
-    mode if we don't need to invalidate the page cache. Taking these
-    locks on every direct IO effective serialises them as taking the IO
-    lock in exclusive mode has to wait for all shared holders to drop
-    the lock. That only happens when IO is complete, so effective it
-    prevents dispatch of concurrent direct IO reads to the same inode.
-    
-    Fix this by taking the IO lock shared to check the page cache state,
-    and only then drop it and take the IO lock exclusively if there is
-    work to be done. Hence for the normal direct IO case, no exclusive
-    locking will occur.
-    
-    Signed-off-by: Dave Chinner <dchinner@redhat.com>
-    Tested-by: Joern Engel <joern@logfs.org>
-    Reviewed-by: Christoph Hellwig <hch@lst.de>
-    Signed-off-by: Alex Elder <aelder@sgi.com>
+_______________________________________________
+xfs mailing list
+xfs@oss.sgi.com
+http://oss.sgi.com/mailman/listinfo/xfs
 
-diff --git a/fs/xfs/linux-2.6/xfs_file.c b/fs/xfs/linux-2.6/xfs_file.c
-index 7f7b424..8fd4a07 100644
---- a/fs/xfs/linux-2.6/xfs_file.c
-+++ b/fs/xfs/linux-2.6/xfs_file.c
-@@ -317,7 +317,19 @@ xfs_file_aio_read(
-       if (XFS_FORCED_SHUTDOWN(mp))
-               return -EIO;
--      if (unlikely(ioflags & IO_ISDIRECT)) {
-+      /*
-+       * Locking is a bit tricky here. If we take an exclusive lock
-+       * for direct IO, we effectively serialise all new concurrent
-+       * read IO to this file and block it behind IO that is currently in
-+       * progress because IO in progress holds the IO lock shared. We only
-+       * need to hold the lock exclusive to blow away the page cache, so
-+       * only take lock exclusively if the page cache needs invalidation.
-+       * This allows the normal direct IO case of no page cache pages to
-+       * proceeed concurrently without serialisation.
-+       */
-+      xfs_rw_ilock(ip, XFS_IOLOCK_SHARED);
-+      if ((ioflags & IO_ISDIRECT) && inode->i_mapping->nrpages) {
-+              xfs_rw_iunlock(ip, XFS_IOLOCK_SHARED);
-               xfs_rw_ilock(ip, XFS_IOLOCK_EXCL);
-               if (inode->i_mapping->nrpages) {
-@@ -330,8 +342,7 @@ xfs_file_aio_read(
-                       }
-               }
-               xfs_rw_ilock_demote(ip, XFS_IOLOCK_EXCL);
--      } else
--              xfs_rw_ilock(ip, XFS_IOLOCK_SHARED);
-+      }
-       trace_xfs_file_read(ip, size, iocb->ki_pos, ioflags);
 
-From: Christoph Hellwig <hch@infradead.org>
-Subject: [PATCH 1/4] xfs: do not update xa_last_pushed_lsn for locked items
+commit bc6e588a8971aa74c02e42db4d6e0248679f3738 upstream
 
 If an item was locked we should not update xa_last_pushed_lsn and thus skip
 it when restarting the AIL scan as we need to be able to lock and write it
@@ -817,9 +822,9 @@ Tested-by: Stefan Priebe <s.priebe@profihost.ag>
 
 Index: xfs/fs/xfs/xfs_trans_ail.c
 ===================================================================
---- xfs.orig/fs/xfs/xfs_trans_ail.c    2011-10-11 15:48:49.302003241 +0200
-+++ xfs/fs/xfs/xfs_trans_ail.c 2011-10-11 15:49:10.307505812 +0200
-@@ -440,7 +440,6 @@ xfs_ail_worker(
+--- xfs.orig/fs/xfs/xfs_trans_ail.c    2011-10-14 14:42:03.004395373 +0200
++++ xfs/fs/xfs/xfs_trans_ail.c 2011-10-14 14:42:22.687898198 +0200
+@@ -491,7 +491,6 @@ xfs_ail_worker(
  
                case XFS_ITEM_LOCKED:
                        XFS_STATS_INC(xs_push_ail_locked);
@@ -833,9 +838,8 @@ xfs mailing list
 xfs@oss.sgi.com
 http://oss.sgi.com/mailman/listinfo/xfs
 
-From: Christoph Hellwig <hch@infradead.org>
-Subject: [PATCH 2/4] xfs: force the log if we encounter pinned buffers in
-       .iop_pushbuf
+
+commit 17b38471c3c07a49f0bbc2ecc2e92050c164e226 upstream
 
 We need to check for pinned buffers even in .iop_pushbuf given that inode
 items flush into the same buffers that may be pinned directly due operations
@@ -849,8 +853,8 @@ Tested-by: Stefan Priebe <s.priebe@profihost.ag>
 
 Index: xfs/fs/xfs/quota/xfs_dquot_item.c
 ===================================================================
---- xfs.orig/fs/xfs/quota/xfs_dquot_item.c     2011-10-11 15:48:49.290003546 +0200
-+++ xfs/fs/xfs/quota/xfs_dquot_item.c  2011-10-11 15:49:17.727006849 +0200
+--- xfs.orig/fs/xfs/quota/xfs_dquot_item.c     2011-10-14 14:41:41.036231498 +0200
++++ xfs/fs/xfs/quota/xfs_dquot_item.c  2011-10-14 14:44:09.276394842 +0200
 @@ -183,13 +183,14 @@ xfs_qm_dqunpin_wait(
   * search the buffer cache can be a time consuming thing, and AIL lock is a
   * spinlock.
@@ -892,9 +896,9 @@ Index: xfs/fs/xfs/quota/xfs_dquot_item.c
  /*
 Index: xfs/fs/xfs/xfs_buf_item.c
 ===================================================================
---- xfs.orig/fs/xfs/xfs_buf_item.c     2011-10-11 15:48:49.286004461 +0200
-+++ xfs/fs/xfs/xfs_buf_item.c  2011-10-11 15:49:17.727006849 +0200
-@@ -629,7 +629,7 @@ xfs_buf_item_push(
+--- xfs.orig/fs/xfs/xfs_buf_item.c     2011-10-14 14:41:41.000000000 +0200
++++ xfs/fs/xfs/xfs_buf_item.c  2011-10-14 14:44:24.367895813 +0200
+@@ -632,7 +632,7 @@ xfs_buf_item_push(
   * the xfsbufd to get this buffer written. We have to unlock the buffer
   * to allow the xfsbufd to write it, too.
   */
@@ -903,7 +907,7 @@ Index: xfs/fs/xfs/xfs_buf_item.c
  xfs_buf_item_pushbuf(
        struct xfs_log_item     *lip)
  {
-@@ -643,6 +643,7 @@ xfs_buf_item_pushbuf(
+@@ -646,6 +646,7 @@ xfs_buf_item_pushbuf(
  
        xfs_buf_delwri_promote(bp);
        xfs_buf_relse(bp);
@@ -913,9 +917,9 @@ Index: xfs/fs/xfs/xfs_buf_item.c
  STATIC void
 Index: xfs/fs/xfs/xfs_inode_item.c
 ===================================================================
---- xfs.orig/fs/xfs/xfs_inode_item.c   2011-10-11 15:48:40.750005198 +0200
-+++ xfs/fs/xfs/xfs_inode_item.c        2011-10-11 15:49:17.735004729 +0200
-@@ -708,13 +708,14 @@ xfs_inode_item_committed(
+--- xfs.orig/fs/xfs/xfs_inode_item.c   2011-10-14 14:41:41.000000000 +0200
++++ xfs/fs/xfs/xfs_inode_item.c        2011-10-14 14:44:19.323950541 +0200
+@@ -713,13 +713,14 @@ xfs_inode_item_committed(
   * marked delayed write. If that's the case, we'll promote it and that will
   * allow the caller to write the buffer by triggering the xfsbufd to run.
   */
@@ -931,7 +935,7 @@ Index: xfs/fs/xfs/xfs_inode_item.c
  
        ASSERT(xfs_isilocked(ip, XFS_ILOCK_SHARED));
  
-@@ -725,7 +726,7 @@ xfs_inode_item_pushbuf(
+@@ -730,7 +731,7 @@ xfs_inode_item_pushbuf(
        if (completion_done(&ip->i_flush) ||
            !(lip->li_flags & XFS_LI_IN_AIL)) {
                xfs_iunlock(ip, XFS_ILOCK_SHARED);
@@ -940,7 +944,7 @@ Index: xfs/fs/xfs/xfs_inode_item.c
        }
  
        bp = xfs_incore(ip->i_mount->m_ddev_targp, iip->ili_format.ilf_blkno,
-@@ -733,10 +734,13 @@ xfs_inode_item_pushbuf(
+@@ -738,10 +739,13 @@ xfs_inode_item_pushbuf(
  
        xfs_iunlock(ip, XFS_ILOCK_SHARED);
        if (!bp)
@@ -957,8 +961,8 @@ Index: xfs/fs/xfs/xfs_inode_item.c
  /*
 Index: xfs/fs/xfs/xfs_trans.h
 ===================================================================
---- xfs.orig/fs/xfs/xfs_trans.h        2011-10-11 15:48:40.758004637 +0200
-+++ xfs/fs/xfs/xfs_trans.h     2011-10-11 15:49:17.743032550 +0200
+--- xfs.orig/fs/xfs/xfs_trans.h        2011-10-14 14:41:41.000000000 +0200
++++ xfs/fs/xfs/xfs_trans.h     2011-10-14 14:43:45.308394072 +0200
 @@ -350,7 +350,7 @@ typedef struct xfs_item_ops {
        void (*iop_unlock)(xfs_log_item_t *);
        xfs_lsn_t (*iop_committed)(xfs_log_item_t *, xfs_lsn_t);
@@ -970,9 +974,9 @@ Index: xfs/fs/xfs/xfs_trans.h
  
 Index: xfs/fs/xfs/xfs_trans_ail.c
 ===================================================================
---- xfs.orig/fs/xfs/xfs_trans_ail.c    2011-10-11 15:49:10.307505812 +0200
-+++ xfs/fs/xfs/xfs_trans_ail.c 2011-10-11 17:07:49.826504898 +0200
-@@ -427,8 +427,13 @@ xfs_ail_worker(
+--- xfs.orig/fs/xfs/xfs_trans_ail.c    2011-10-14 14:42:22.000000000 +0200
++++ xfs/fs/xfs/xfs_trans_ail.c 2011-10-14 14:43:45.316393949 +0200
+@@ -478,8 +478,13 @@ xfs_ail_worker(
  
                case XFS_ITEM_PUSHBUF:
                        XFS_STATS_INC(xs_push_ail_pushbuf);
@@ -994,8 +998,8 @@ xfs mailing list
 xfs@oss.sgi.com
 http://oss.sgi.com/mailman/listinfo/xfs
 
-From: Christoph Hellwig <hch@infradead.org>
-Subject: [PATCH 3/4] xfs: revert to using a kthread for AIL pushing
+
+commit 0030807c66f058230bcb20d2573bcaf28852e804 upstream
 
 Currently we have a few issues with the way the workqueue code is used to
 implement AIL pushing:
@@ -1020,40 +1024,10 @@ Signed-off-by: Christoph Hellwig <hch@lst.de>
 Reported-by: Stefan Priebe <s.priebe@profihost.ag>
 Tested-by: Stefan Priebe <s.priebe@profihost.ag>
 
-Index: xfs/fs/xfs/linux-2.6/xfs_super.c
-===================================================================
---- xfs.orig/fs/xfs/linux-2.6/xfs_super.c      2011-10-11 15:48:49.000000000 +0200
-+++ xfs/fs/xfs/linux-2.6/xfs_super.c   2011-10-11 15:52:13.383505329 +0200
-@@ -1652,24 +1652,13 @@ xfs_init_workqueues(void)
-        */
-       xfs_syncd_wq = alloc_workqueue("xfssyncd", WQ_CPU_INTENSIVE, 8);
-       if (!xfs_syncd_wq)
--              goto out;
--
--      xfs_ail_wq = alloc_workqueue("xfsail", WQ_CPU_INTENSIVE, 8);
--      if (!xfs_ail_wq)
--              goto out_destroy_syncd;
--
-+              return -ENOMEM;
-       return 0;
--
--out_destroy_syncd:
--      destroy_workqueue(xfs_syncd_wq);
--out:
--      return -ENOMEM;
- }
- STATIC void
- xfs_destroy_workqueues(void)
- {
--      destroy_workqueue(xfs_ail_wq);
-       destroy_workqueue(xfs_syncd_wq);
- }
 Index: xfs/fs/xfs/xfs_trans_ail.c
 ===================================================================
---- xfs.orig/fs/xfs/xfs_trans_ail.c    2011-10-11 15:51:58.546005158 +0200
-+++ xfs/fs/xfs/xfs_trans_ail.c 2011-10-11 15:52:13.383505329 +0200
+--- xfs.orig/fs/xfs/xfs_trans_ail.c    2011-10-14 14:43:45.316393949 +0200
++++ xfs/fs/xfs/xfs_trans_ail.c 2011-10-14 14:45:11.937395278 +0200
 @@ -28,8 +28,6 @@
  #include "xfs_trans_priv.h"
  #include "xfs_error.h"
@@ -1063,7 +1037,7 @@ Index: xfs/fs/xfs/xfs_trans_ail.c
  #ifdef DEBUG
  /*
   * Check that the list is sorted as it should be.
-@@ -356,16 +354,10 @@ xfs_ail_delete(
+@@ -406,16 +404,10 @@ xfs_ail_delete(
        xfs_trans_ail_cursor_clear(ailp, lip);
  }
  
@@ -1081,9 +1055,9 @@ Index: xfs/fs/xfs/xfs_trans_ail.c
 -      struct xfs_ail          *ailp = container_of(to_delayed_work(work),
 -                                      struct xfs_ail, xa_work);
        xfs_mount_t             *mp = ailp->xa_mount;
-       struct xfs_ail_cursor   cur;
+       struct xfs_ail_cursor   *cur = &ailp->xa_cursors;
        xfs_log_item_t          *lip;
-@@ -505,20 +497,6 @@ out_done:
+@@ -556,20 +548,6 @@ out_done:
                /* We're past our target or empty, so idle */
                ailp->xa_last_pushed_lsn = 0;
  
@@ -1104,7 +1078,7 @@ Index: xfs/fs/xfs/xfs_trans_ail.c
                tout = 50;
        } else if (XFS_LSN_CMP(lsn, target) >= 0) {
                /*
-@@ -541,9 +519,30 @@ out_done:
+@@ -592,9 +570,30 @@ out_done:
                tout = 20;
        }
  
@@ -1138,7 +1112,7 @@ Index: xfs/fs/xfs/xfs_trans_ail.c
  }
  
  /*
-@@ -578,8 +577,9 @@ xfs_ail_push(
+@@ -629,8 +628,9 @@ xfs_ail_push(
         */
        smp_wmb();
        xfs_trans_ail_copy_lsn(ailp, &ailp->xa_target, &threshold_lsn);
@@ -1150,9 +1124,9 @@ Index: xfs/fs/xfs/xfs_trans_ail.c
  }
  
  /*
-@@ -817,9 +817,18 @@ xfs_trans_ail_init(
+@@ -865,9 +865,18 @@ xfs_trans_ail_init(
+       ailp->xa_mount = mp;
        INIT_LIST_HEAD(&ailp->xa_ail);
-       INIT_LIST_HEAD(&ailp->xa_cursors);
        spin_lock_init(&ailp->xa_lock);
 -      INIT_DELAYED_WORK(&ailp->xa_work, xfs_ail_worker);
 +
@@ -1170,7 +1144,7 @@ Index: xfs/fs/xfs/xfs_trans_ail.c
  }
  
  void
-@@ -828,6 +837,6 @@ xfs_trans_ail_destroy(
+@@ -876,6 +885,6 @@ xfs_trans_ail_destroy(
  {
        struct xfs_ail  *ailp = mp->m_ail;
  
@@ -1180,8 +1154,8 @@ Index: xfs/fs/xfs/xfs_trans_ail.c
  }
 Index: xfs/fs/xfs/xfs_trans_priv.h
 ===================================================================
---- xfs.orig/fs/xfs/xfs_trans_priv.h   2011-10-11 15:48:40.000000000 +0200
-+++ xfs/fs/xfs/xfs_trans_priv.h        2011-10-11 15:53:35.382504829 +0200
+--- xfs.orig/fs/xfs/xfs_trans_priv.h   2011-10-14 14:42:03.000000000 +0200
++++ xfs/fs/xfs/xfs_trans_priv.h        2011-10-14 14:45:38.191895324 +0200
 @@ -64,23 +64,17 @@ struct xfs_ail_cursor {
   */
  struct xfs_ail {
@@ -1209,9 +1183,9 @@ Index: xfs/fs/xfs/xfs_trans_priv.h
                                struct xfs_log_item **log_items, int nr_items,
 Index: xfs/fs/xfs/linux-2.6/xfs_linux.h
 ===================================================================
---- xfs.orig/fs/xfs/linux-2.6/xfs_linux.h      2011-10-11 15:48:49.000000000 +0200
-+++ xfs/fs/xfs/linux-2.6/xfs_linux.h   2011-10-11 15:52:13.383505329 +0200
-@@ -68,6 +68,8 @@
+--- xfs.orig/fs/xfs/linux-2.6/xfs_linux.h      2011-10-14 14:41:41.000000000 +0200
++++ xfs/fs/xfs/linux-2.6/xfs_linux.h   2011-10-14 14:45:11.941411722 +0200
+@@ -70,6 +70,8 @@
  #include <linux/ctype.h>
  #include <linux/writeback.h>
  #include <linux/capability.h>
@@ -1220,6 +1194,36 @@ Index: xfs/fs/xfs/linux-2.6/xfs_linux.h
  #include <linux/list_sort.h>
  
  #include <asm/page.h>
+Index: xfs/fs/xfs/linux-2.6/xfs_super.c
+===================================================================
+--- xfs.orig/fs/xfs/linux-2.6/xfs_super.c      2011-10-14 14:46:38.497394866 +0200
++++ xfs/fs/xfs/linux-2.6/xfs_super.c   2011-10-14 14:46:49.047894210 +0200
+@@ -1660,24 +1660,13 @@ xfs_init_workqueues(void)
+        */
+       xfs_syncd_wq = alloc_workqueue("xfssyncd", WQ_CPU_INTENSIVE, 8);
+       if (!xfs_syncd_wq)
+-              goto out;
+-
+-      xfs_ail_wq = alloc_workqueue("xfsail", WQ_CPU_INTENSIVE, 8);
+-      if (!xfs_ail_wq)
+-              goto out_destroy_syncd;
+-
++              return -ENOMEM;
+       return 0;
+-
+-out_destroy_syncd:
+-      destroy_workqueue(xfs_syncd_wq);
+-out:
+-      return -ENOMEM;
+ }
+ STATIC void
+ xfs_destroy_workqueues(void)
+ {
+-      destroy_workqueue(xfs_ail_wq);
+       destroy_workqueue(xfs_syncd_wq);
+ }
 
 _______________________________________________
 xfs mailing list
@@ -1227,3 +1231,47 @@ xfs@oss.sgi.com
 http://oss.sgi.com/mailman/listinfo/xfs
 
 
+Fixes a possible memory corruption when the link is larger than
+MAXPATHLEN and XFS_DEBUG is not enabled. This also remove the
+S_ISLNK assert, since the inode mode is checked previously in
+xfs_readlink_by_handle() and via VFS.
+
+Signed-off-by: Carlos Maiolino <cmaiolino@redhat.com>
+---
+ fs/xfs/xfs_vnodeops.c |   11 ++++++++---
+ 1 files changed, 8 insertions(+), 3 deletions(-)
+
+diff --git a/fs/xfs/xfs_vnodeops.c b/fs/xfs/xfs_vnodeops.c
+index 51fc429..c3288be 100644
+--- a/fs/xfs/xfs_vnodeops.c
++++ b/fs/xfs/xfs_vnodeops.c
+@@ -123,13 +123,18 @@ xfs_readlink(
+       xfs_ilock(ip, XFS_ILOCK_SHARED);
+-      ASSERT((ip->i_d.di_mode & S_IFMT) == S_IFLNK);
+-      ASSERT(ip->i_d.di_size <= MAXPATHLEN);
+-
+       pathlen = ip->i_d.di_size;
+       if (!pathlen)
+               goto out;
++      if (pathlen > MAXPATHLEN) {
++              xfs_alert(mp, "%s: inode (%llu) symlink length (%d) too long",
++                       __func__, (unsigned long long)ip->i_ino, pathlen);
++              ASSERT(0);
++              return XFS_ERROR(EFSCORRUPTED);
++      }
++
++
+       if (ip->i_df.if_flags & XFS_IFINLINE) {
+               memcpy(link, ip->i_df.if_u1.if_data, pathlen);
+               link[pathlen] = '\0';
+-- 
+1.7.6.2
+
+_______________________________________________
+xfs mailing list
+xfs@oss.sgi.com
+http://oss.sgi.com/mailman/listinfo/xfs
+
This page took 0.090778 seconds and 4 git commands to generate.