02 Oct, 2009
1 commit
-
[akpm@linux-foundation.org: fix KVM]
Signed-off-by: Alexey Dobriyan
Acked-by: Mike Frysinger
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds
29 Sep, 2009
2 commits
-
The i_dir_start_lookup field in nilfs_inode_info objects should be
cleared when the objects are allocated, but the the initialization was
missing in case of reading from disk. This adds the initialization.Since the variable just gives a start page on directory lookups, the
bug was nonfatal until now.Signed-off-by: Ryusuke Konishi
-
This will fix file system corruption which infrequently happens after
mount. The problem was reported from users with the title "[NILFS
users] Fail to mount NILFS." (Message-ID:
), and so forth. I've also
experienced the corruption multiple times on kernel 2.6.30 and 2.6.31.The problem turned out to be caused due to discordance between
mapping->nrpages of a btree node cache and the actual number of pages
hung on the cache; if the mapping->nrpages becomes zero even as it has
pages, truncate_inode_pages() returns without doing anything. Usually
this is harmless except it may cause page leak, but garbage collection
fairly infrequently sees a stale page remained in the btree node cache
of DAT (i.e. disk address translation file of nilfs), and induces the
corruption.I identified a missing initialization in btree node caches was the
root cause. This corrects the bug.I've tested this for kernel 2.6.30 and 2.6.31.
Reported-by: Yuri Chislov
Signed-off-by: Ryusuke Konishi
Cc: stable
28 Sep, 2009
1 commit
-
* mark struct vm_area_struct::vm_ops as const
* mark vm_ops in AGP codeBut leave TTM code alone, something is fishy there with global vm_ops
being used.Signed-off-by: Alexey Dobriyan
Signed-off-by: Linus Torvalds
22 Sep, 2009
4 commits
-
Signed-off-by: Alexey Dobriyan
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds -
Signed-off-by: Alexey Dobriyan
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds -
Signed-off-by: Alexey Dobriyan
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds -
Signed-off-by: Alexey Dobriyan
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds
16 Sep, 2009
1 commit
-
It has been unused since it was introduced in:
commit 520808bf20e90fdbdb320264ba7dd5cf9d47dcac
Author: Andrew Morton
Date: Fri May 21 00:46:17 2004 -0700[PATCH] block device layer: separate backing_dev_info infrastructure
So lets just kill it.
Acked-by: Jan Kara
Signed-off-by: Jens Axboe
14 Sep, 2009
21 commits
-
Some people asked me questions like the following:
On Wed, 15 Jul 2009 13:11:21 +0200, Leon Woestenberg wrote:
> just wondering, any reasons why NILFS2 is one of the miscellaneous
> filesystems and, for example, btrfs, is not in Kconfig?Actually, nilfs is NOT a filesystem came from other operating systems,
but a filesystem created purely for Linux. Nor is it a flash
filesystem but that for generic block devices.So, this moves nilfs outside the misc category as I responded in LKML
"Re: Why does NILFS2 hide under Miscellaneous filesystems?"
(Message-Id: ).Signed-off-by: Ryusuke Konishi
-
The nilfs_bmap_lookup() is now a wrapper function of
nilfs_bmap_lookup_at_level().This moves the nilfs_bmap_lookup() to a header file converting it to
an inline function and gives an opportunity for optimization.Signed-off-by: Ryusuke Konishi
-
The current btree code is written so that btree functions call dat
operations via wrapper functions in bmap.c when they allocate, free,
or modify virtual block addresses.This abstraction requires additional function calls and causes
frequent call of nilfs_bmap_get_dat() function since it is used in the
every wrapper function.This removes the wrapper functions and makes them available from
btree.c and direct.c, which will increase the opportunity of
compiler optimization.Signed-off-by: Ryusuke Konishi
-
This is a preparation for the successive cleanup ("nilfs2: allow btree
to directly call dat operations").This adds functions bundling a few operations to change an entry of
virtual block address on the dat file.Signed-off-by: Ryusuke Konishi
-
This gets rid of NILFS_CPFILE_GFP, NILFS_SUFILE_GFP, NILFS_DAT_GFP,
and NILFS_IFILE_GFP. All of these constants refer to NILFS_MDT_GFP,
and can be removed.Signed-off-by: Ryusuke Konishi
-
The btree path object is cleared just before it is freed.
This will remove the code doing the unnecessary clear operation.
Signed-off-by: Ryusuke Konishi
-
Even though many btree functions take a btree object as their first
argument, most of them are not used in their functions.This sticky use of the btree argument is hurting code readability and
giving the possibility of inefficient code generation.So, this removes the unnecessary btree arguments.
Signed-off-by: Ryusuke Konishi
-
These functions are not called from any functions.
Signed-off-by: Ryusuke Konishi
-
This is a re-revised patch to shorten freeze period.
This version include a fix of the bug Konishi-san mentioned last time.When GC is runnning, GC moves live block to difference segments.
Copying live blocks into memory is done in a transaction,
however it is not necessarily to be in the transaction.
This patch will get the nilfs_ioctl_move_blocks() out from
transaction lock and put it before the transaction.I ran sysbench fileio test against nilfs partition.
I copied some DVD/CD images and created snapshot to create live blocks
before starting the benchmark.Followings are summary of rc8 and rc8 w/ the patch of per-request
statistics, which is min/max and avg. I ran each test three times and
bellow is average of those numers.According to this benchmark result, average time is slightly degrated.
However, worstcase (max) result is significantly improved.
This can address a few seconds write freeze.- random write per-request performance of rc8
min 0.843ms
max 680.406ms
avg 3.050ms
- random write per-request performance of rc8 w/ this patch
min 0.843ms -> 100.00%
max 380.490ms -> 55.90%
avg 3.233ms -> 106.00%- sequential write per-request performance of rc8
min 0.736ms
max 774.343ms
avg 2.883ms
- sequential write per-request performance of rc8 w/ this patch
min 0.720ms -> 97.80%
max 644.280ms-> 83.20%
avg 3.130ms -> 108.50%-----8
Signed-off-by: Ryusuke Konishi -
nilfs2: Add more safeguard routines and protections in mount process,
which also makes nilfs2 report consistency error messages when
checkpoint number is invalid.Signed-off-by: Zhu Yanhai
Signed-off-by: Ryusuke Konishi -
nilfs2: In procedure 'nilfs_get_sb()', when a nilfs filesysttem is
mounted for the first time, local variable 'nilfs->ns_last_cno' is
used before loading the latest checkpoint number from disk (in
'nilfs_fill_super'). 'nilfs->ns_last_cno' is assigned to 'sd.cno', but
'sd.cno' has never been used in the procedure.Signed-off-by: Zhang Qiang
Signed-off-by: Ryusuke Konishi -
Alberto Bertogli advised me about bio_alloc() use in nilfs:
On Sat, 13 Jun 2009 22:52:40 -0300, Alberto Bertogli wrote:
> By the way, those bio_alloc()s are using GFP_NOWAIT but it looks
> like they could use at least GFP_NOIO or GFP_NOFS, since the caller
> can (and sometimes do) sleep. The only caller is nilfs_submit_bh(),
> which calls nilfs_submit_seg_bio() which can sleep calling
> wait_for_completion().This takes in the comment and replaces the use of GFP_NOWAIT flag with
GFP_NOIO.Signed-off-by: Ryusuke Konishi
-
This removes nilfs_write_super and commit super block in nilfs
internal thread, instead of periodic write_super callback.VFS layer calls ->write_super callback periodically. However,
it looks like that calling back is ommited when disk I/O is busy.
And when cleanerd (nilfs GC) is runnig, disk I/O tend to be busy thus
nilfs superblock is not synchronized as nilfs designed.To avoid it, syncing superblock by nilfs thread instead of pdflush.
Signed-off-by: Jiro SEKIBA
Signed-off-by: Ryusuke Konishi -
Separate conditions that check if syncing super block and alternative
super block are required as inline functions to reuse the conditions.Signed-off-by: Jiro SEKIBA
Signed-off-by: Ryusuke Konishi -
This fixes disorder of nilfs_write_super in nilfs_sync_fs. Commiting
super block must be the end of the function so that every changes are
reflected.->sync_fs() is not called frequently so this makes nilfs_sync_fs call
nilfs_commit_super instead of nilfs_write_super.Signed-off-by: Jiro SEKIBA
Signed-off-by: Ryusuke Konishi -
This removes redundant super block commit.
nilfs_write_super will call nilfs_commit_super to store super block
into block device. However, nilfs_put_super will call
nilfs_commit_super right after calling nilfs_write_super. So calling
nilfs_write_super in nilfs_put_super would be redundant.Signed-off-by: Jiro SEKIBA
Signed-off-by: Ryusuke Konishi -
This is a patch to display mount options in procfs.
Mount options will show up in the /proc/mounts as other fs does....
/dev/sda6 /mnt nilfs2 ro,relatime,barrier=off,cp=3,order=strict 0 0
...Signed-off-by: Jiro SEKIBA
Signed-off-by: Ryusuke Konishi -
The current metadata file code skips disk address lookup for its data
block if the buffer has a mapped flag.This has a potential risk to cause read request to be performed
against the stale block address that GC moved, and it may lead to meta
data corruption. The mapped flag is safe if the buffer has an
uptodate flag, otherwise it may prevent necessary update of disk
address in the next read.This will avoid the potential problem by ensuring disk address lookup
before reading metadata block even for buffers with the mapped flag.Signed-off-by: Ryusuke Konishi
-
will get rid of nilfs_get_writer() and nilfs_put_writer() pair used to
retain a writable FS-instance for a period.The pair functions were making up some kind of recursive lock with a
mutex, but they became overkill since the commit
201913ed746c7724a40d33ee5a0b6a1fd2ef3193. Furthermore, they caused
the following lockdep warning because the mutex can be released by a
task which didn't lock it:=====================================
[ BUG: bad unlock balance detected! ]
-------------------------------------
kswapd0/422 is trying to release lock (&nilfs->ns_writer_mutex) at:
[] mutex_unlock+0x8/0xa
but there are no more locks to release!other info that might help us debug this:
no locks held by kswapd0/422.stack backtrace:
Pid: 422, comm: kswapd0 Not tainted 2.6.31-rc4-nilfs #51
Call Trace:
[] ? printk+0xf/0x18
[] print_unlock_inbalance_bug+0xcc/0xd7
[] ? prop_put_global+0x3/0x35
[] lock_release+0xed/0x1dc
[] ? mutex_unlock+0x8/0xa
[] __mutex_unlock_slowpath+0xaf/0x119
[] mutex_unlock+0x8/0xa
[] nilfs_mdt_write_page+0xd8/0xe1 [nilfs2]
[] shrink_page_list+0x379/0x68d
[] ? isolate_pages_global+0xb4/0x18c
[] shrink_list+0x26b/0x54b
[] shrink_zone+0x20c/0x2a2
[] kswapd+0x407/0x591
[] ? isolate_pages_global+0x0/0x18c
[] ? autoremove_wake_function+0x0/0x33
[] ? kswapd+0x0/0x591
[] kthread+0x69/0x6e
[] ? kthread+0x0/0x6e
[] kernel_thread_helper+0x7/0x1aThis patch uses a reader/writer semaphore instead of the own lock and
kills this warning.Signed-off-by: Ryusuke Konishi
-
Unlike on most other architectures ino_t is an unsigned int on s390.
So add an explicit cast to avoid this compile warning:fs/nilfs2/recovery.c: In function 'recover_dsync_blocks':
fs/nilfs2/recovery.c:555: warning: format '%lu' expects type 'long unsigned int', but argument 3 has type 'ino_t'Signed-off-by: Heiko Carstens
Signed-off-by: Ryusuke Konishi -
The __nilfs_read_inode function is ignoring the error code returned
from nilfs_read_inode_common(), and wrongly delivers a success code
(zero) when it escapes from the function in erroneous cases.This adds the missing error handling.
Signed-off-by: Ryusuke Konishi
31 Aug, 2009
1 commit
-
This will fix the following preempt count underflow reported from
users with the title "[NILFS users] segctord problem" (Message-ID:
and Message-ID:
):WARNING: at kernel/sched.c:4890 sub_preempt_count+0x95/0xa0()
Hardware name: HP Compaq 6530b (KR980UT#ABC)
Modules linked in: bridge stp llc bnep rfcomm l2cap xfs exportfs nilfs2 cowloop loop vboxnetadp vboxnetflt vboxdrv btusb bluetooth uvcvideo videodev v4l1_compat v4l2_compat_ioctl32 arc4 snd_hda_codec_analog ecb iwlagn iwlcore rfkill lib80211 mac80211 snd_hda_intel snd_hda_codec ehci_hcd uhci_hcd usbcore snd_hwdep snd_pcm tg3 cfg80211 psmouse snd_timer joydev libphy ohci1394 snd_page_alloc hp_accel lis3lv02d ieee1394 led_class i915 drm i2c_algo_bit video backlight output i2c_core dm_crypt dm_mod
Pid: 4197, comm: segctord Not tainted 2.6.30-gentoo-r4-64 #7
Call Trace:
[] ? sub_preempt_count+0x95/0xa0
[] warn_slowpath_common+0x78/0xd0
[] warn_slowpath_null+0xf/0x20
[] sub_preempt_count+0x95/0xa0
[] nilfs_btnode_prepare_change_key+0x11b/0x190 [nilfs2]
[] nilfs_btree_assign_p+0x19d/0x1e0 [nilfs2]
[] nilfs_btree_assign+0xbd/0x130 [nilfs2]
[] nilfs_bmap_assign+0x47/0x70 [nilfs2]
[] nilfs_segctor_do_construct+0x956/0x20f0 [nilfs2]
[] ? _spin_unlock_irqrestore+0x12/0x40
[] ? __up_write+0xe0/0x150
[] ? up_write+0x9/0x10
[] ? nilfs_bmap_test_and_clear_dirty+0x43/0x60 [nilfs2]
[] ? nilfs_mdt_fetch_dirty+0x27/0x60 [nilfs2]
[] nilfs_segctor_construct+0x8c/0xd0 [nilfs2]
[] nilfs_segctor_thread+0x15c/0x3a0 [nilfs2]
[] ? nilfs_construction_timeout+0x0/0x10 [nilfs2]
[] ? add_timer+0x13/0x20
[] ? __wake_up_common+0x5a/0x90
[] ? autoremove_wake_function+0x0/0x40
[] ? nilfs_segctor_thread+0x0/0x3a0 [nilfs2]
[] ? nilfs_segctor_thread+0x0/0x3a0 [nilfs2]
[] kthread+0x56/0x90
[] child_rip+0xa/0x20
[] ? kthread+0x0/0x90
[] ? child_rip+0x0/0x20This problem was caused due to a missing radix_tree_preload() call in
the retry path of nilfs_btnode_prepare_change_key() function.Reported-by: Eric A
Reported-by: Jerome Poulin
Signed-off-by: Ryusuke Konishi
Tested-by: Jerome Poulin
Cc: stable@kernel.org
19 Aug, 2009
1 commit
-
will fix kernel oopses like the following:
# mount -t nilfs2 -r -o cp=20 /dev/sdb1 /test1
# mount -t nilfs2 -r -o cp=20 /dev/sdb1 /test2
# umount /test1
# umount /test2BUG: sleeping function called from invalid context at arch/x86/mm/fault.c:1069
in_atomic(): 0, irqs_disabled(): 1, pid: 3886, name: umount.nilfs2
1 lock held by umount.nilfs2/3886:
#0: (&type->s_umount_key#31){+.+...}, at: [] deactivate_super+0x52/0x6c
irq event stamp: 1219
hardirqs last enabled at (1219): [] __mutex_unlock_slowpath+0xf8/0x119
hardirqs last disabled at (1218): [] __mutex_unlock_slowpath+0x59/0x119
softirqs last enabled at (1214): [] __do_softirq+0x1a5/0x1ad
softirqs last disabled at (1205): [] do_softirq+0x36/0x5a
Pid: 3886, comm: umount.nilfs2 Not tainted 2.6.31-rc6 #55
Call Trace:
[] __might_sleep+0x107/0x10e
[] do_page_fault+0x246/0x397
[] ? do_page_fault+0x0/0x397
[] error_code+0x6b/0x70
[] ? do_page_fault+0x0/0x397
[] ? __lock_acquire+0x91/0x12fd
[] ? __lock_acquire+0x12ee/0x12fd
[] ? __lock_acquire+0x12ee/0x12fd
[] lock_acquire+0xba/0xdd
[] ? nilfs_detach_segment_constructor+0x2f/0x2fa [nilfs2]
[] down_write+0x2a/0x46
[] ? nilfs_detach_segment_constructor+0x2f/0x2fa [nilfs2]
[] nilfs_detach_segment_constructor+0x2f/0x2fa [nilfs2]
[] ? mark_held_locks+0x43/0x5b
[] ? trace_hardirqs_on_caller+0x10b/0x133
[] ? trace_hardirqs_on+0xb/0xd
[] nilfs_put_super+0x2f/0xca [nilfs2]
[] generic_shutdown_super+0x49/0xb8
[] kill_block_super+0x1d/0x31
[] ? vfs_quota_off+0x0/0x12
[] deactivate_super+0x57/0x6c
[] mntput_no_expire+0x8c/0xb4
[] sys_umount+0x27f/0x2a4
[] sys_oldumount+0xd/0xf
[] sysenter_do_call+0x12/0x38
...This turns out to be a bug brought by an -rc1 patch ("nilfs2: simplify
remaining sget() use").In the patch, a new "put resource" function, nilfs_put_sbinfo()
was introduced to delay freeing nilfs_sb_info struct.But the nilfs_put_sbinfo() mistakenly used atomic_dec_and_test()
function to check the reference count, and it caused the nilfs_sb_info
was freed when user mounted a snapshot twice.This bug also suggests there was unseen memory leak in usual mount
/umount operations for nilfs.Signed-off-by: Ryusuke Konishi
18 Aug, 2009
1 commit
-
'ns_cno' of structure 'the_nilfs' must be protected from segment
writer, in other words, the caller of nilfs_get_checkpoint should hold
read lock for nilfs->ns_segctor_sem. This patch adds the lock/unlock
operations in nilfs_attach_checkpoint() when calling
nilfs_cpfile_get_checkpoint().Signed-off-by: Zhang Qiang
Signed-off-by: Ryusuke Konishi
02 Aug, 2009
1 commit
-
This adds a missing unlock of nilfs->ns_writer_mutex in
nilfs_mdt_write_page() function.Signed-off-by: Ryusuke Konishi
01 Aug, 2009
1 commit
-
Andrea Gelmini gave me a report that a kernel oops hit on a nilfs
filesystem with a 1KB block size when doing rsync.This turned out to be caused by an inconsistency of dirty state
between a page and its buffers storing b-tree node blocks.If the page had multiple buffers split over multiple logs, and if the
logs were written at a time, a dirty flag remained in the page even
every dirty flag in the buffers was cleared.This will fix the failure by dropping the dirty flag properly for
pages with the discrete multiple b-tree nodes.Reported-by: Andrea Gelmini
Signed-off-by: Ryusuke Konishi
Tested-by: Andrea Gelmini
Cc: stable@kernel.org
14 Jul, 2009
1 commit
-
fs/Kconfig file was split into individual fs/*/Kconfig files before
nilfs was merged. I've found the current config entry of nilfs is
tainting the work. Sorry, I didn't notice. This fixes the violation.Signed-off-by: Ryusuke Konishi
Cc: Alexey Dobriyan
13 Jul, 2009
1 commit
-
* Remove smp_lock.h from files which don't need it (including some headers!)
* Add smp_lock.h to files which do need it
* Make smp_lock.h include conditional in hardirq.h
It's needed only for one kernel_locked() usage which is under CONFIG_PREEMPTThis will make hardirq.h inclusion cheaper for every PREEMPT=n config
(which includes allmodconfig/allyesconfig, BTW)Signed-off-by: Alexey Dobriyan
Signed-off-by: Linus Torvalds
05 Jul, 2009
3 commits
-
This fixes a bug that checkpoint count gets wrong on errors when
deleting a series of checkpoints.The count error is persistent since the checkpoint count is stored on
disk. Some userland programs refer to the count via ioctl, and this
bugfix is needed to prevent malfunction of such programs.Signed-off-by: Jiro SEKIBA
Signed-off-by: Ryusuke Konishi
Cc: stable@kernel.org -
This will fix the following false positive of recursive locking which
lockdep has detected:=============================================
[ INFO: possible recursive locking detected ]
2.6.30-nilfs #42
---------------------------------------------
nilfs_cleanerd/10607 is trying to acquire lock:
(&bmap->b_sem){++++-.}, at: [] nilfs_bmap_lookup_at_level+0x1a/0x74 [nilfs2]but task is already holding lock:
(&bmap->b_sem){++++-.}, at: [] nilfs_bmap_truncate+0x19/0x6a [nilfs2]
other info that might help us debug this:
2 locks held by nilfs_cleanerd/10607:
#0: (&nilfs->ns_segctor_sem){++++.+}, at: [] nilfs_transaction_begin+0xb6/0x10c [nilfs2]
#1: (&bmap->b_sem){++++-.}, at: [] nilfs_bmap_truncate+0x19/0x6a [nilfs2]Signed-off-by: Ryusuke Konishi
-
In case of write-failure retries, the following KERN_CRIT level
messages are mistakenly output by nilfs_dat_commit_start() function:nilfs_dat_commit_start: vbn = 408463, start = 12506, end = 18446744073709551615, pbn = 530210
nilfs_dat_commit_start: vbn = 408515, start = 12506, end = 18446744073709551615, pbn = 530211
nilfs_dat_commit_start: vbn = 408464, start = 12506, end = 18446744073709551615, pbn = 530212
...This suppresses these messages.
Signed-off-by: Ryusuke Konishi
Cc: stable@kernel.org