public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* ftruncate returning EPERM on vfat filesystem
@ 2001-01-07  6:47 Dave
  2001-01-07 13:55 ` Alan Cox
  0 siblings, 1 reply; 5+ messages in thread
From: Dave @ 2001-01-07  6:47 UTC (permalink / raw)
  To: linux-kernel


Hi everyone,

I experienced a strange problem after upgrading from 2.4.0-test12 to the
2.4.0 kernel.  My samba configuration stopped working.  Reverting back to
2.4.0-test12, it magically starts working again.

(2.4.0 also hard-locked my machine before I noticed this problem, but
I'll report that later when I work out why.)

I share a local vfat filesystem to a windows machine.  With 2.4.0, the
client kept randomly reporting "...Access is denied.. Make sure the disk
is not full or write-protected..." when transferring files to this
machine.  After much cursing and hair-pulling, I straced samba under both
kernels, and found out that ftruncate was returning EPERM under 2.4.0.

After diffing between 2.4.0-test12 and 2.4.0, i found this little chunk
in fat_notify_change() which may explain the problem:

diff -u --new-file --recursive linux-2.4.0-test12/fs/fat/inode.c linux-2.4.0/fs/fat/inode.c
--- linux-2.4.0-test12/fs/fat/inode.c   Tue Dec  5 13:00:44 2000
+++ linux-2.4.0/fs/fat/inode.c  Mon Jan  1 05:02:21 2001
@@ -903,6 +903,12 @@
        struct super_block *sb = dentry->d_sb;
        struct inode *inode = dentry->d_inode;
        int error;
+
+       /* 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?

TIA.

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/

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2001-01-07 21:05 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2001-01-07  6:47 ftruncate returning EPERM on vfat filesystem Dave
2001-01-07 13:55 ` Alan Cox
2001-01-07 15:20   ` Dave
2001-01-07 16:44   ` Daniel Phillips
2001-01-07 21:03   ` Richard Henderson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox