Re: [RFC] quota: 64-bit limits with vfs, updated

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mar 21, 2008  00:37 +0300, Andrew Perepechko wrote:
> +#define REV_ASSERT(r) BUG_ON((rev) != 0 && (rev) != 1)

Umm, "r" and "rev" are not consistent above...

Since this assertion is only on the in-memory quota structure, it would
probably be better to have something like

#define REV_R0  0x12340000
#define REV_R1  0x12340001

and when unpacking the on-disk revision number or it with REV_OFFSET and

#define REV_ASSERT(revno) BUG_ON((revno) != REV_R0 && (revno) != REV_R1)

That detects the common case of memory being zeroed for some reason.  It
will also easily detect if you aren't properly swabbing the revision
and unmasking the 0x1234000 from the in-memory structure.

Just a thought...  some people may not like this idea, but I dislike
using "0" as a magic number for anything.

Cheers, Andreas
--
Andreas Dilger
Sr. Staff Engineer, Lustre Group
Sun Microsystems of Canada, Inc.

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

[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]
  Powered by Linux