1. 07 8月, 2020 1 次提交
  2. 03 7月, 2020 2 次提交
    • B
      gfs2: The freeze glock should never be frozen · c860f8ff
      Bob Peterson 提交于
      Before this patch, some gfs2 code locked the freeze glock with LM_FLAG_NOEXP
      (Do not freeze) flag, and some did not. We never want to freeze the freeze
      glock, so this patch makes it consistently use LM_FLAG_NOEXP always.
      Signed-off-by: NBob Peterson <rpeterso@redhat.com>
      c860f8ff
    • B
      gfs2: When freezing gfs2, use GL_EXACT and not GL_NOCACHE · 623ba664
      Bob Peterson 提交于
      Before this patch, the freeze code in gfs2 specified GL_NOCACHE in
      several places. That's wrong because we always want to know the state
      of whether the file system is frozen.
      
      There was also a problem with freeze/thaw transitioning the glock from
      frozen (EX) to thawed (SH) because gfs2 will normally grant glocks in EX
      to processes that request it in SH mode, unless GL_EXACT is specified.
      Therefore, the freeze/thaw code, which tried to reacquire the glock in
      SH mode would get the glock in EX mode, and miss the transition from EX
      to SH. That made it think the thaw had completed normally, but since the
      glock was still cached in EX, other nodes could not freeze again.
      
      This patch removes the GL_NOCACHE flag to allow the freeze glock to be
      cached. It also adds the GL_EXACT flag so the glock is fully transitioned
      from EX to SH, thereby allowing future freeze operations.
      Signed-off-by: NBob Peterson <rpeterso@redhat.com>
      623ba664
  3. 06 6月, 2020 5 次提交
    • A
      gfs2: Smarter iopen glock waiting · 9e8990de
      Andreas Gruenbacher 提交于
      When trying to upgrade the iopen glock from a shared to an exclusive lock in
      gfs2_evict_inode, abort the wait if there is contention on the corresponding
      inode glock: in that case, the inode must still be in active use on another
      node, and we're not guaranteed to get the iopen glock anytime soon.
      
      To make this work even better, when we notice contention on the iopen glock and
      we can't evict the corresponsing inode and release the iopen glock immediately,
      poke the inode glock.  The other node(s) trying to acquire the lock can then
      abort instead of timing out.
      
      Thanks to Heinz Mauelshagen for pointing out a locking bug in a previous
      version of this patch.
      Signed-off-by: NAndreas Gruenbacher <agruenba@redhat.com>
      9e8990de
    • A
      gfs2: Try harder to delete inodes locally · 9e73330f
      Andreas Gruenbacher 提交于
      When an inode's link count drops to zero and the inode is cached on
      other nodes, the current behavior of gfs2 is to immediately give up and
      to rely on the other node(s) to delete the inode if there is iopen glock
      contention.  This leads to resource group glock bouncing and the loss of
      caching.  With the previous patches in place, we can fix that by not
      giving up immediately.
      
      When the inode is still open on other nodes, those nodes won't be able
      to evict the inode and give up the iopen glock.  In that case, our lock
      conversion request will time out.  The unlink system call will block for
      the duration of the iopen lock conversion request.  We're also holding
      the inode glock in EX mode for an extended duration, so other nodes
      won't be able to make progress on the inode, either.
      
      This is worse than what we had before, but we can prevent other nodes
      from getting stuck by aborting our iopen locking request if there is
      contention on the inode glock.  This will the the subject of a future
      patch.
      Signed-off-by: NAndreas Gruenbacher <agruenba@redhat.com>
      9e73330f
    • A
      gfs2: Give up the iopen glock on contention · 8c7b9262
      Andreas Gruenbacher 提交于
      When there's contention on the iopen glock, it means that the link count
      of the corresponding inode has dropped to zero on a remote node which is
      now trying to delete the inode.  In that case, try to evict the inode so
      that the iopen glock will be released, which will allow the remote node
      to do its job.
      
      When the inode is still open locally, the inode's reference count won't
      drop to zero and so we'll keep holding the inode and its iopen glock.
      The remote node will time out its request to grab the iopen glock, and
      when the inode is finally closed locally, we'll try to delete it
      ourself.
      Signed-off-by: NAndreas Gruenbacher <agruenba@redhat.com>
      8c7b9262
    • A
      gfs2: Turn gl_delete into a delayed work · a0e3cc65
      Andreas Gruenbacher 提交于
      This requires flushing delayed work items in gfs2_make_fs_ro (which is called
      before unmounting a filesystem).
      
      When inodes are deleted and then recreated, pending gl_delete work items would
      have no effect because the inode generations will have changed, so we can
      cancel any pending gl_delete works before reusing iopen glocks.
      Signed-off-by: NAndreas Gruenbacher <agruenba@redhat.com>
      a0e3cc65
    • A
      gfs2: Keep track of deleted inode generations in LVBs · f286d627
      Andreas Gruenbacher 提交于
      When deleting an inode, keep track of the generation of the deleted inode in
      the inode glock Lock Value Block (LVB).  When trying to delete an inode
      remotely, check the last-known inode generation against the deleted inode
      generation to skip duplicate remote deletes.  This avoids taking the resource
      group glock in order to verify the block type.
      Signed-off-by: NAndreas Gruenbacher <agruenba@redhat.com>
      f286d627
  4. 09 5月, 2020 1 次提交
    • B
      gfs2: Fix problems regarding gfs2_qa_get and _put · 2297ab61
      Bob Peterson 提交于
      This patch fixes a couple of places in which gfs2_qa_get and gfs2_qa_put are
      not balanced: we now keep references around whenever a file is open for writing
      (see gfs2_open_common and gfs2_release), so we need to put all references we
      grab in function gfs2_create_inode.  This was broken in the successful case and
      on one error path.
      
      This also means that we don't have a reference to put in gfs2_evict_inode.
      
      In addition, gfs2_qa_put was called for the wrong inode in gfs2_link.
      Signed-off-by: NBob Peterson <rpeterso@redhat.com>
      Signed-off-by: NAndreas Gruenbacher <agruenba@redhat.com>
      2297ab61
  5. 28 3月, 2020 4 次提交
  6. 27 2月, 2020 1 次提交
    • B
      gfs2: Force withdraw to replay journals and wait for it to finish · 601ef0d5
      Bob Peterson 提交于
      When a node withdraws from a file system, it often leaves its journal
      in an incomplete state. This is especially true when the withdraw is
      caused by io errors writing to the journal. Before this patch, a
      withdraw would try to write a "shutdown" record to the journal, tell
      dlm it's done with the file system, and none of the other nodes
      know about the problem. Later, when the problem is fixed and the
      withdrawn node is rebooted, it would then discover that its own
      journal was incomplete, and replay it. However, replaying it at this
      point is almost guaranteed to introduce corruption because the other
      nodes are likely to have used affected resource groups that appeared
      in the journal since the time of the withdraw. Replaying the journal
      later will overwrite any changes made, and not through any fault of
      dlm, which was instructed during the withdraw to release those
      resources.
      
      This patch makes file system withdraws seen by the entire cluster.
      Withdrawing nodes dequeue their journal glock to allow recovery.
      
      The remaining nodes check all the journals to see if they are
      clean or in need of replay. They try to replay dirty journals, but
      only the journals of withdrawn nodes will be "not busy" and
      therefore available for replay.
      
      Until the journal replay is complete, no i/o related glocks may be
      given out, to ensure that the replay does not cause the
      aforementioned corruption: We cannot allow any journal replay to
      overwrite blocks associated with a glock once it is held.
      
      The "live" glock which is now used to signal when a withdraw
      occurs. When a withdraw occurs, the node signals its withdraw by
      dequeueing the "live" glock and trying to enqueue it in EX mode,
      thus forcing the other nodes to all see a demote request, by way
      of a "1CB" (one callback) try lock. The "live" glock is not
      granted in EX; the callback is only just used to indicate a
      withdraw has occurred.
      
      Note that all nodes in the cluster must wait for the recovering
      node to finish replaying the withdrawing node's journal before
      continuing. To this end, it checks that the journals are clean
      multiple times in a retry loop.
      
      Also note that the withdraw function may be called from a wide
      variety of situations, and therefore, we need to take extra
      precautions to make sure pointers are valid before using them in
      many circumstances.
      
      We also need to take care when glocks decide to withdraw, since
      the withdraw code now uses glocks.
      
      Also, before this patch, if a process encountered an error and
      decided to withdraw, if another process was already withdrawing,
      the second withdraw would be silently ignored, which set it free
      to unlock its glocks. That's correct behavior if the original
      withdrawer encounters further errors down the road. But if
      secondary waiters don't wait for the journal replay, unlocking
      glocks will allow other nodes to use them, despite the fact that
      the journal containing those blocks is being replayed. The
      replay needs to finish before our glocks are released to other
      nodes. IOW, secondary withdraws need to wait for the first
      withdraw to finish.
      
      For example, if an rgrp glock is unlocked by a process that didn't
      wait for the first withdraw, a journal replay could introduce file
      system corruption by replaying a rgrp block that has already been
      granted to a different cluster node.
      Signed-off-by: NBob Peterson <rpeterso@redhat.com>
      601ef0d5
  7. 16 11月, 2019 1 次提交
    • B
      gfs2: Abort gfs2_freeze if io error is seen · 52b1cdcb
      Bob Peterson 提交于
      Before this patch, an io error, such as -EIO writing to the journal
      would cause function gfs2_freeze to go into an infinite loop,
      continuously retrying the freeze operation. But nothing ever clears
      the -EIO except unmount after withdraw, which is impossible if the
      freeze operation never ends (fails). Instead you get:
      
      [ 6499.767994] gfs2: fsid=dm-32.0: error freezing FS: -5
      [ 6499.773058] gfs2: fsid=dm-32.0: retrying...
      [ 6500.791957] gfs2: fsid=dm-32.0: error freezing FS: -5
      [ 6500.797015] gfs2: fsid=dm-32.0: retrying...
      
      This patch adds a check for -EIO in gfs2_freeze, and if seen, it
      dequeues the freeze glock, aborts the loop and returns the error.
      Also, there's no need to pass the freeze holder to function
      gfs2_lock_fs_check_clean since it's only called in one place and
      it's a well-known superblock pointer, so this simplifies that.
      Signed-off-by: NBob Peterson <rpeterso@redhat.com>
      Signed-off-by: NAndreas Gruenbacher <agruenba@redhat.com>
      52b1cdcb
  8. 15 11月, 2019 2 次提交
  9. 19 9月, 2019 1 次提交
  10. 10 8月, 2019 1 次提交
  11. 28 6月, 2019 4 次提交
  12. 06 6月, 2019 1 次提交
  13. 05 6月, 2019 1 次提交
  14. 08 5月, 2019 4 次提交
    • A
      gfs2: read journal in large chunks · f4686c26
      Abhi Das 提交于
      Use bios to read in the journal into the address space of the journal inode
      (jd_inode), sequentially and in large chunks.  This is faster for locating the
      journal head that the previous binary search approach.  When performing
      recovery, we keep the journal in the address space until recovery is done,
      which further speeds up things.
      Signed-off-by: NAbhi Das <adas@redhat.com>
      Signed-off-by: NAndreas Gruenbacher <agruenba@redhat.com>
      f4686c26
    • A
      gfs2: fix race between gfs2_freeze_func and unmount · 8f918219
      Abhi Das 提交于
      As part of the freeze operation, gfs2_freeze_func() is left blocking
      on a request to hold the sd_freeze_gl in SH. This glock is held in EX
      by the gfs2_freeze() code.
      
      A subsequent call to gfs2_unfreeze() releases the EXclusively held
      sd_freeze_gl, which allows gfs2_freeze_func() to acquire it in SH and
      resume its operation.
      
      gfs2_unfreeze(), however, doesn't wait for gfs2_freeze_func() to complete.
      If a umount is issued right after unfreeze, it could result in an
      inconsistent filesystem because some journal data (statfs update) isn't
      written out.
      
      Refer to commit 24972557 for a more detailed explanation of how
      freeze/unfreeze work.
      
      This patch causes gfs2_unfreeze() to wait for gfs2_freeze_func() to
      complete before returning to the user.
      Signed-off-by: NAbhi Das <adas@redhat.com>
      Signed-off-by: NAndreas Gruenbacher <agruenba@redhat.com>
      8f918219
    • A
    • B
      gfs2: Replace gl_revokes with a GLF flag · 73118ca8
      Bob Peterson 提交于
      The gl_revokes value determines how many outstanding revokes a glock has
      on the superblock revokes list; this is used to avoid unnecessary log
      flushes.  However, gl_revokes is only ever tested for being zero, and it's
      only decremented in revoke_lo_after_commit, which removes all revokes
      from the list, so we know that the gl_revoke values of all the glocks on
      the list will reach zero.  Therefore, we can replace gl_revokes with a
      bit flag. This saves an atomic counter in struct gfs2_glock.
      Signed-off-by: NBob Peterson <rpeterso@redhat.com>
      Signed-off-by: NAndreas Gruenbacher <agruenba@redhat.com>
      73118ca8
  15. 02 5月, 2019 1 次提交
  16. 15 2月, 2019 1 次提交
  17. 12 12月, 2018 1 次提交
  18. 20 10月, 2018 1 次提交
  19. 09 10月, 2018 1 次提交
    • T
      GFS2: Flush the GFS2 delete workqueue before stopping the kernel threads · 1eb8d738
      Tim Smith 提交于
      Flushing the workqueue can cause operations to happen which might
      call gfs2_log_reserve(), or get stuck waiting for locks taken by such
      operations.  gfs2_log_reserve() can io_schedule(). If this happens, it
      will never wake because the only thing which can wake it is gfs2_logd()
      which was already stopped.
      
      This causes umount of a gfs2 filesystem to wedge permanently if, for
      example, the umount immediately follows a large delete operation.
      
      When this occured, the following stack trace was obtained from the
      umount command
      
      [<ffffffff81087968>] flush_workqueue+0x1c8/0x520
      [<ffffffffa0666e29>] gfs2_make_fs_ro+0x69/0x160 [gfs2]
      [<ffffffffa0667279>] gfs2_put_super+0xa9/0x1c0 [gfs2]
      [<ffffffff811b7edf>] generic_shutdown_super+0x6f/0x100
      [<ffffffff811b7ff7>] kill_block_super+0x27/0x70
      [<ffffffffa0656a71>] gfs2_kill_sb+0x71/0x80 [gfs2]
      [<ffffffff811b792b>] deactivate_locked_super+0x3b/0x70
      [<ffffffff811b79b9>] deactivate_super+0x59/0x60
      [<ffffffff811d2998>] cleanup_mnt+0x58/0x80
      [<ffffffff811d2a12>] __cleanup_mnt+0x12/0x20
      [<ffffffff8108c87d>] task_work_run+0x7d/0xa0
      [<ffffffff8106d7d9>] exit_to_usermode_loop+0x73/0x98
      [<ffffffff81003961>] syscall_return_slowpath+0x41/0x50
      [<ffffffff815a594c>] int_ret_from_sys_call+0x25/0x8f
      [<ffffffffffffffff>] 0xffffffffffffffff
      Signed-off-by: NTim Smith <tim.smith@citrix.com>
      Signed-off-by: NMark Syms <mark.syms@citrix.com>
      Signed-off-by: NBob Peterson <rpeterso@redhat.com>
      1eb8d738
  20. 05 7月, 2018 1 次提交
  21. 13 6月, 2018 1 次提交
    • K
      treewide: kmalloc() -> kmalloc_array() · 6da2ec56
      Kees Cook 提交于
      The kmalloc() function has a 2-factor argument form, kmalloc_array(). This
      patch replaces cases of:
      
              kmalloc(a * b, gfp)
      
      with:
              kmalloc_array(a * b, gfp)
      
      as well as handling cases of:
      
              kmalloc(a * b * c, gfp)
      
      with:
      
              kmalloc(array3_size(a, b, c), gfp)
      
      as it's slightly less ugly than:
      
              kmalloc_array(array_size(a, b), c, gfp)
      
      This does, however, attempt to ignore constant size factors like:
      
              kmalloc(4 * 1024, gfp)
      
      though any constants defined via macros get caught up in the conversion.
      
      Any factors with a sizeof() of "unsigned char", "char", and "u8" were
      dropped, since they're redundant.
      
      The tools/ directory was manually excluded, since it has its own
      implementation of kmalloc().
      
      The Coccinelle script used for this was:
      
      // Fix redundant parens around sizeof().
      @@
      type TYPE;
      expression THING, E;
      @@
      
      (
        kmalloc(
      -	(sizeof(TYPE)) * E
      +	sizeof(TYPE) * E
        , ...)
      |
        kmalloc(
      -	(sizeof(THING)) * E
      +	sizeof(THING) * E
        , ...)
      )
      
      // Drop single-byte sizes and redundant parens.
      @@
      expression COUNT;
      typedef u8;
      typedef __u8;
      @@
      
      (
        kmalloc(
      -	sizeof(u8) * (COUNT)
      +	COUNT
        , ...)
      |
        kmalloc(
      -	sizeof(__u8) * (COUNT)
      +	COUNT
        , ...)
      |
        kmalloc(
      -	sizeof(char) * (COUNT)
      +	COUNT
        , ...)
      |
        kmalloc(
      -	sizeof(unsigned char) * (COUNT)
      +	COUNT
        , ...)
      |
        kmalloc(
      -	sizeof(u8) * COUNT
      +	COUNT
        , ...)
      |
        kmalloc(
      -	sizeof(__u8) * COUNT
      +	COUNT
        , ...)
      |
        kmalloc(
      -	sizeof(char) * COUNT
      +	COUNT
        , ...)
      |
        kmalloc(
      -	sizeof(unsigned char) * COUNT
      +	COUNT
        , ...)
      )
      
      // 2-factor product with sizeof(type/expression) and identifier or constant.
      @@
      type TYPE;
      expression THING;
      identifier COUNT_ID;
      constant COUNT_CONST;
      @@
      
      (
      - kmalloc
      + kmalloc_array
        (
      -	sizeof(TYPE) * (COUNT_ID)
      +	COUNT_ID, sizeof(TYPE)
        , ...)
      |
      - kmalloc
      + kmalloc_array
        (
      -	sizeof(TYPE) * COUNT_ID
      +	COUNT_ID, sizeof(TYPE)
        , ...)
      |
      - kmalloc
      + kmalloc_array
        (
      -	sizeof(TYPE) * (COUNT_CONST)
      +	COUNT_CONST, sizeof(TYPE)
        , ...)
      |
      - kmalloc
      + kmalloc_array
        (
      -	sizeof(TYPE) * COUNT_CONST
      +	COUNT_CONST, sizeof(TYPE)
        , ...)
      |
      - kmalloc
      + kmalloc_array
        (
      -	sizeof(THING) * (COUNT_ID)
      +	COUNT_ID, sizeof(THING)
        , ...)
      |
      - kmalloc
      + kmalloc_array
        (
      -	sizeof(THING) * COUNT_ID
      +	COUNT_ID, sizeof(THING)
        , ...)
      |
      - kmalloc
      + kmalloc_array
        (
      -	sizeof(THING) * (COUNT_CONST)
      +	COUNT_CONST, sizeof(THING)
        , ...)
      |
      - kmalloc
      + kmalloc_array
        (
      -	sizeof(THING) * COUNT_CONST
      +	COUNT_CONST, sizeof(THING)
        , ...)
      )
      
      // 2-factor product, only identifiers.
      @@
      identifier SIZE, COUNT;
      @@
      
      - kmalloc
      + kmalloc_array
        (
      -	SIZE * COUNT
      +	COUNT, SIZE
        , ...)
      
      // 3-factor product with 1 sizeof(type) or sizeof(expression), with
      // redundant parens removed.
      @@
      expression THING;
      identifier STRIDE, COUNT;
      type TYPE;
      @@
      
      (
        kmalloc(
      -	sizeof(TYPE) * (COUNT) * (STRIDE)
      +	array3_size(COUNT, STRIDE, sizeof(TYPE))
        , ...)
      |
        kmalloc(
      -	sizeof(TYPE) * (COUNT) * STRIDE
      +	array3_size(COUNT, STRIDE, sizeof(TYPE))
        , ...)
      |
        kmalloc(
      -	sizeof(TYPE) * COUNT * (STRIDE)
      +	array3_size(COUNT, STRIDE, sizeof(TYPE))
        , ...)
      |
        kmalloc(
      -	sizeof(TYPE) * COUNT * STRIDE
      +	array3_size(COUNT, STRIDE, sizeof(TYPE))
        , ...)
      |
        kmalloc(
      -	sizeof(THING) * (COUNT) * (STRIDE)
      +	array3_size(COUNT, STRIDE, sizeof(THING))
        , ...)
      |
        kmalloc(
      -	sizeof(THING) * (COUNT) * STRIDE
      +	array3_size(COUNT, STRIDE, sizeof(THING))
        , ...)
      |
        kmalloc(
      -	sizeof(THING) * COUNT * (STRIDE)
      +	array3_size(COUNT, STRIDE, sizeof(THING))
        , ...)
      |
        kmalloc(
      -	sizeof(THING) * COUNT * STRIDE
      +	array3_size(COUNT, STRIDE, sizeof(THING))
        , ...)
      )
      
      // 3-factor product with 2 sizeof(variable), with redundant parens removed.
      @@
      expression THING1, THING2;
      identifier COUNT;
      type TYPE1, TYPE2;
      @@
      
      (
        kmalloc(
      -	sizeof(TYPE1) * sizeof(TYPE2) * COUNT
      +	array3_size(COUNT, sizeof(TYPE1), sizeof(TYPE2))
        , ...)
      |
        kmalloc(
      -	sizeof(TYPE1) * sizeof(THING2) * (COUNT)
      +	array3_size(COUNT, sizeof(TYPE1), sizeof(TYPE2))
        , ...)
      |
        kmalloc(
      -	sizeof(THING1) * sizeof(THING2) * COUNT
      +	array3_size(COUNT, sizeof(THING1), sizeof(THING2))
        , ...)
      |
        kmalloc(
      -	sizeof(THING1) * sizeof(THING2) * (COUNT)
      +	array3_size(COUNT, sizeof(THING1), sizeof(THING2))
        , ...)
      |
        kmalloc(
      -	sizeof(TYPE1) * sizeof(THING2) * COUNT
      +	array3_size(COUNT, sizeof(TYPE1), sizeof(THING2))
        , ...)
      |
        kmalloc(
      -	sizeof(TYPE1) * sizeof(THING2) * (COUNT)
      +	array3_size(COUNT, sizeof(TYPE1), sizeof(THING2))
        , ...)
      )
      
      // 3-factor product, only identifiers, with redundant parens removed.
      @@
      identifier STRIDE, SIZE, COUNT;
      @@
      
      (
        kmalloc(
      -	(COUNT) * STRIDE * SIZE
      +	array3_size(COUNT, STRIDE, SIZE)
        , ...)
      |
        kmalloc(
      -	COUNT * (STRIDE) * SIZE
      +	array3_size(COUNT, STRIDE, SIZE)
        , ...)
      |
        kmalloc(
      -	COUNT * STRIDE * (SIZE)
      +	array3_size(COUNT, STRIDE, SIZE)
        , ...)
      |
        kmalloc(
      -	(COUNT) * (STRIDE) * SIZE
      +	array3_size(COUNT, STRIDE, SIZE)
        , ...)
      |
        kmalloc(
      -	COUNT * (STRIDE) * (SIZE)
      +	array3_size(COUNT, STRIDE, SIZE)
        , ...)
      |
        kmalloc(
      -	(COUNT) * STRIDE * (SIZE)
      +	array3_size(COUNT, STRIDE, SIZE)
        , ...)
      |
        kmalloc(
      -	(COUNT) * (STRIDE) * (SIZE)
      +	array3_size(COUNT, STRIDE, SIZE)
        , ...)
      |
        kmalloc(
      -	COUNT * STRIDE * SIZE
      +	array3_size(COUNT, STRIDE, SIZE)
        , ...)
      )
      
      // Any remaining multi-factor products, first at least 3-factor products,
      // when they're not all constants...
      @@
      expression E1, E2, E3;
      constant C1, C2, C3;
      @@
      
      (
        kmalloc(C1 * C2 * C3, ...)
      |
        kmalloc(
      -	(E1) * E2 * E3
      +	array3_size(E1, E2, E3)
        , ...)
      |
        kmalloc(
      -	(E1) * (E2) * E3
      +	array3_size(E1, E2, E3)
        , ...)
      |
        kmalloc(
      -	(E1) * (E2) * (E3)
      +	array3_size(E1, E2, E3)
        , ...)
      |
        kmalloc(
      -	E1 * E2 * E3
      +	array3_size(E1, E2, E3)
        , ...)
      )
      
      // And then all remaining 2 factors products when they're not all constants,
      // keeping sizeof() as the second factor argument.
      @@
      expression THING, E1, E2;
      type TYPE;
      constant C1, C2, C3;
      @@
      
      (
        kmalloc(sizeof(THING) * C2, ...)
      |
        kmalloc(sizeof(TYPE) * C2, ...)
      |
        kmalloc(C1 * C2 * C3, ...)
      |
        kmalloc(C1 * C2, ...)
      |
      - kmalloc
      + kmalloc_array
        (
      -	sizeof(TYPE) * (E2)
      +	E2, sizeof(TYPE)
        , ...)
      |
      - kmalloc
      + kmalloc_array
        (
      -	sizeof(TYPE) * E2
      +	E2, sizeof(TYPE)
        , ...)
      |
      - kmalloc
      + kmalloc_array
        (
      -	sizeof(THING) * (E2)
      +	E2, sizeof(THING)
        , ...)
      |
      - kmalloc
      + kmalloc_array
        (
      -	sizeof(THING) * E2
      +	E2, sizeof(THING)
        , ...)
      |
      - kmalloc
      + kmalloc_array
        (
      -	(E1) * E2
      +	E1, E2
        , ...)
      |
      - kmalloc
      + kmalloc_array
        (
      -	(E1) * (E2)
      +	E1, E2
        , ...)
      |
      - kmalloc
      + kmalloc_array
        (
      -	E1 * E2
      +	E1, E2
        , ...)
      )
      Signed-off-by: NKees Cook <keescook@chromium.org>
      6da2ec56
  22. 28 3月, 2018 1 次提交
  23. 31 1月, 2018 1 次提交
  24. 23 1月, 2018 2 次提交