X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=extras%2Fvolume_id%2Flib%2Fgfs.c;h=2cb16a8693a606387890803e6dce24dc724314f6;hb=726687ad48bdececed1e7e44387c50e009e28208;hp=1d3a4a0f1e8d6489c6f5345c8432ca5cb9eaf8ee;hpb=cdf18948639e56d2e3c71606c72e2f2d239c100b;p=elogind.git diff --git a/extras/volume_id/lib/gfs.c b/extras/volume_id/lib/gfs.c index 1d3a4a0f1..2cb16a869 100644 --- a/extras/volume_id/lib/gfs.c +++ b/extras/volume_id/lib/gfs.c @@ -78,7 +78,7 @@ static int volume_id_probe_gfs_generic(struct volume_id *id, uint64_t off, int v { struct gfs2_sb *sbd; - info("probing at offset 0x%llx", (unsigned long long) off); + info("probing at offset 0x%llx\n", (unsigned long long) off); sbd = (struct gfs2_sb *) volume_id_get_buffer(id, off + GFS_SUPERBLOCK_OFFSET, sizeof(struct gfs2_sb)); @@ -86,8 +86,7 @@ static int volume_id_probe_gfs_generic(struct volume_id *id, uint64_t off, int v return -1; if (be32_to_cpu(sbd->sb_header.mh_magic) == GFS_MAGIC && - be32_to_cpu(sbd->sb_header.mh_type) == GFS_METATYPE_SB && - be32_to_cpu(sbd->sb_header.mh_format) == GFS_FORMAT_SB) { + be32_to_cpu(sbd->sb_header.mh_type) == GFS_METATYPE_SB) { if (vers == 1) { if (be32_to_cpu(sbd->sb_fs_format) != GFS_FORMAT_FS || be32_to_cpu(sbd->sb_multihost_format) != GFS_FORMAT_MULTI) @@ -102,6 +101,13 @@ static int volume_id_probe_gfs_generic(struct volume_id *id, uint64_t off, int v } else return -1; + + if (strlen(sbd->sb_locktable)) { + uint8_t *label = (uint8_t *) sbd->sb_locktable; + + volume_id_set_label_raw(id, label, GFS_LOCKNAME_LEN); + volume_id_set_label_string(id, label, GFS_LOCKNAME_LEN); + } strcpy(id->type_version, "1"); volume_id_set_usage(id, VOLUME_ID_FILESYSTEM); return 0;