Uploaded image for project: 'Lustre'
  1. Lustre
  2. LU-11053

problem with loop device associated with lustre file

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • Minor
    • None
    • None
    • None
    • 3
    • 9223372036854775807

    Description

      lustre's file open does not bring the file size info in-core inode. losetup avoids stat for the backing lustre file before LOOP_SET_FD:

      open("/mnt/lustre/ext4image", O_RDWR)    = 3
      open("/dev/loop0", O_RDWR)              = 4
      ioctl(4, LOOP_SET_FD, 0x3)              = 0
      stat("/mnt/lustre/ext4image"...
      

      So losetup creates block device inode with zero size which eventually leads to failure on umounting the loop device at BUG_ON(!buffer_mapped(bh)) in submit_bh():

      <2>kernel BUG at fs/buffer.c:3157!
      <4>invalid opcode: 0000 [#1] SMP
      <4>last sysfs file: /sys/devices/system/cpu/online
      <4>CPU 37
      ...
      <4>Pid: 6751, comm: umount Not tainted 2.6.32-696.18.7.el6.x86_64 #1 BULL bullx blade/CHPD
      <4>RIP: 0010:[<ffffffff811d0962>]  [<ffffffff811d0962>] submit_bh+0x152/0x1f0
      <4>RSP: 0018:ffff88107483bd68  EFLAGS: 00010246
      <4>RAX: 0000000000000005 RBX: ffff88087c7fbd60 RCX: 0000000000000017
      ...
      <4>Call Trace:
      <4> [<ffffffff811d2973>] __sync_dirty_buffer+0x53/0xf0
      <4> [<ffffffff811d2a23>] sync_dirty_buffer+0x13/0x20
      <4> [<ffffffffa0d1877b>] ext2_sync_super+0x5b/0x70 [ext2]
      <4> [<ffffffffa0d19733>] ext2_put_super+0x133/0x150 [ext2]
      <4> [<ffffffff8119cc4b>] generic_shutdown_super+0x5b/0xe0
      <4> [<ffffffff8119cd01>] kill_block_super+0x31/0x50
      <4> [<ffffffff8119d4d7>] deactivate_super+0x57/0x80
      <4> [<ffffffff811bd50f>] mntput_no_expire+0xbf/0x110
      <4> [<ffffffff811be05b>] sys_umount+0x7b/0x3a0
      

      The modification to sanity.sh:test_54c (from Andrew Perepechko) illustrates the problem.

      diff --git a/lustre/tests/sanity.sh b/lustre/tests/sanity.sh
      index c6b292b029..d2961dbf0e 100755
      --- a/lustre/tests/sanity.sh
      +++ b/lustre/tests/sanity.sh
      @@ -4656,10 +4656,15 @@ test_54c() {
              mknod $loopdev b 7 $LOOPNUM
              echo "make a loop file system with $DIR/$tfile on $loopdev ($LOOPNUM)."
              dd if=/dev/zero of=$DIR/$tfile bs=$(get_page_size client) seek=1024 count=1 > /dev/null
      +       mkfs.ext2 $DIR/$tfile  || error "mke2fs on $DIR/$tfile "
      +       test_mkdir $DIR/$tdir
      +
      +       cancel_lru_locks mdc
      +       cancel_lru_locks osc
      +
              losetup $loopdev $DIR/$tfile ||
                      error "can't set up $loopdev for $DIR/$tfile"
      -       mkfs.ext2 $loopdev || error "mke2fs on $loopdev"
      -       test_mkdir $DIR/$tdir
      +
              mount -t ext2 $loopdev $DIR/$tdir ||
                      error "error mounting $loopdev on $DIR/$tdir"
              dd if=/dev/zero of=$DIR/$tdir/tmp bs=$(get_page_size client) count=30 ||
      

      Attachments

        Activity

          People

            vsaveliev Vladimir Saveliev
            vsaveliev Vladimir Saveliev
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated: