lkml.org 
[lkml]   [2001]   [Jan]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: ftruncate returning EPERM on vfat filesystem

Hi Alan,

On Sun, 7 Jan 2001, Alan Cox wrote:

> I wrote:
> > +
> > + /* FAT cannot truncate to a longer file */
> > + if (attr->ia_valid & ATTR_SIZE) {
> > + if (attr->ia_size > inode->i_size)
> > + return -EPERM;
> > + }
> >
> > error = inode_change_ok(inode, attr);
> > if (error)
> >
> > Can someone tell me if this is the cause of my samba problems, and if
> > so, why this was added and if this is safe to revert?
>
> To stop a case where the fs gets corrupted otherwise. You can change that to
> return 0 which is more correct but most not remove it.

Ok. Glad I didn't try it. ;)

> (ftruncate is specified to make the file at most length bytes long, extending
> the file is not a guaranteed side effect according to the docs I have)

I don't understand why samba is doing it, if infact it is.
(haven't checked the source yet, and too tired to care atm)

Two other people told me to try your 2.4.0 tree, as it has some FAT
growing-truncate patches (I can't test it until later today). I'm
guessing (hoping) that -ac3 will fix this problem.


Thanks alot for your help.

David.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 12:52    [W:0.111 / U:5.236 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site