Re: [PATCH] Shift BKL into ->statfs()

Matthew Wilcox (willy@debian.org)
Wed, 3 Jul 2002 03:57:44 +0100


On Tue, Jul 02, 2002 at 06:25:47PM -0700, Paul Menage wrote:
> This patch removes BKL protection from the invocation of the
> super_operations ->statfs() method, and shifts it into the filesystems
> where necessary. Any out-of-tree filesystems may need to take the BKL in
> their statfs() methods if they were relying on it for synchronisation.

Sure, makes sense to do. For real credit though, let's see how much we
need the BKL. In ext2's statfs, we reference:

sbi->s_groups_count (not modified)
sbi->s_itb_per_group (not modified)
sbi->s_es->s_first_data_block (not modified)
sbi->s_es->s_blocks_count (not modified)
sbi->s_es->s_free_blocks_count (lock_super)
sbi->s_es->s_r_blocks_count (not modified)
sbi->s_es->s_inodes_count (not modified)
sbi->s_es->s_free_inodes_count (lock_super)
sb->s_blocksize (modified many places ... but we all know you don't do it
to a mounted fs).
sb->s_mount_opt (NOT LOCKED)

s_mount_opt doesn't actually need to be locked due to how it is
modified & used. So it _looks_ like we only need to lock_super(sb); /
unlock_super(sb); in ext2. Anyone more familiar with ext2 locking care
to comment?

I bet most other filesystems can handle lock_super / unlock_super
for themselves. See if some kerneljanitors are willing to help audit,
perhaps?

-- 
Revolutions do not require corporate support.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/