remarkable-linux/fs/ocfs2
Younger Liu 2b1e55c389 ocfs2: lighten up allocate transaction
The issue scenario is as following:

When fallocating a very large disk space for a small file,
__ocfs2_extend_allocation attempts to get a very large transaction.  For
some journal sizes, there may be not enough room for this transaction,
and the fallocate will fail.

The patch below extends & restarts the transaction as necessary while
allocating space, and should work with even the smallest journal.  This
patch refers ext4 resize.

Test:
# mkfs.ocfs2 -b 4K -C 32K -T datafiles /dev/sdc
...(jounral size is 32M)
# mount.ocfs2 /dev/sdc /mnt/ocfs2/
# touch /mnt/ocfs2/1.log
# fallocate -o 0 -l 400G /mnt/ocfs2/1.log
fallocate: /mnt/ocfs2/1.log: fallocate failed: Cannot allocate memory
# tail -f /var/log/messages
[ 7372.278591] JBD: fallocate wants too many credits (2051 > 2048)
[ 7372.278597] (fallocate,6438,0):__ocfs2_extend_allocation:709 ERROR: status = -12
[ 7372.278603] (fallocate,6438,0):ocfs2_allocate_unwritten_extents:1504 ERROR: status = -12
[ 7372.278607] (fallocate,6438,0):__ocfs2_change_file_space:1955 ERROR: status = -12
^C
With this patch, the test works well.

Signed-off-by: Younger Liu <younger.liu@huawei.com>
Cc: Jie Liu <jeff.liu@oracle.com>
Cc: Joel Becker <jlbec@evilplan.org>
Cc: Mark Fasheh <mfasheh@suse.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2013-09-11 15:56:28 -07:00
..
cluster ocfs2: fix NULL pointer dereference when traversing o2hb_all_regions 2013-07-03 16:07:25 -07:00
dlm ocfs2: dlmlock_master() should return DLM_NORMAL after adding lock to blocked list 2013-07-03 16:07:24 -07:00
dlmfs fs: Limit sys_mount to only request filesystem modules. 2013-03-03 19:36:31 -08:00
acl.c ocfs2: Handle kuids and kgids in acl/xattr conversions. 2013-02-13 06:00:56 -08:00
acl.h
alloc.c ocfs2: fix mutex_unlock and possible memory leak in ocfs2_remove_btree_range 2013-07-03 16:07:23 -07:00
alloc.h
aops.c direct-io: Implement generic deferred AIO completions 2013-09-04 09:23:46 -04:00
aops.h aio: don't include aio.h in sched.h 2013-05-07 20:16:25 -07:00
blockcheck.c
blockcheck.h
buffer_head_io.c
buffer_head_io.h
dcache.c hlist: drop the node parameter from iterators 2013-02-27 19:10:24 -08:00
dcache.h
dir.c ocfs2: fix null pointer dereference in ocfs2_dir_foreach_blk_id() 2013-08-13 17:57:49 -07:00
dir.h [readdir] convert ocfs2 2013-06-29 12:57:02 +04:00
dlmglue.c aio: remove retry-based AIO 2013-05-07 18:38:27 -07:00
dlmglue.h
export.c fs: encode_fh: return FILEID_INVALID if invalid fid_type 2013-02-26 02:46:10 -05:00
export.h
extent_map.c ocfs2: goto out_unlock if ocfs2_get_clusters_nocache() failed in ocfs2_fiemap() 2013-05-24 16:22:52 -07:00
extent_map.h
file.c ocfs2: lighten up allocate transaction 2013-09-11 15:56:28 -07:00
file.h
heartbeat.c
heartbeat.h
inode.c ocfs2: Convert uid and gids between in core and on disk inodes 2013-02-13 06:00:58 -08:00
inode.h aio: don't include aio.h in sched.h 2013-05-07 20:16:25 -07:00
ioctl.c ocfs2: fix error return code in ocfs2_info_handle_freefrag() 2013-04-29 15:54:27 -07:00
ioctl.h
journal.c ocfs2: lighten up allocate transaction 2013-09-11 15:56:28 -07:00
journal.h ocfs2: lighten up allocate transaction 2013-09-11 15:56:28 -07:00
Kconfig
localalloc.c ocfs2: remove kfree() redundant null checks 2013-02-21 17:22:19 -08:00
localalloc.h
locks.c
locks.h
Makefile
mmap.c kill f_vfsmnt 2013-02-26 02:46:10 -05:00
mmap.h
move_extents.c ocfs2: fix NULL pointer dereference in ocfs2_duplicate_clusters_by_page 2013-08-13 17:57:49 -07:00
move_extents.h
namei.c ocfs2: fix readonly issue in ocfs2_unlink() 2013-07-03 16:07:24 -07:00
namei.h
ocfs1_fs_compat.h
ocfs2.h ocfs2: remove unecessary variable needs_checkpoint 2013-07-03 16:07:23 -07:00
ocfs2_fs.h
ocfs2_ioctl.h
ocfs2_lockid.h
ocfs2_lockingver.h
ocfs2_trace.h ocfs2: lighten up allocate transaction 2013-09-11 15:56:28 -07:00
quota.h
quota_global.c
quota_local.c
refcounttree.c ocfs2: fix NULL pointer dereference in ocfs2_duplicate_clusters_by_page 2013-08-13 17:57:49 -07:00
refcounttree.h ocfs2: fix NULL pointer dereference in ocfs2_duplicate_clusters_by_page 2013-08-13 17:57:49 -07:00
reservations.c
reservations.h
resize.c
resize.h
slot_map.c
slot_map.h
stack_o2cb.c ocfs2: remove kfree() redundant null checks 2013-02-21 17:22:19 -08:00
stack_user.c
stackglue.c
stackglue.h
suballoc.c ocfs2: remove duplicated mlog_errno() in ocfs2_relink_block_group 2013-07-03 16:07:24 -07:00
suballoc.h ocfs2: ac->ac_allow_chain_relink=0 won't disable group relink 2013-02-27 19:10:09 -08:00
super.c fs/ocfs2/super.c: Use bigger nodestr to accomodate 32-bit node numbers 2013-08-28 19:26:38 -07:00
super.h
symlink.c ocfs2: Fix oops in ocfs2_fast_symlink_readpage() code path 2013-02-26 02:46:12 -05:00
symlink.h
sysfile.c ocfs2: remove kfree() redundant null checks 2013-02-21 17:22:19 -08:00
sysfile.h
uptodate.c
uptodate.h
ver.c
ver.h
xattr.c ocfs2: xattr: fix inlined xattr reflink 2013-07-03 16:07:24 -07:00
xattr.h xattr: Constify ->name member of "struct xattr". 2013-07-25 19:30:03 +10:00