[lkml]   [2007]   [Jul]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [EXT4 set 7][PATCH 1/1]Remove 32000 subdirs limit.
On Fri, 13 Jul 2007 16:00:48 +0530 Kalpak Shah <> wrote:

> > >
> > > - if (inode->i_nlink >= EXT4_LINK_MAX)
> > > + if (EXT4_DIR_LINK_MAX(inode))
> > > return -EMLINK;
> >
> > as_lower_case_inlines? Sigh. It's all the old-timers, I guess.
> >
> > EXT4_DIR_LINK_MAX() is buggy: it evaluates its arg twice.
> #define EXT4_DIR_LINK_MAX(dir) (!is_dx(dir) && (dir)->i_nlink >= EXT4_LINK_MAX)
> This just checks if directory has hash indexing in which case we need not worry about EXT4_LINK_MAX subdir limit. If directory is not hash indexed then we will need to enforce a max subdir limit.
> Sorry, I didn't understand what is the problem with this macro?

Macros should never evaluate their argument more than once, because if they
do they will misbehave when someone passes them an

struct inode *p = q;


one expects `p' to have the value q+1 here. But it might be q+2.



might cause some_function() to be called twice.

This is one of the many problems which gets fixed when we write code in C
rather than in cpp.
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

 \ /
  Last update: 2007-07-13 18:57    [W:0.085 / U:4.296 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site