linux/fs
Robert Peterson 2332c4435b [GFS2] assertion failure after writing to journaled file, umount
This patch passes all my nasty tests that were causing the code to
fail under one circumstance or another.  Here is a complete summary
of all changes from today's git tree, in order of appearance:

1. There are now separate variables for metadata buffer accounting.
2. Variable sd_log_num_hdrs is no longer needed, since the header
   accounting is taken care of by the reserve/refund sequence.
3. Fixed a tiny grammatical problem in a comment.
4. Added a new function "calc_reserved" to calculate the reserved
   log space.  This isn't entirely necessary, but it has two benefits:
   First, it simplifies the gfs2_log_refund function greatly.
   Second, it allows for easier debugging because I could sprinkle the
   code with calls to this function to make sure the accounting is
   proper (by adding asserts and printks) at strategic point of the code.
5. In log_pull_tail there apparently was a kludge to fix up the
   accounting based on a "pull" parameter.  The buffer accounting is
   now done properly, so the kludge was removed.
6. File sync operations were making a call to gfs2_log_flush that
   writes another journal header.  Since that header was unplanned
   for (reserved) by the reserve/refund sequence, the free space had
   to be decremented so that when log_pull_tail gets called, the free
   space is be adjusted properly.  (Did I hear you call that a kludge?
   well, maybe, but a lot more justifiable than the one I removed).
7. In the gfs2_log_shutdown code, it optionally syncs the log by
   specifying the PULL parameter to log_write_header.  I'm not sure
   this is necessary anymore.  It just seems to me there could be
   cases where shutdown is called while there are outstanding log
   buffers.
8. In the (data)buf_lo_before_commit functions, I changed some offset
   values from being calculated on the fly to being constants.	That
   simplified some code and we might as well let the compiler do the
   calculation once rather than redoing those cycles at run time.
9. This version has my rewritten databuf_lo_add function.
   This version is much more like its predecessor, buf_lo_add, which
   makes it easier to understand.  Again, this might not be necessary,
   but it seems as if this one works as well as the previous one,
   maybe even better, so I decided to leave it in.
10. In databuf_lo_before_commit, a previous data corruption problem
   was caused by going off the end of the buffer.  The proper solution
   is to have the proper limit in place, rather than stopping earlier.
   (Thus my previous attempt to fix it is wrong).
   If you don't wrap the buffer, you're stopping too early and that
   causes more log buffer accounting problems.
11. In lops.h there are two new (previously mentioned) constants for
   figuring out the data offset for the journal buffers.
12. There are also two new functions, buf_limit and databuf_limit to
   calculate how many entries will fit in the buffer.
13. In function gfs2_meta_wipe, it needs to distinguish between pinned
   metadata buffers and journaled data buffers for proper journal buffer
   accounting.	It can't use the JDATA gfs2_inode flag because it's
   sometimes passed the "real" inode and sometimes the "metadata
   inode" and the inode flags will be random bits in a metadata
   gfs2_inode.	It needs to base its decision on which was passed in.

