1 May 2010 09:04
Re: [PATCH] Prevent creation of files larger than RLIMIT_FSIZE using fallocate
Amit K. Arora <aarora <at> linux.vnet.ibm.com>
2010-05-01 07:04:26 GMT
2010-05-01 07:04:26 GMT
On Fri, Apr 30, 2010 at 02:33:19PM -0700, Andrew Morton wrote:
>
> (Amit Arora <aarora <at> in.ibm.com> wrote fallocate. cc added)
Thanks for adding me to CC.
> On Thu, 29 Apr 2010 10:14:06 +0530
> Nikanth Karthikesan <knikanth <at> suse.de> wrote:
>
> > Here is an updated patch that takes the i_mutex and calls inode_newsize_ok()
> > only for regular files.
>
> err, no. It's taking i_lock where it meant to take i_mutex.
>
> > Thanks
> > Nikanth
> >
> > + if (S_ISREG(inode->i_mode)) {
> > + spin_lock(&inode->i_lock);
> > + ret = inode_newsize_ok(inode, (offset + len));
> > + spin_unlock(&inode->i_lock);
> > + if (ret)
> > + return ret;
> > + } else if (S_ISDIR(inode->i_mode)) {
> > + /*
> > + * Let individual file system decide if it supports
> > + * preallocation for directories or not.
> > + */
> > + if (offset > inode->i_sb->s_maxbytes)
> > + return -EFBIG;
(Continue reading)
RSS Feed