Re: [PATCH] JFFS2: Add parameter to reserve disk space for root

Daniel Drake
2012-05-15T18:06:37Z

On Tue, May 15, 2012 at 9:06 AM, David Woodhouse <dwmw2@infradead.org> wrote:
> On Tue, 2012-04-10 at 22:22 +0100, Daniel Drake wrote:
>>
>> +       /* Always allow root */
>> +       if (current_fsuid() == 0 || current_fsgid() == 0)
>> +               return 1;
>
> I've changed that to if (capable(CAP_SYS_RESOURCE)) rather than having a
> hard-coded check for the root user, which is usually the wrong thing to
> do. Please test.

Yes, this works fine.

Thanks!
Daniel