Signed-off-by: Bob Peterson <rpeterso@redhat.com>
Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
2007-07-09 08:23:47 +01:00
..
9p Detach sched.h from mm.h 2007-05-21 09:18:19 -07:00
adfs Remove SLAB_CTOR_CONSTRUCTOR 2007-05-17 05:23:04 -07:00
affs Detach sched.h from mm.h 2007-05-21 09:18:19 -07:00
afs afs: needs sched.h 2007-05-31 07:58:14 -07:00
autofs Replace pid_t in autofs with struct pid reference 2007-05-11 08:29:36 -07:00
autofs4 Fix some coding-style errors in autofs 2007-05-11 08:29:36 -07:00
befs Remove SLAB_CTOR_CONSTRUCTOR 2007-05-17 05:23:04 -07:00
bfs Remove SLAB_CTOR_CONSTRUCTOR 2007-05-17 05:23:04 -07:00
cifs [CIFS] CIFS should honour umask 2007-06-08 14:55:14 +00:00
coda Detach sched.h from mm.h 2007-05-21 09:18:19 -07:00
configfs Detach sched.h from mm.h 2007-05-21 09:18:19 -07:00
cramfs mm: make read_cache_page synchronous 2007-05-07 12:12:51 -07:00
debugfs remove "struct subsystem" as it is no longer needed 2007-05-02 18:57:59 -07:00
devpts devpts: add fsnotify create event 2007-05-08 11:14:59 -07:00
dlm [DLM] don't require FS flag on all nodes 2007-07-09 08:23:38 +01:00
ecryptfs zero out last page for llseek/write 2007-06-28 11:34:53 -07:00
efs Remove SLAB_CTOR_CONSTRUCTOR 2007-05-17 05:23:04 -07:00
exportfs header cleaning: don't include smp_lock.h when not used 2007-05-08 11:15:07 -07:00
ext2 ext2: fix return of uninitialised variable 2007-06-28 11:38:29 -07:00
ext3 ext3: lost brelse in ext3_read_inode() 2007-06-24 08:59:12 -07:00
ext4 ext4: lost brelse in ext4_read_inode() 2007-06-24 08:59:12 -07:00
fat Remove SLAB_CTOR_CONSTRUCTOR 2007-05-17 05:23:04 -07:00
freevxfs freevxfs: possible null pointer dereference fix 2007-05-08 11:14:59 -07:00
fuse fuse: ->fs_flags fixlet 2007-06-16 13:16:15 -07:00
gfs2 [GFS2] assertion failure after writing to journaled file, umount 2007-07-09 08:23:47 +01:00
hfs Detach sched.h from mm.h 2007-05-21 09:18:19 -07:00
hfsplus Detach sched.h from mm.h 2007-05-21 09:18:19 -07:00
hostfs uml: hostfs style fixes 2007-05-08 11:14:57 -07:00
hpfs Detach sched.h from mm.h 2007-05-21 09:18:19 -07:00
hppfs
hugetlbfs shm: fix the filename of hugetlb sysv shared memory 2007-06-16 13:16:16 -07:00
isofs Remove SLAB_CTOR_CONSTRUCTOR 2007-05-17 05:23:04 -07:00
jbd fix file specification in comments 2007-05-09 08:58:16 +02:00
jbd2 fix file specification in comments 2007-05-09 08:58:16 +02:00
jffs2 [JFFS2] Fix readinode failure when read_dnode() detects CRC failure. 2007-07-04 10:24:29 -04:00
jfs Remove SLAB_CTOR_CONSTRUCTOR 2007-05-17 05:23:04 -07:00
lockd NLM: Fix sparse warnings 2007-05-14 19:33:46 -04:00
minix Detach sched.h from mm.h 2007-05-21 09:18:19 -07:00
msdos
ncpfs Detach sched.h from mm.h 2007-05-21 09:18:19 -07:00
nfs NFS: Fix a refcount leakage in O_DIRECT 2007-05-30 16:26:01 -04:00
nfs_common
nfsd Detach sched.h from mm.h 2007-05-21 09:18:19 -07:00
nls
ntfs ntfs_init_locked_inode(): fix array indexing 2007-05-31 07:58:13 -07:00
ocfs2 ocfs2: Fix invalid assertion during write on 64k pages 2007-06-06 16:42:03 -07:00
openpromfs Remove SLAB_CTOR_CONSTRUCTOR 2007-05-17 05:23:04 -07:00
partitions partitions/LDM: build fix 2007-05-21 21:38:17 -07:00
proc Remove SLAB_CTOR_CONSTRUCTOR 2007-05-17 05:23:04 -07:00
qnx4 Remove SLAB_CTOR_CONSTRUCTOR 2007-05-17 05:23:04 -07:00
ramfs RAMFS NOMMU: missed POSIX UID/GID inode attribute checking 2007-06-07 17:11:13 -07:00
reiserfs Missing 'const' from reiserfs MIN_KEY declaration. 2007-05-23 20:14:13 -07:00
romfs Remove SLAB_CTOR_CONSTRUCTOR 2007-05-17 05:23:04 -07:00
smbfs Detach sched.h from mm.h 2007-05-21 09:18:19 -07:00
sysfs sysfs: fix race condition around sd->s_dentry, take#2 2007-06-12 16:08:47 -07:00
sysv Remove SLAB_CTOR_CONSTRUCTOR 2007-05-17 05:23:04 -07:00
udf udf: fix possible leakage of blocks 2007-06-16 13:16:16 -07:00
ufs Remove SLAB_CTOR_CONSTRUCTOR 2007-05-17 05:23:04 -07:00
vfat
xfs [XFS] s/memclear_highpage_flush/zero_user_page/ 2007-06-19 15:20:31 +10:00
Kconfig Remove obsolete fat_cvf help text 2007-05-09 08:58:15 +02:00
Kconfig.binfmt fs: Kill sh dependency for binfmt_flat. 2007-05-21 14:34:00 +09:00
Makefile signal/timer/event: eventfd core 2007-05-11 08:29:36 -07:00
aio.c signal/timer/event: KAIO eventfd support example 2007-05-11 08:29:37 -07:00
anon_inodes.c signal/timer/event fds: anonymous inode source 2007-05-11 08:29:36 -07:00
attr.c header cleaning: don't include smp_lock.h when not used 2007-05-08 11:15:07 -07:00
bad_inode.c header cleaning: don't include smp_lock.h when not used 2007-05-08 11:15:07 -07:00
binfmt_aout.c
binfmt_elf.c Fix elf_core_dump() when writing arch specific notes (spu coredumps) 2007-07-06 10:23:43 -07:00
binfmt_elf_fdpic.c header cleaning: don't include smp_lock.h when not used 2007-05-08 11:15:07 -07:00
binfmt_em86.c header cleaning: don't include smp_lock.h when not used 2007-05-08 11:15:07 -07:00
binfmt_flat.c nommu: report correct errno in message 2007-06-08 17:23:32 -07:00
binfmt_misc.c Detach sched.h from mm.h 2007-05-21 09:18:19 -07:00
binfmt_script.c header cleaning: don't include smp_lock.h when not used 2007-05-08 11:15:07 -07:00
binfmt_som.c
bio.c KMEM_CACHE(): simplify slab cache creation 2007-05-07 12:12:55 -07:00
block_dev.c Remove SLAB_CTOR_CONSTRUCTOR 2007-05-17 05:23:04 -07:00
buffer.c Fix "fs: convert core functions to zero_user_page" 2007-05-21 09:15:32 -07:00
char_dev.c [PATCH] remove protection of LANANA-reserved majors 2007-04-04 21:12:47 -07:00
compat.c optimize compat_core_sys_select() by a using stack space for small fd sets 2007-05-23 20:14:12 -07:00
compat_ioctl.c fix compat console unimap regression 2007-05-25 17:37:46 -07:00
dcache.c header cleaning: don't include smp_lock.h when not used 2007-05-08 11:15:07 -07:00
dcookies.c
direct-io.c dio: remove bogus refcounting BUG_ON 2007-07-03 18:23:23 -07:00
dnotify.c
dquot.c circular locking dependency found in QUOTA OFF 2007-05-17 05:23:05 -07:00
drop_caches.c
eventfd.c eventfd use waitqueue lock ... 2007-05-18 13:09:34 -07:00
eventpoll.c epoll: move kfree inside ep_free 2007-05-15 08:54:00 -07:00
exec.c uselib: add missing MNT_NOEXEC check 2007-05-23 20:14:13 -07:00
fcntl.c
fifo.c Detach sched.h from mm.h 2007-05-21 09:18:19 -07:00
file.c
file_table.c header cleaning: don't include smp_lock.h when not used 2007-05-08 11:15:07 -07:00
filesystems.c add filesystem subtype support 2007-05-08 11:15:01 -07:00
fs-writeback.c
generic_acl.c
inode.c Remove SLAB_CTOR_CONSTRUCTOR 2007-05-17 05:23:04 -07:00
inotify.c Introduce a handy list_first_entry macro 2007-05-08 11:15:11 -07:00
inotify_user.c
internal.h cleanup compat ioctl handling 2007-05-08 11:15:09 -07:00
ioctl.c vanishing ioctl handler debugging 2007-06-04 13:25:10 -07:00
ioprio.c
libfs.c fs/libfs.c: >80 columns line break fix 2007-05-09 06:44:57 +02:00
locks.c Remove SLAB_CTOR_CONSTRUCTOR 2007-05-17 05:23:04 -07:00
mbcache.c
mpage.c consolidate generic_writepages and mpage_writepages 2007-05-11 08:29:35 -07:00
namei.c [PATCH] complete message queue auditing 2007-05-11 05:38:26 -04:00
namespace.c check privileges before setting mount propagation 2007-05-08 11:15:12 -07:00
nfsctl.c
no-block.c
open.c Remove suid/sgid bits on [f]truncate() 2007-05-08 20:10:00 -07:00
pipe.c VFS: delay the dentry name generation on sockets and pipes 2007-05-08 11:15:03 -07:00
pnode.c Introduce a handy list_first_entry macro 2007-05-08 11:15:11 -07:00
pnode.h
posix_acl.c
quota.c circular locking dependency found in QUOTA OFF 2007-05-17 05:23:05 -07:00
quota_v1.c
quota_v2.c
read_write.c use use SEEK_MAX to validate user lseek arguments 2007-05-08 11:14:59 -07:00
read_write.h
readdir.c ROUND_UP macro cleanup in fs/(select|compat|readdir).c 2007-05-08 11:15:09 -07:00
select.c Style fix in fs/select.c 2007-05-09 07:10:02 +02:00
seq_file.c
signalfd.c avoid spurious POLLIN returns in signalfd 2007-06-28 11:34:54 -07:00
splice.c splice: only check do_wakeup in splice_to_pipe() for a real pipe 2007-06-15 13:16:13 +02:00
stack.c
stat.c header cleaning: don't include smp_lock.h when not used 2007-05-08 11:15:07 -07:00
super.c add filesystem subtype support 2007-05-08 11:15:01 -07:00
sync.c Introduce fixed sys_sync_file_range2() syscall, implement on PowerPC and ARM 2007-06-28 11:38:30 -07:00
timerfd.c timerfd use waitqueue lock ... 2007-05-18 13:09:34 -07:00
utimes.c Fix permission checking for the new utimensat() system call 2007-07-08 12:02:55 -07:00
xattr.c [PATCH] audit inode for all xattr syscalls 2007-05-11 05:38:26 -04:00
xattr_acl.c