diff options
author | David Woodhouse <David.Woodhouse@intel.com> | 2008-08-28 11:05:17 -0400 |
---|---|---|
committer | Steve Dickson <steved@redhat.com> | 2008-08-28 11:05:17 -0400 |
commit | 3a340251597a5b0c579c31d8caf9aa3b53a77016 (patch) | |
tree | f54454489ef2304bd2744e0c2693738765dfbfd9 /utils/mountd | |
parent | 8d52fc2691783dc9ef5bd9d9a1fa4c0ec33b20bc (diff) | |
download | nfs-utils-3a340251597a5b0c579c31d8caf9aa3b53a77016.tar.gz nfs-utils-3a340251597a5b0c579c31d8caf9aa3b53a77016.tar.xz nfs-utils-3a340251597a5b0c579c31d8caf9aa3b53a77016.zip |
Use fsid from statfs for UUID if blkid can't cope (or not used)
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Signed-off-by: Steve Dickson <steved@redhat.com>
Diffstat (limited to 'utils/mountd')
-rw-r--r-- | utils/mountd/cache.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/utils/mountd/cache.c b/utils/mountd/cache.c index 23e2344..fa15472 100644 --- a/utils/mountd/cache.c +++ b/utils/mountd/cache.c @@ -215,8 +215,17 @@ int get_uuid(char *path, char *uuid, int uuidlen, char *u) if (path) { val = get_uuid_blkdev(path); - if (!val) - return 0; + if (!val) { + struct statfs64 st; + + if (statfs64(path, &st)) + return 0; + if (!st.f_fsid.__val[0] && !st.f_fsid.__val[1]) + return 0; + snprintf(fsid_val, 17, "%08x%08x", + st.f_fsid.__val[0], st.f_fsid.__val[1]); + val = fsid_val; + } } else { val = uuid; } |