10 May, 2011

1 commit


23 Oct, 2010

2 commits


25 Dec, 2009

1 commit


20 Nov, 2009

2 commits


13 Nov, 2009

1 commit

  • Will fix the following lock order reversal lockdep detected:

    =======================================================
    [ INFO: possible circular locking dependency detected ]
    2.6.32-rc6 #7
    -------------------------------------------------------
    chcp/30157 is trying to acquire lock:
    (&nilfs->ns_mount_mutex){+.+.+.}, at: [] nilfs_cpfile_change_cpmode+0x46/0x752 [nilfs2]

    but task is already holding lock:
    (&nilfs->ns_segctor_sem){++++.+}, at: [] nilfs_transaction_begin+0xba/0x110 [nilfs2]

    which lock already depends on the new lock.

    the existing dependency chain (in reverse order) is:

    -> #2 (&nilfs->ns_segctor_sem){++++.+}:
    [] __lock_acquire+0x109c/0x139d
    [] lock_acquire+0x89/0xa0
    [] down_read+0x31/0x45
    [] nilfs_attach_checkpoint+0x8f/0x16b [nilfs2]
    [] nilfs_get_sb+0x3e7/0x653 [nilfs2]
    [] vfs_kern_mount+0x8b/0x124
    [] do_kern_mount+0x37/0xc3
    [] do_mount+0x64d/0x69d
    [] sys_mount+0x66/0x95
    [] sysenter_do_call+0x12/0x32

    -> #1 (&type->s_umount_key#31/1){+.+.+.}:
    [] __lock_acquire+0x109c/0x139d
    [] lock_acquire+0x89/0xa0
    [] down_write_nested+0x34/0x52
    [] sget+0x22e/0x389
    [] nilfs_get_sb+0x187/0x653 [nilfs2]
    [] vfs_kern_mount+0x8b/0x124
    [] do_kern_mount+0x37/0xc3
    [] do_mount+0x64d/0x69d
    [] sys_mount+0x66/0x95
    [] sysenter_do_call+0x12/0x32

    -> #0 (&nilfs->ns_mount_mutex){+.+.+.}:
    [] __lock_acquire+0xe27/0x139d
    [] lock_acquire+0x89/0xa0
    [] mutex_lock_nested+0x41/0x23e
    [] nilfs_cpfile_change_cpmode+0x46/0x752 [nilfs2]
    [] nilfs_ioctl+0x11a/0x7da [nilfs2]
    [] vfs_ioctl+0x27/0x6e
    [] do_vfs_ioctl+0x491/0x4db
    [] sys_ioctl+0x45/0x5f
    [] sysenter_do_call+0x12/0x32

    Signed-off-by: Ryusuke Konishi

    Ryusuke Konishi
     

14 Sep, 2009

1 commit


05 Jul, 2009

1 commit

  • 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

    Jiro SEKIBA
     

16 Jun, 2009

1 commit

  • * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ryusuke/nilfs2: (22 commits)
    nilfs2: support contiguous lookup of blocks
    nilfs2: add sync_page method to page caches of meta data
    nilfs2: use device's backing_dev_info for btree node caches
    nilfs2: return EBUSY against delete request on snapshot
    nilfs2: modify list of unsupported features in caveats
    nilfs2: enable sync_page method
    nilfs2: set bio unplug flag for the last bio in segment
    nilfs2: allow future expansion of metadata read out via get info ioctl
    NILFS2: Pagecache usage optimization on NILFS2
    nilfs2: remove nilfs_btree_operations from btree mapping
    nilfs2: remove nilfs_direct_operations from direct mapping
    nilfs2: remove bmap pointer operations
    nilfs2: remove useless b_low and b_high fields from nilfs_bmap struct
    nilfs2: remove pointless NULL check of bpop_commit_alloc_ptr function
    nilfs2: move get block functions in bmap.c into btree codes
    nilfs2: remove nilfs_bmap_delete_block
    nilfs2: remove nilfs_bmap_put_block
    nilfs2: remove header file for segment list operations
    nilfs2: eliminate removal list of segments
    nilfs2: add sufile function that can modify multiple segment usages
    ...

    Linus Torvalds
     

12 Jun, 2009

1 commit

  • This will remove every bd_mount_sem use in nilfs.

    The intended exclusion control was replaced by the previous patch
    ("nilfs2: correct exclusion control in nilfs_remount function") for
    nilfs_remount(), and this patch will replace remains with a new mutex
    that this inserts in nilfs object.

    Signed-off-by: Ryusuke Konishi
    Cc: Christoph Hellwig
    Signed-off-by: Al Viro

    Ryusuke Konishi
     

10 Jun, 2009

2 commits

  • This helps userland programs like the rmcp command to distinguish
    error codes returned against a checkpoint removal request.

    Previously -EPERM was returned, and not discriminable from real
    permission errors. This also allows removal of the latest checkpoint
    because the deletion leads to create a new checkpoint, and thus it's
    harmless for the filesystem.

    Signed-off-by: Ryusuke Konishi

    Ryusuke Konishi
     
  • Nilfs has some ioctl commands to read out metadata from meta data
    files:

    - NILFS_IOCTL_GET_CPINFO for checkpoint file,
    - NILFS_IOCTL_GET_SUINFO for segment usage file, and
    - NILFS_IOCTL_GET_VINFO for Disk Address Transalation (DAT) file,
    respectively.

    Every routine on these metadata files is implemented so that it allows
    future expansion of on-disk format. But, the above ioctl commands do
    not support expansion even though nilfs_argv structure can handle
    arbitrary size for data exchanged via ioctl.

    This allows future expansion of the following structures which give
    basic format of the "get information" ioctls:

    - struct nilfs_cpinfo
    - struct nilfs_suinfo
    - struct nilfs_vinfo

    So, this introduces forward compatility of such ioctl commands.

    In this patch, a sanity check in nilfs_ioctl_get_info() function is
    changed to accept larger data structure [1], and metadata read
    routines are rewritten so that they become compatible for larger
    structures; the routines will just ignore the remaining fields which
    the current version of nilfs doesn't know.

    [1] The ioctl function already has another upper limit (PAGE_SIZE
    against a structure, which appears in nilfs_ioctl_wrap_copy
    function), and this will not cause security problem.

    Signed-off-by: Ryusuke Konishi

    Ryusuke Konishi
     

30 May, 2009

1 commit


07 Apr, 2009

6 commits

  • Pekka Enberg advised me:
    > It would be nice if BUG(), BUG_ON(), and panic() calls would be
    > converted to proper error handling using WARN_ON() calls. The BUG()
    > call in nilfs_cpfile_delete_checkpoints(), for example, looks to be
    > triggerable from user-space via the ioctl() system call.

    This will follow the comment and keep them to a minimum.

    Acked-by: Pekka Enberg
    Signed-off-by: Ryusuke Konishi
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Ryusuke Konishi
     
  • This will fix the weird behavior of lscp command in listing continuously
    created checkpoints; the output of lscp is rewinded regularly for the
    recent nilfs. As a result of debugging, a defect was found in
    nilfs_cpfile_do_get_cpinfo() function.

    Though the function can be repeatedly called to enumerate checkpoints and
    it can skip invalid checkpoint entries, the index value was not carried
    between successive calls.

    The bug has long been present, and came to surface after applying a bugfix
    nilfs2-fix-problems-of-memory-allocation-in-ioctl.patch, which increased
    frequency of calling the function. The similar bugfix was already applied
    for ``snapshots'' by
    nilfs2-fix-gc-failure-on-volumes-keeping-numerous-snapshots.patch.

    This fixes the problem by making the index argument bidirectional on the
    function.

    Signed-off-by: Ryusuke Konishi
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Ryusuke Konishi
     
  • A few tool developers gave me requests for fixing inconvenient return
    value of nilfs_get_cpinfo() ioctl; if the requested mode is NILFS_SNAPSHOT
    and the specified start entry is not a snapshot, the ioctl unnaturally
    returns one as the number of acquired snapshot item.

    In addition, the ioctl function returns an ENOENT error for checkpoints
    within blocks deleted by garbage collection.

    These behaviors require corrections for programs which enumerate
    snapshots. This resolves the inconvenience by changing the return values
    to zero for the above cases.

    Signed-off-by: Ryusuke Konishi
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Ryusuke Konishi
     
  • This resolves the following failure of nilfs2 cleaner daemon:

    nilfs_cleanerd[20670]: cannot clean segments: No such file or directory
    nilfs_cleanerd[20670]: shutdown

    When creating thousands of snapshots, the cleaner daemon had rarely died
    as above due to an error returned from the kernel code.

    After applying the recent patch which fixed memory allocation problems in
    ioctl (Message-Id: ), the
    problem gets more frequent.

    It turned out to be a bug of nilfs_ioctl_wrap_copy function and one of its
    callback routines to read out information of snapshots; if the
    nilfs_ioctl_wrap_copy function divided a large read request into multiple
    requests, the second and later requests have failed since a restart
    position on snapshot meta data was not properly set forward.

    It's a deficiency of the callback interface that cannot pass the restart
    position among multiple requests. This patch fixes the issue by allowing
    nilfs_ioctl_wrap_copy and snapshot read functions to exchange a position
    argument.

    Signed-off-by: Ryusuke Konishi
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Ryusuke Konishi
     
  • This adds a meta data file which stores the allocation state of segments.

    [konishi.ryusuke@lab.ntt.co.jp: fix wrong counting of checkpoints and dirty segments]
    Signed-off-by: Koji Sato
    Signed-off-by: Ryusuke Konishi
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Koji Sato
     
  • This adds a meta data file which holds checkpoint entries in its data
    blocks.

    Signed-off-by: Koji Sato
    Signed-off-by: Ryusuke Konishi
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Koji Sato