remarkable-linux/fs/ocfs2
Xiaowei.Hu 0393afea31 ocfs2: Add a missing journal credit in ocfs2_link_credits() -v2
With indexed_dir enabled, ocfs2 maintains a list of dirblocks having
space.

The credit calculation in ocfs2_link_credits() did not correctly account
for adding an entry that exactly fills a dirblock that triggers removing
that dirblock by changing the pointer in the previous block in the list.
The credit calculation did not account for that previous block.

To expose, do:

mkfs.ocfs2 -b 512 -M local /dev/sdX
mount /dev/sdX /ocfs2
mkdir /ocfs2/linkdir
touch /ocfs2/linkdir/file1
for i in `seq 1 29` ; do link /ocfs2/linkdir/file1
/ocfs2/linkdir/linklinklinklinklinklink$i; done
rm -f /ocfs2/linkdir/linklinklinklinklinklink10
sleep 8
link /ocfs2/linkdir/file1
/ocfs2/linkdir/linklinklinklinklinklinkaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa

Note:
The link names have been crafted for a 512 byte blocksize. Reproducing
with a larger blocksize will require longer (or more) links. The sleep
is important. We want jbd2 to commit the transaction so that the missing
block does not piggy back on account of the previous transaction.

Signed-off-by: XiaoweiHu <xiaowei.hu at oracle.com>
Reviewed-by: WengangWang <wen.gang.wang at oracle.com>
Reviewed-by: Sunil.Mushran <sunil.mushran at oracle.com>
Signed-off-by: Joel Becker <jlbec@evilplan.org>
2011-11-17 01:46:48 -08:00
..
cluster ocfs2/cluster: Add new function o2net_fill_node_map() 2011-07-24 10:32:54 -07:00
dlm fs/ocfs2/dlm/dlmlock.c: free kmem_cache_zalloc'd data using kmem_cache_free 2011-11-17 01:46:46 -08:00
dlmfs ocfs2: change incorrect 'extern' keyword to 'static' in dlmfs 2011-05-23 23:59:40 -07:00
acl.c ->permission() sanitizing: don't pass flags to ->check_acl() 2011-07-20 01:43:21 -04:00
acl.h ->permission() sanitizing: don't pass flags to ->check_acl() 2011-07-20 01:43:21 -04:00
alloc.c ocfs2: Commit transactions in error cases -v2 2011-11-17 01:46:47 -08:00
alloc.h ocfs2: Add ocfs2_trim_fs for SSD trim support. 2011-05-23 23:37:18 -07:00
aops.c Merge branch 'mw-3.1-jul25' of git://oss.oracle.com/git/smushran/linux-2.6 into ocfs2-fixes 2011-08-21 21:02:57 -07:00
aops.h ocfs2: serialize unaligned aio 2011-07-28 02:07:16 -07:00
blockcheck.c
blockcheck.h
buffer_head_io.c
buffer_head_io.h
dcache.c
dcache.h
dir.c ocfs2: make direntry invalid when deleting it 2011-11-17 01:46:46 -08:00
dir.h
dlmglue.c ocfs2: Bugfix for hard readonly mount 2011-05-31 19:03:44 -07:00
dlmglue.h
export.c
export.h
extent_map.c ocfs2: Implement llseek() 2011-07-25 14:58:15 -07:00
extent_map.h ocfs2: Implement llseek() 2011-07-25 14:58:15 -07:00
file.c Merge branch 'mw-3.1-jul25' of git://oss.oracle.com/git/smushran/linux-2.6 into ocfs2-fixes 2011-08-21 21:02:57 -07:00
file.h ->permission() sanitizing: don't pass flags to ->permission() 2011-07-20 01:43:24 -04:00
heartbeat.c
heartbeat.h
inode.c Fix common misspellings 2011-03-31 11:26:23 -03:00
inode.h ocfs2: serialize unaligned aio 2011-07-28 02:07:16 -07:00
ioctl.c ocfs2: Commit transactions in error cases -v2 2011-11-17 01:46:47 -08:00
ioctl.h
journal.c ocfs2: Add comment about orphan scanning 2011-07-24 10:35:54 -07:00
journal.h ocfs2: Add a missing journal credit in ocfs2_link_credits() -v2 2011-11-17 01:46:48 -08:00
Kconfig
localalloc.c
localalloc.h
locks.c
locks.h
Makefile Ocfs2/move_extents: Add basic framework and source files for extent moving. 2011-05-25 15:17:08 +08:00
mmap.c ocfs2: Fix ocfs2_page_mkwrite() 2011-07-24 10:36:54 -07:00
mmap.h
move_extents.c ocfs2: checking the wrong variable in ocfs2_move_extent() 2011-05-31 19:03:44 -07:00
move_extents.h Ocfs2/move_extents: move/defrag extents within a certain range. 2011-05-25 15:17:12 +08:00
namei.c kill check_acl callback of generic_permission() 2011-07-20 01:43:16 -04:00
namei.h
ocfs1_fs_compat.h
ocfs2.h ocfs2: use proper little-endian bitops 2011-05-31 19:03:45 -07:00
ocfs2_fs.h Revert wrong fixes for common misspellings 2011-04-26 23:31:11 -07:00
ocfs2_ioctl.h Ocfs2/move_extents: Adding new ioctl code 'OCFS2_IOC_MOVE_EXT' to ocfs2. 2011-05-25 15:17:08 +08:00
ocfs2_lockid.h
ocfs2_lockingver.h
ocfs2_trace.h ocfs2: Add trace event for trim. 2011-05-23 23:37:20 -07:00
quota.h
quota_global.c Fix common misspellings 2011-03-31 11:26:23 -03:00
quota_local.c ocfs2: Clean up messages in the fs 2011-07-24 10:34:54 -07:00
refcounttree.c new helpers: kern_path_create/user_path_create 2011-07-20 01:44:05 -04:00
refcounttree.h Ocfs2/refcounttree: Publicize couple of funcs from refcounttree.c 2011-05-25 15:17:08 +08:00
reservations.c
reservations.h Fix common misspellings 2011-03-31 11:26:23 -03:00
resize.c
resize.h
slot_map.c ocfs2: Clean up messages in the fs 2011-07-24 10:34:54 -07:00
slot_map.h
stack_o2cb.c ocfs2/cluster: Cluster up now includes network connections too 2011-07-24 10:33:54 -07:00
stack_user.c
stackglue.c
stackglue.h Fix common misspellings 2011-03-31 11:26:23 -03:00
suballoc.c Fix common misspellings 2011-03-31 11:26:23 -03:00
suballoc.h
super.c ocfs2: send correct UUID to cleancache initialization 2011-11-17 01:46:48 -08:00
super.h
symlink.c
symlink.h
sysfile.c
sysfile.h
uptodate.c
uptodate.h
ver.c
ver.h
xattr.c ocfs2: Commit transactions in error cases -v2 2011-11-17 01:46:47 -08:00
xattr.h