File:  [GPL Stacker compression] / dmsdos / patches / fat-truncate-bugfix.diff
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs
Tue Apr 24 16:38:02 2018 UTC (8 years, 3 months ago) by root
Branches: MAIN, DMSDOS
CVS tags: dmsdos092322, dmsdos092232, dmsdos0922, HEAD
DMSDOS 0.9.2.2

--- linux/fs/fat/file.c.orig	Thu Jan  7 18:38:59 1999
+++ linux/fs/fat/file.c	Thu Jan  7 19:17:40 1999
@@ -442,6 +442,10 @@
 	/* Why no return value?  Surely the disk could fail... */
 	if (IS_IMMUTABLE(inode))
 		return /* -EPERM */;
+	if(inode->i_sb->s_flags&MS_RDONLY) {
+		printk("FAT: fat_truncate called though fs is read-only, uhh...\n");
+		return /* -EROFS */;
+	}
 	cluster = SECTOR_SIZE*MSDOS_SB(inode->i_sb)->cluster_size;
 	(void) fat_free(inode,(inode->i_size+(cluster-1))/cluster);
 	MSDOS_I(inode)->i_attrs |= ATTR_ARCH;

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.