xfs
[Top] [All Lists]

[PATCH 6/6] use KM_MAYFAIL in xfs_mountfs

To: xfs@xxxxxxxxxxx
Subject: [PATCH 6/6] use KM_MAYFAIL in xfs_mountfs
From: Christoph Hellwig <hch@xxxxxx>
Date: Sat, 26 Jul 2008 11:58:24 +0200
Sender: xfs-bounce@xxxxxxxxxxx
User-agent: Mutt/1.3.28i
Use KM_MAYFAIL for the m_perag allocation, we can deal with the error
easily and blocking forever during mount is not a good idea either.


Signed-off-by: Christoph Hellwig <hch@xxxxxx>

Index: linux-2.6-xfs/fs/xfs/xfs_mount.c
===================================================================
--- linux-2.6-xfs.orig/fs/xfs/xfs_mount.c       2008-07-24 23:02:26.000000000 
+0200
+++ linux-2.6-xfs/fs/xfs/xfs_mount.c    2008-07-24 23:04:15.000000000 +0200
@@ -1052,8 +1052,10 @@ xfs_mountfs(
         * Allocate and initialize the per-ag data.
         */
        init_rwsem(&mp->m_peraglock);
-       mp->m_perag =
-               kmem_zalloc(sbp->sb_agcount * sizeof(xfs_perag_t), KM_SLEEP);
+       mp->m_perag = kmem_zalloc(sbp->sb_agcount * sizeof(xfs_perag_t),
+                                 KM_MAYFAIL);
+       if (!mp->m_perag)
+               goto error1;
 
        mp->m_maxagi = xfs_initialize_perag(mp, sbp->sb_agcount);
 


<Prev in Thread] Current Thread [Next in Thread>
  • [PATCH 6/6] use KM_MAYFAIL in xfs_mountfs, Christoph Hellwig <=