- 14 Apr, 2015 1 commit
-
-
Ryusuke Konishi authored
commit 7ef3ff2f upstream. Nilfs2 eventually hangs in a stress test with fsstress program. This issue was caused by the following deadlock over I_SYNC flag between nilfs_segctor_thread() and writeback_sb_inodes(): nilfs_segctor_thread() nilfs_segctor_thread_construct() nilfs_segctor_unlock() nilfs_dispose_list() iput() iput_final() evict() inode_wait_for_writeback() * wait for I_SYNC flag writeback_sb_inodes() * set I_SYNC flag on inode->i_state __writeback_single_inode() do_writepages() nilfs_writepages() nilfs_construct_dsync_segment() nilfs_segctor_sync() * wait for completion of segment constructor inode_sync_complete() * clear I_SYNC flag after __writeback_single_inode() completed writeback_sb_inodes() calls do_writepages() for dirty inodes after setting I_SYNC flag on inode->i_state. do_writepages() in turn calls nilfs_writepages(), which can run segment constructor and wait for its completion. On the other hand, segment constructor calls iput(), which can call evict() and wait for the I_SYNC flag on inode_wait_for_writeback(). Since segment constructor doesn't know when I_SYNC will be set, it cannot know whether iput() will block or not unless inode->i_nlink has a non-zero count. We can prevent evict() from being called in iput() by implementing sop->drop_inode(), but it's not preferable to leave inodes with i_nlink == 0 for long periods because it even defers file truncation and inode deallocation. So, this instead resolves the deadlock by calling iput() asynchronously with a workqueue for inodes with i_nlink == 0. Signed-off-by:
Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp> Cc: Al Viro <viro@zeniv.linux.org.uk> Tested-by:
Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp> Signed-off-by:
Andrew Morton <akpm@linux-foundation.org> Signed-off-by:
Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by:
Zefan Li <lizefan@huawei.com>
-
- 04 Jan, 2012 1 commit
-
-
Al Viro authored
Signed-off-by:
Al Viro <viro@zeniv.linux.org.uk>
-
- 01 Nov, 2011 1 commit
-
-
Joe Perches authored
Standardize the style for compiler based printf format verification. Standardized the location of __printf too. Done via script and a little typing. $ grep -rPl --include=*.[ch] -w "__attribute__" * | \ grep -vP "^(tools|scripts|include/linux/compiler-gcc.h)" | \ xargs perl -n -i -e 'local $/; while (<>) { s/\b__attribute__\s*\(\s*\(\s*format\s*\(\s*printf\s*,\s*(.+)\s*,\s*(.+)\s*\)\s*\)\s*\)/__printf($1, $2)/g ; print; }' [akpm@linux-foundation.org: revert arch bits] Signed-off-by:
Joe Perches <joe@perches.com> Cc: "Kirill A. Shutemov" <kirill@shutemov.name> Signed-off-by:
Andrew Morton <akpm@linux-foundation.org> Signed-off-by:
Linus Torvalds <torvalds@linux-foundation.org>
-
- 21 Jul, 2011 1 commit
-
-
Josef Bacik authored
Btrfs needs to be able to control how filemap_write_and_wait_range() is called in fsync to make it less of a painful operation, so push down taking i_mutex and the calling of filemap_write_and_wait() down into the ->fsync() handlers. Some file systems can drop taking the i_mutex altogether it seems, like ext3 and ocfs2. For correctness sake I just pushed everything down in all cases to make sure that we keep the current behavior the same for everybody, and then each individual fs maintainer can make up their mind about what to do from there. Thanks, Acked-by:
Jan Kara <jack@suse.cz> Signed-off-by:
Josef Bacik <josef@redhat.com> Signed-off-by:
Al Viro <viro@zeniv.linux.org.uk>
-
- 20 Jul, 2011 1 commit
-
-
Al Viro authored
not used by the instances anymore. Signed-off-by:
Al Viro <viro@zeniv.linux.org.uk>
-
- 27 May, 2011 1 commit
-
-
Christoph Hellwig authored
Tell the filesystem if we just updated timestamp (I_DIRTY_SYNC) or anything else, so that the filesystem can track internally if it needs to push out a transaction for fdatasync or not. This is just the prototype change with no user for it yet. I plan to push large XFS changes for the next merge window, and getting this trivial infrastructure in this window would help a lot to avoid tree interdependencies. Also remove incorrect comments that ->dirty_inode can't block. That has been changed a long time ago, and many implementations rely on it. Signed-off-by:
Christoph Hellwig <hch@lst.de> Signed-off-by:
Al Viro <viro@zeniv.linux.org.uk>
-
- 10 May, 2011 2 commits
-
-
Ryusuke Konishi authored
In the current nilfs, page cache for btree nodes and meta data files do not set a valid back pointer to the host inode in mapping->host. This will change it so that every address space in nilfs uses mapping->host to hold its host inode. Signed-off-by:
Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
-
Ryusuke Konishi authored
This adds resize ioctl which makes online resize possible. Signed-off-by:
Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
-
- 30 Mar, 2011 1 commit
-
-
Nicolas Kaiser authored
Fixes whitespace coding style issues. Signed-off-by:
Nicolas Kaiser <nikai@nikai.net> Signed-off-by:
Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
-
- 09 Mar, 2011 2 commits
-
-
Ryusuke Konishi authored
This directly uses sb->s_fs_info to keep a nilfs filesystem object and fully removes the intermediate nilfs_sb_info structure. With this change, the hierarchy of on-memory structures of nilfs will be simplified as follows: Before: super_block -> nilfs_sb_info -> the_nilfs -> cptree --+-> nilfs_root (current file system) +-> nilfs_root (snapshot A) +-> nilfs_root (snapshot B) : -> nilfs_sc_info (log writer structure) After: super_block -> the_nilfs -> cptree --+-> nilfs_root (current file system) +-> nilfs_root (snapshot A) +-> nilfs_root (snapshot B) : -> nilfs_sc_info (log writer structure) The reason why we didn't design so from the beginning is because the initial shape also differed from the above. The early hierachy was composed of "per-mount-point" super_block -> nilfs_sb_info pairs and a shared nilfs object. On the kernel 2.6.37, it was changed to the current shape in order to unify super block instances into one per device, and this cleanup became applicable as the result. Signed-off-by:
Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
-
Ryusuke Konishi authored
This replaces sbi uses with direct reference to sb instance. Signed-off-by:
Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
-
- 08 Mar, 2011 3 commits
-
-
Ryusuke Konishi authored
This records the number of used blocks per checkpoint in each checkpoint entry of cpfile. Even though userland tools can get the block count via nilfs_get_cpinfo ioctl, it was not updated by the nilfs2 kernel code. This fixes the issue and makes it available for userland tools to calculate used amount per checkpoint. Signed-off-by:
Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp> Cc: Jiro SEKIBA <jir@unicus.jp>
-
Ryusuke Konishi authored
The current FS_IOC_GETFLAGS/SETFLAGS/GETVERSION will fail if application is 32 bit and kernel is 64 bit. This issue is avoidable by adding compat_ioctl method. Signed-off-by:
Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
-
Ryusuke Konishi authored
Nilfs has few rectrictions on which flags may be set on which inodes like ext2/3/4 filesystems used to be. Specifically DIRSYNC may only be set on directories and IMMUTABLE and APPEND may not be set on links. Tighten that to disallow TOPDIR being set on non-directories and only NODUMP and NOATIME to be set on non-regular file, non-directories. This introduces a flags masking function like those of extN and uses it during inode creation. Signed-off-by:
Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
-
- 10 Jan, 2011 3 commits
-
-
Ryusuke Konishi authored
nilfs_dat_inode function was a wrapper to switch between normal dat inode and gcdat, a clone of the dat inode for garbage collection. This function got obsolete when the gcdat inode was removed, and now we can access the dat inode directly from a nilfs object. So, we will unfold the wrapper and remove it. Signed-off-by:
Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
-
Ryusuke Konishi authored
This removes argument for passing nilfs_sb_info structure from nilfs_set_file_dirty and nilfs_load_inode_block functions. We can get a pointer to the structure from inodes. [Stephen Rothwell <sfr@canb.auug.org.au>: fix conflict with commit b74c79e9 ] Signed-off-by:
Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
-
Ryusuke Konishi authored
This adds fiemap to nilfs. Two new functions, nilfs_fiemap and nilfs_find_uncommitted_extent are added. nilfs_fiemap() implements the fiemap inode operation, and nilfs_find_uncommitted_extent() helps to get a range of data blocks whose physical location has not been determined. nilfs_fiemap() collects extent information by looping through nilfs_bmap_lookup_contig and nilfs_find_uncommitted_extent routines. Signed-off-by:
Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
-
- 07 Jan, 2011 1 commit
-
-
Nick Piggin authored
Signed-off-by:
Nick Piggin <npiggin@kernel.dk>
-
- 23 Oct, 2010 9 commits
-
-
Ryusuke Konishi authored
This finally removes own inode allocator and destructor functions for metadata files. Several routines, nilfs_mdt_new(), nilfs_mdt_new_common(), nilfs_mdt_clear(), nilfs_mdt_destroy(), and nilfs_alloc_inode_common() will be gone. Signed-off-by:
Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
-
Ryusuke Konishi authored
After applied the patch that unified sb instances, root dentry of snapshots can be left in dcache even after their trees are unmounted. The orphan root dentry/inode keeps a root object, and this causes false positive of nilfs_checkpoint_is_mounted function. This resolves the issue by having nilfs_checkpoint_is_mounted test whether the root dentry is busy or not. Signed-off-by:
Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
-
Ryusuke Konishi authored
This makes use of iget5_locked to allocate or get inode for metadata files to stop using own inode allocator. Signed-off-by:
Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
-
Ryusuke Konishi authored
This applies prepared rollback function and redirect function of metadata file to DAT file, and eliminates GCDAT inode. Signed-off-by:
Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
-
Ryusuke Konishi authored
Snapshots of nilfs are read-only. After super block instances (sb) will be unified, nilfs will need to check write access by a way other than implicit test with IS_RDONLY(inode). This is because IS_RDONLY() refers to MS_RDONLY bit of inode->i_sb->s_flags and it will become inaccurate after the unification of sb. To prepare for the issue, this uses i_op->permission to deny write access to inodes in snapshots. Signed-off-by:
Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
-
Ryusuke Konishi authored
This rewrites functions using ifile so that they get ifile from nilfs_root object, and will remove sbi->s_ifile. Some functions that don't know the root object are extended to receive it from caller. Signed-off-by:
Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
-
Ryusuke Konishi authored
The previous export operations cannot handle multiple versions of a filesystem if they belong to the same sb instance. This adds a new type of file handle and extends export operations so that they can get the inode specified by a checkpoint number as well as an inode number and a generation number. Signed-off-by:
Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
-
Ryusuke Konishi authored
This puts a pointer to nilfs_root object in the private part of on-memory inode, and makes nilfs_iget function pick up the inode with the same root object. Non-root inodes inherit its nilfs_root object from parent inode. That of the root inode is allocated through nilfs_attach_checkpoint() function. Signed-off-by:
Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
-
Ryusuke Konishi authored
This uses inode hash function that vfs provides instead of the own hash table for caching gc inodes. This finally removes the own inode hash from nilfs. Signed-off-by:
Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
-
- 09 Aug, 2010 1 commit
-
-
Al Viro authored
[folded build fix from sfr] Signed-off-by:
Al Viro <viro@zeniv.linux.org.uk>
-
- 23 Jul, 2010 6 commits
-
-
Ryusuke Konishi authored
This forces nilfs to check compatibility of feature flags so as to reject a filesystem with unknown features when it mounts or remounts the filesystem. Signed-off-by:
Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
-
Ryusuke Konishi authored
This removes nilfs_bmap_union and finally unifies three structures and the union in bmap/btree code into one. Signed-off-by:
Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
-
Jiro SEKIBA authored
This will sync super blocks in turns instead of syncing duplicate super blocks at the time. This will help searching valid super root when super block is written into disk before log is written, which is happen when barrier-less block devices are unmounted uncleanly. In the situation, old super block likely points to valid log. This patch introduces ns_sbwcount member to the nilfs object and adds nilfs_sb_will_flip() function; ns_sbwcount counts how many times super blocks write back to the disk. And, nilfs_sb_will_flip() decides whether flipping required or not based on the count of ns_sbwcount to sync super blocks asymmetrically. The following functions are also changed: - nilfs_prepare_super(): flips super blocks according to the argument. The argument is calculated by nilfs_sb_will_flip() function. - nilfs_cleanup_super(): sets "clean" flag to both super blocks if they point to the same checkpoint. To update both of super block information, caller of nilfs_commit_super must set the information on both super blocks. Signed-off-by:
Jiro SEKIBA <jir@unicus.jp> Signed-off-by:
Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
-
Jiro SEKIBA authored
This function checks validity of super block pointers. If first super block is invalid, it will swap the super blocks. The function should be called before any super block information updates. Caller must obtain nilfs->ns_sem. Signed-off-by:
Jiro SEKIBA <jir@unicus.jp> Signed-off-by:
Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
-
Ryusuke Konishi authored
This moves out section that updates information of the recent log position stored in super blocks from nilfs_commit_super to a new routine named nilfs_set_log_cursor. Signed-off-by:
Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
-
Ryusuke Konishi authored
This function write out filesystem state to super blocks in order to share the same cleanup work. This is a preparation for making super block writeback alternately. Cc: Jiro SEKIBA <jir@unicus.jp> Signed-off-by:
Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
-
- 28 May, 2010 1 commit
-
-
Christoph Hellwig authored
Signed-off-by:
Christoph Hellwig <hch@lst.de> Signed-off-by:
Al Viro <viro@zeniv.linux.org.uk>
-
- 03 Mar, 2010 1 commit
-
-
Al Viro authored
... especially when it only needs (and initializes) .d_name of it Signed-off-by:
Al Viro <viro@zeniv.linux.org.uk>
-
- 01 Oct, 2009 1 commit
-
-
Alexey Dobriyan authored
[akpm@linux-foundation.org: fix KVM] Signed-off-by:
Alexey Dobriyan <adobriyan@gmail.com> Acked-by:
Mike Frysinger <vapier@gentoo.org> Signed-off-by:
Andrew Morton <akpm@linux-foundation.org> Signed-off-by:
Linus Torvalds <torvalds@linux-foundation.org>
-
- 22 Sep, 2009 2 commits
-
-
Alexey Dobriyan authored
Signed-off-by:
Alexey Dobriyan <adobriyan@gmail.com> Signed-off-by:
Andrew Morton <akpm@linux-foundation.org> Signed-off-by:
Linus Torvalds <torvalds@linux-foundation.org>
-
Alexey Dobriyan authored
Signed-off-by:
Alexey Dobriyan <adobriyan@gmail.com> Signed-off-by:
Andrew Morton <akpm@linux-foundation.org> Signed-off-by:
Linus Torvalds <torvalds@linux-foundation.org>
-
- 24 Jun, 2009 1 commit
-
-
Al Viro authored
Actually, get rid of private analog, since nothing in there is using ACLs at all so far. Signed-off-by:
Al Viro <viro@zeniv.linux.org.uk>
-