Re: [PATCH] Quota fix 3 - quota file corruption

From: Andrew Morton
Date: Mon May 17 2004 - 15:57:32 EST


Jan Kara <jack@xxxxxx> wrote:
>
> + memset(&empty, 0, sizeof(struct v2_disk_dqblk));
> + if (!memcmp(&empty, &ddquot, sizeof(struct v2_disk_dqblk)))
> + ddquot.dqb_itime = cpu_to_le64(1);

hm, OK.

Comparing structures for equality might not work right if the compiler
added internal padding. However in this case the structure is six u32's
followed by a couple of u64's so it will work out right. And it's an
on-disk thing so it won't be changing in a hurry.


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/