lkml.org 
[lkml]   [2021]   [Jul]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: Re: [BUG] ramfs system panic when using dd to create files
On Wed, Jul 14, 2021 at 10:30:22PM +0800, yong w wrote:
> Thanks for your reply!
>
> > Limit max size of ramfs.
> It's no use using size to limit the size of ramfs.
> "mount -t ramfs -o size=10M ramfs /ramfs" is the command i use.
>

ramfs does not support size= limiting, that's what tmpfs is for.

> >
> > The comments already explains why kernel should panic on this situation:
> > /*
> > * If we got here due to an actual allocation at the
> > * system level, we cannot survive this and will enter
> > * an endless loop in the allocator. Bail out now.
> > */
>
> But it causes panic, actually , I don't want it panics

Then use tmpfs and specify size=. It's mentioned in filesystems/tmpfs.rst

--8<--
If you compare it to ramfs (which was the template to create tmpfs)
you gain swapping and limit checking. Another similar thing is the RAM
disk (/dev/ram*), which simulates a fixed size hard disk in physical
RAM, where you have to create an ordinary filesystem on top. Ramdisks
cannot swap and you do not have the possibility to resize them.
--8<--

--
Mel Gorman
SUSE Labs

\
 
 \ /
  Last update: 2021-07-15 13:45    [W:0.085 / U:0.084 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site