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

tunefs.lustre must protect against specifying multiple devices

    XMLWordPrintable

Details

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

    Description

      tunefs.lustre is designed to configure a single Lustre device at a time.
      However, the command accepts multiple block devices as arguments, and when this happens, it writes incorrect metadata to the devices, resulting in mixed-up mountdata files of the OST/MDT targets

      For example

      Let's assume MDT devices:
      /dev/nvme0n1 -> testfs-MDT0000
      /dev/nvme1n1 -> testfs-MDT0001
      
      # tunefs.lustre /dev/nvme0n1 
      checking for existing Lustre data: found
      
         Read previous values:
      Target:     testfs-MDT0000
      Index:      0
      Lustre FS:  testfs
      Mount type: ldiskfs
      Flags:      0x1065
                    (MDT MGS first_time update no_primnode )
      Persistent mount opts: user_xattr,errors=remount-ro
      Parameters: mgsnode=10.0.211.1@o2ib12:10.0.211.2@o2ib12 failover.node=10.0.211.1@o2ib12:10.0.211.2@o2ib12
      
      
         Permanent disk data:
      Target:     testfs:MDT0000
      Index:      0
      Lustre FS:  testfs
      Mount type: ldiskfs
      Flags:      0x1065
                    (MDT MGS first_time update no_primnode )
      Persistent mount opts: user_xattr,errors=remount-ro
      Parameters: mgsnode=10.0.211.1@o2ib12:10.0.211.2@o2ib12 failover.node=10.0.211.1@o2ib12:10.0.211.2@o2ib12
      

      The following command can be accepted and, it reads mountdata from /dev/nvme1n1 (MDT1) and write it into /dev/nvme0n1 (MDT0)

      # tunefs.lustre /dev/nvme0n1 /dev/nvme1n1
      

      This behavior is dangerous and can silently corrupt mountdata file of OST/MDT targets.

      # tunefs.lustre /dev/nvme0n1 
      checking for existing Lustre data: found
      
         Read previous values:
      Target:     testfs-MDT0000
      Index:      1
      Lustre FS:  testfs
      Mount type: ldiskfs
      Flags:      0x1061
                    (MDT first_time update no_primnode )
      Persistent mount opts: user_xattr,errors=remount-ro
      Parameters: mgsnode=10.0.211.1@o2ib12:10.0.211.2@o2ib12 failover.node=10.0.211.1@o2ib12:10.0.211.2@o2ib12
      
      
         Permanent disk data:
      Target:     testfs:MDT0001
      Index:      1
      Lustre FS:  testfs
      Mount type: ldiskfs
      Flags:      0x1061
                    (MDT first_time update no_primnode )
      Persistent mount opts: user_xattr,errors=remount-ro
      Parameters: mgsnode=10.0.211.1@o2ib12:10.0.211.2@o2ib12 failover.node=10.0.211.1@o2ib12:10.0.211.2@o2ib12
      
      Writing CONFIGS/mountdata
      

      This must be prevented, and an error should be returned instead.

      Attachments

        Issue Links

          Activity

            People

              ys Yang Sheng
              sihara Shuichi Ihara
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated: