adds missed lock_kernel/unlock_kernel to reiserfs_dir_fsync().

adds missed lock_kernel/unlock_kernel to reiserfs_dir_fsync().

Post by Alexander Zarochentce » Sun, 04 Mar 2001 02:00:07

Hi !

Bug found in reiserfs in linux-2.4.2: reiserfs_dir_fsync has no
lock_kernel/unlock_kernel calls which are required by reiserfs journal
interface functions.  It causes reserfs_panic in any attempt to fsync a
directory (on SMP machines).

Bug report was related to qmail which likes to
fsync a directory.

This trivial fix cures the problem:

--- linux.old/fs/reiserfs/dir.c Fri Mar  2 14:48:12 2001

   int windex ;
   struct reiserfs_transaction_handle th ;

+  lock_kernel();
   journal_begin(&th, dentry->d_inode->i_sb, 1) ;
   windex = push_journal_writer("dir_fsync") ;
   reiserfs_prepare_for_journal(th.t_super, SB_BUFFER_WITH_SB(th.t_super), 1) ;
   journal_mark_dirty(&th, dentry->d_inode->i_sb, SB_BUFFER_WITH_SB (dentry->d_inode->i_sb)) ;
   pop_journal_writer(windex) ;
   journal_end_sync(&th, dentry->d_inode->i_sb, 1) ;
+  unlock_kernel();

   return ret ;


To unsubscribe from this list: send the line "unsubscribe linux-kernel" in

More majordomo info at
Please read the FAQ at


1. What does lock_kernel and unlock_kernel actualy makes ?

 Is it performs a full stop of kernel (except some life-parts of course) ?
What parts are still working ? What can I do (call, implement) and what I
can't between lock and unlock ?
By the way I want to prevent process memory access from anyone but my kernel
process, is a lock_kernel helps ?


2. How to check whether a file is open

3. kernel: down/up inside of lock_kernel/unlock_kernel?

4. IP Route issue (dual inet connections)

5. driver/sound/soundcard.c lock_kernel()/unlock_kernel()

6. Mandrake 9.0 & gpg 1.0.7 warning: unsafe ownership on file....

7. lock_kernel in 2.2.0pre4

8. Dual and Multi Booting FreeBSD, Linux, & OpenBSD

9. lock_kernel check...

10. do_exit() and lock_kernel() semantics

11. lock_kernel() usage and sync_*() functions

12. lock_kernel in 2.2.0pre4 w/o typo

13. visws: add missing mach_apic.h file (7/13)