[Bug 826165] Re: blkid breaks on large partitions (BLKGETSIZE)

HelgeJensen helge.jensen at slog.dk
Sun Aug 14 13:25:43 UTC 2011


The bug is caused by the source for blkid_get_dev_size(int fd) checking
the kernel version to detect whether BLKGETSIZE64 is supported in the
following way:

#ifdef BLKGETSIZE64
#ifdef __linux__
        if ((uname(&ut) == 0) &&
            ((ut.release[0] == '2') && (ut.release[1] == '.') &&
             (ut.release[2] < '6') && (ut.release[3] == '.')))
                valid_blkgetsize64 = 0;
#endif
        if (valid_blkgetsize64 &&
            ioctl(fd, BLKGETSIZE64, &size64) >= 0) {
                if ((sizeof(blkid_loff_t) < sizeof(unsigned long long))
                    && ((size64) > 0xFFFFFFFF))
                        return 0; /* EFBIG */
                return size64;
        }
#endif

So my 3.0.2 kernel is considered to *not* have BLKGETSIZE64 support :)

The bug is fixed in git commit 3069624180bac35f1cd468249ddb9dfc91d1b7b1
which also improves a lot of other code.

It would be nice if natty got a backport of the util-linux 2.19 from
oneiric which includes this fix.

-- 
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to util-linux in Ubuntu.
https://bugs.launchpad.net/bugs/826165

Title:
  blkid breaks on large partitions (BLKGETSIZE)

Status in “util-linux” package in Ubuntu:
  New

Bug description:
  Runnning blkid on a raid5 partition of ~3Tb no data is retrieved.
  Smaller partitions works fine.

  This is cause by a call to ioctl(_, BLKGETSIZE, _) which returns -1
  EFBIG (File too large).

  root at myth:/# cat /proc/mdstat
  Personalities : [linear] [multipath] [raid0] [raid1] [raid6] [raid5] [raid4] [raid10]
  md1 : active raid5 sdd1[2] sdc1[1]
        8386528 blocks super 1.2 level 5, 16k chunk, algorithm 2 [3/2] [_UU]

  md0 : active raid5 sdd2[2] sdc2[1]
        2921883360 blocks super 1.2 level 5, 16k chunk, algorithm 2 [3/2] [_UU]

  unused devices: <none>

  
  root at myth:/# blkid /dev/md0 /dev/md1
  /dev/md1: LABEL="x5" UUID="0c4bdd32-aec9-442e-baa1-e8011f970943" UUID_SUB="0363dc7e-f786-4dad-acc6-e52cc7f075c6" TYPE="btrfs"

  Here is the relevant part of an strace of the situation. Notice that
  stat64 is used, but BLKGETSIZE64 is not :)

  root at myth:/# strace blkid /dev/md0 2>&1  | less
  ...
  stat64("/dev/md0", {st_mode=S_IFBLK|0660, st_rdev=makedev(9, 0), ...}) = 0
  open("/dev/md0", O_RDONLY|O_LARGEFILE)  = 3
  fadvise64_64(3, 0, 0, POSIX_FADV_RANDOM) = 0
  fstat64(3, {st_mode=S_IFBLK|0660, st_rdev=makedev(9, 0), ...}) = 0
  uname({sys="Linux", node="myth", ...})  = 0
  ioctl(3, BLKGETSIZE, 0xbf9616bc)        = -1 EFBIG (File too large)
  close(3)                                = 0
  ...

  ProblemType: Bug
  DistroRelease: Ubuntu 11.04
  Package: util-linux 2.17.2-9.1ubuntu4
  ProcVersionSignature: Ubuntu 3.0-2.3-generic 3.0.0-rc4
  Uname: Linux 3.0-2-generic i686
  NonfreeKernelModules: nvidia
  Architecture: i386
  Date: Sun Aug 14 10:33:40 2011
  InstallationMedia: Ubuntu 11.04 "Natty Narwhal" - Release i386 (20110427.1)
  ProcEnviron:
   LANGUAGE=en_US:en
   PATH=(custom, no user)
   LANG=en_US.UTF-8
   SHELL=/bin/bash
  SourcePackage: util-linux
  UpgradeStatus: No upgrade log present (probably fresh install)

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/util-linux/+bug/826165/+subscriptions




More information about the foundations-bugs mailing list