Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

[PATCH] reiserfs: reiserfs: check for files > 2GB on 3.5.x disks

When a filesystem has been converted from 3.5.x to 3.6.x, we need an extra
check during file write to make sure we are not trying to make a 3.5.x file
> 2GB.

Signed-off-by: Chris Mason <mason@suse.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>

authored by

Jeff Mahoney and committed by
Linus Torvalds
fa385bef 6ae1ea44

+17
+17
fs/reiserfs/file.c
··· 1287 1287 struct reiserfs_transaction_handle th; 1288 1288 th.t_trans_id = 0; 1289 1289 1290 + /* If a filesystem is converted from 3.5 to 3.6, we'll have v3.5 items 1291 + * lying around (most of the disk, in fact). Despite the filesystem 1292 + * now being a v3.6 format, the old items still can't support large 1293 + * file sizes. Catch this case here, as the rest of the VFS layer is 1294 + * oblivious to the different limitations between old and new items. 1295 + * reiserfs_setattr catches this for truncates. This chunk is lifted 1296 + * from generic_write_checks. */ 1297 + if (get_inode_item_key_version (inode) == KEY_FORMAT_3_5 && 1298 + *ppos + count > MAX_NON_LFS) { 1299 + if (*ppos >= MAX_NON_LFS) { 1300 + send_sig(SIGXFSZ, current, 0); 1301 + return -EFBIG; 1302 + } 1303 + if (count > MAX_NON_LFS - (unsigned long)*ppos) 1304 + count = MAX_NON_LFS - (unsigned long)*ppos; 1305 + } 1306 + 1290 1307 if (file->f_flags & O_DIRECT) { // Direct IO needs treatment 1291 1308 ssize_t result, after_file_end = 0; 1292 1309 if ((*ppos + count >= inode->i_size)