~ubuntu-branches/ubuntu/vivid/xfsprogs/vivid

« back to all changes in this revision

Viewing changes to libdisk/dm.c

  • Committer: Bazaar Package Importer
  • Author(s): Nathan Scott
  • Date: 2009-09-17 14:32:48 UTC
  • Revision ID: james.westby@ubuntu.com-20090917143248-jrclwl1byyautnnk
Tags: 3.0.4
* New bugfix release
* Resolve a libxfs unaligned access (closes: #517553)

Show diffs side-by-side

added added

removed removed

Lines of Context:
36
36
{
37
37
        int             count, stripes = 0, stripesize = 0;
38
38
        int             dmpipe[2];
39
 
        char            *dpath, *largv[4], tmppath[PATH_MAX];
 
39
        char            *largv[7];
40
40
        FILE            *stream;
41
41
        long long       offset, size;
42
42
        static char     *command = "table";     /* dmsetup table /dev/xxx */
 
43
        char            major_str[4], minor_str[4];
43
44
 
44
45
        if (!mnt_is_dm_subvol(sb->st_rdev))
45
46
                return 0;
57
58
                return 0;
58
59
        }
59
60
 
60
 
        if (!(dpath = realpath(dfile, tmppath))) {
61
 
                fprintf(stderr,
62
 
        _("Warning - device mapper device, but cannot resolve path %s: %s\n"),
63
 
                        dfile, strerror(errno));
64
 
                return 0;
65
 
        }
 
61
        snprintf(major_str, 4, "%d", major(sb->st_rdev));
 
62
        snprintf(minor_str, 4, "%d", minor(sb->st_rdev));
66
63
 
67
64
        largv[1] = command;
68
 
        largv[2] = dpath;
69
 
        largv[3] = NULL;
 
65
        largv[2] = "-j";
 
66
        largv[3] = major_str;
 
67
        largv[4] = "-m";
 
68
        largv[5] = minor_str;
 
69
        largv[6] = NULL;
70
70
 
71
71
        /* Open pipe */
72
72
        if (pipe(dmpipe) < 0) {