Hi,

On Wed, Nov 25, 2026 at 12:41:48AM +0300, Ahmed Khider wrote:
> Hello
> 
> I modified the patch.
> 
> The values->(mode_t)  -1 pass normally with -Wall -Wextra
> 
> It requires this warning :
> 
> -Wsign-conversion
> 

Thanks, I now see the error. -1 was probably used for getting
the max value in a quick (or smart :P) way.

> 
> the if statement
> 
>  if (size == 0)
>     {
>       argp_error (state, "argument must be bigger than zero");
>       return EINVAL;
>     }
> 
> is for :
>    tmpfs_page_limit = (values->size + vm_page_size - 1) / vm_page_size;
> 
> If the size is 0, it will give it unlimited memory
> 

If size is 0 (I'm not sure what the use-case is), the tmpfs_page_limit
should also be 0.

And since it is usually used like below (dir.c):

    error_t
    diskfs_direnter_hard (struct node *dp, const char *name,
                          struct node *np, struct dirstat *ds,
                          struct protid *cred)
    {
        const size_t namelen = strlen (name);
        const size_t entsize
                = (offsetof (struct dirent, d_name[1]) + namelen + 7) & ~7;
        struct tmpfs_dirent *new;
        if (round_page (tmpfs_space_used + entsize) / vm_page_size
                > tmpfs_page_limit)
              return ENOSPC;

Everything above 0 would return ENOSPC.

Cheers.

Reply via email to