[Ocfs2-tools-devel] [PATCH] Improvement to tunefs.ocfs2 online resize to handle symbolic link
Coly Li
coly.li at suse.de
Thu Mar 11 08:49:33 PST 2010
On 2010年03月11日 17:31, Jiaju Zhang Wrote:
[snip]
>
> diff --git a/ocfs2_controld/mount.c b/ocfs2_controld/mount.c
> index 36459d1..076f727 100644
> --- a/ocfs2_controld/mount.c
> +++ b/ocfs2_controld/mount.c
> @@ -260,11 +260,13 @@ static void add_service(struct mountgroup *mg, const char *device,
> const char *service, int ci, int fd)
> {
> struct service *ms;
> + struct stat st1, st2;
>
> log_debug("Adding service %s to device %s uuid %s",
> service, device, mg->mg_uuid);
>
> - if (strcmp(mg->mg_device, device)) {
> + if (!stat(mg->mg_device, &st1) && !stat(device, &st2)
> + && st1.st_rdev != st2.st_rdev) {
Are mg->mg_device and device from identical node ? If not, there might be chance st1.st_rdev != st2.st_rdev. Is it
possible just using the target path string which the symbolic link points to (e.g something we get from readlink(2)) ?
I don't check the code, just a fast/lazy question.
--
Coly Li
SuSE Labs
More information about the Ocfs2-tools-devel
mailing list