summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2010-08-09switch hpfs to ->evict_inode()Al Viro3-7/+9
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2010-08-09switch hppfs to ->evict_inode()Al Viro1-4/+3
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2010-08-09try to get rid of races in hostfs open()Al Viro3-12/+37
In case of mode mismatch, do *not* blindly close the descriptor another openers might be using right now. Open the underlying file with currently sufficient mode, then * if current mode has grown so that it's sufficient for us now, just close our new fd * if current mode has grown and our fd is *not* enough to cover it, close and repeat. * otherwise, install our fd if the file hadn't been opened at all or dup2() our fd over the current one (and close our fd). Critical section is protected by mutex; yes, system-wide. All we do under it is a bunch of comparison and maybe an overwriting dup2() on host. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2010-08-09leak in hostfs_unlink()Al Viro1-2/+3
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2010-08-09hostfs: fix races in dentry_name() and inode_name()Al Viro1-46/+60
calculating size, then doing allocation, then filling the path is a Bad Idea(tm), since the ancestors can be renamed, leading to buffer overrun. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2010-08-09new helper: __dentry_path()Al Viro2-5/+23
builds path relative to fs root, called under dcache_lock, doesn't append any nonsense to unlinked ones. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2010-08-09hostfs: sanitize symlinksAl Viro1-26/+35
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2010-08-09hostfs: get rid of inode_dentry_name()Al Viro1-35/+20
it's equivalent to dentry_name() anyway Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2010-08-09hostfs: get rid of file_type(), fold init_inode()Al Viro3-93/+45
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2010-08-09switch stat_file() to passing a single struct rather than fsckloads of pointersAl Viro3-68/+58
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2010-08-09hostfs: pass pathname to init_inode()Al Viro1-30/+15
We will calculate it in all callers anyway, so there's no need to duplicate that inside. Moreover, that way we lose all failure exits in init_inode(), so it doesn't need to return anything. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2010-08-09get rid of hostfs_read_inode()Al Viro1-53/+16
There are only two call sites; in one (hostfs_iget()) it's actually a no-op and in another (fill_super()) it's easier to expand the damn thing and use what we know about its arguments to simplify it. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2010-08-09hostfs: don't keep a field in each inode when we are using it only in rootAl Viro1-24/+15
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2010-08-09stop icache pollution in hostfs, switch to ->evict_inode()Al Viro1-22/+8
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2010-08-09switch affs to ->evict_inode()Al Viro3-17/+14
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2010-08-09switch omfs to ->evict_inode()Al Viro1-3/+6
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2010-08-09switch bfs to ->evict_inode(), clean upAl Viro1-38/+32
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2010-08-09convert ext3 to ->evict_inode()Al Viro4-36/+29
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2010-08-09spufs conversion to ->evict_inode()Al Viro1-5/+3
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2010-08-09switch ufs to ->evict_inode()Al Viro4-21/+28
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2010-08-09covert fatfs to ->evict_inode()Al Viro1-11/+9
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2010-08-09switch smbfs to evict_inode()Al Viro1-4/+4
NB: treatment of inode hash is completely braindead there Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2010-08-09switch sysv to ->evict_inode()Al Viro2-6/+10
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2010-08-09switch shmem.c to ->evice_inode()Al Viro1-4/+4
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2010-08-09switch mqueue to ->evict_inode()Al Viro1-9/+7
... and since the inodes are never hashed, we can use default ->drop_inode() just fine. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2010-08-09merge ext2 delete_inode and clear_inode, switch to ->evict_inode()Al Viro4-37/+36
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2010-08-09Don't dirty the victim in ext2_xattr_delete_inode()Al Viro1-2/+0
... it's beyond fs-writeback reach already - writeback won't be started at that point. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2010-08-09Take dirtying the inode to callers of ext2_free_blocks()Al Viro3-3/+7
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2010-08-09ext2: switch to dquot_free_block_nodirty()Al Viro2-8/+16
brute-force conversion Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2010-08-09switch minix to ->evict_inode(), fix write_inode/delete_inode raceAl Viro2-9/+12
We need to wait for completion of possible writeback in progress before we clear on-disk inode during deletion. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2010-08-09switch sysfs to ->evict_inode()Al Viro3-5/+5
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2010-08-09switch procfs to ->evict_inode()Al Viro1-3/+3
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2010-08-09simplify get_cramfs_inode()Al Viro1-50/+38
simply don't hash the inodes that don't have real inumber instead of skipping them during iget5_locked(); as the result, simple iget_locked() would do and we can get rid of cramfs ->drop_inode() as well. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2010-08-09switch hypfs to ->evict_inode()Al Viro1-3/+3
... and since we never hash its inodes, default ->drop_inode() will work just fine. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2010-08-09new helper: end_writeback()Al Viro3-1/+14
Essentially, the minimal variant of ->evict_inode(). It's a trimmed-down clear_inode(), sans any fs callbacks. Once it returns we know that no async writeback will be happening; every ->evict_inode() instance should do that once and do that before doing anything ->write_inode() could interfere with (e.g. freeing the on-disk inode). Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2010-08-09Take ->i_bdev/->i_cdev handling out of clear_inode()Al Viro1-4/+4
All call chains to clear_inode() pass through evict_inode() and clear_inode() should be called by evict_inode() exactly once. So we can pull i_bdev/i_cdev detaching up to evict_inode() itself. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2010-08-09generic_detach_inode() can be static nowAl Viro2-3/+1
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2010-08-09switch hugetlbfs to ->evict_inode()Al Viro1-20/+2
The first spoils - hugetlb can use default ->drop_inode() now. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2010-08-09New method - evict_inode()Al Viro2-1/+4
Hybrid of ->clear_inode() and ->delete_inode(); if present, does all fs work to be done when in-core inode is about to be gone, for whatever reason. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2010-08-09unify fs/inode.c callers of clear_inode()Al Viro1-19/+17
For now, just a straightforward merge Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2010-08-09simplify checks for I_CLEAR/I_FREEINGAl Viro11-28/+27
add I_CLEAR instead of replacing I_FREEING with it. I_CLEAR is equivalent to I_FREEING for almost all code looking at either; it's there to keep track of having called clear_inode() exactly once per inode lifetime, at some point after having set I_FREEING. I_CLEAR and I_FREEING never get set at the same time with the current code, so we can switch to setting i_flags to I_FREEING | I_CLEAR instead of I_CLEAR without loss of information. As the result of such change, checks become simpler and the amount of code that needs to know about I_CLEAR shrinks a lot. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2010-08-09get rid of file_fsync()Al Viro6-29/+53
Copy and simplify in the only two users remaining. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2010-08-09xfs: new truncate sequenceChristoph Hellwig4-42/+56
Convert XFS to the new truncate sequence. We still can have errors after updating the file size in xfs_setattr, but these are real I/O errors and lead to a transaction abort and filesystem shutdown, so they are not an issue. Errors from ->write_begin and write_end can now be handled correctly because we can actually get rid of the delalloc extents while previous the buffer state was stipped in block_invalidatepage. There is still no error handling for ->direct_IO, because doing so will need some major restructuring given that we only have the iolock shared and do not hold i_mutex at all. Fortunately leaving the normally allocated blocks behind there is not a major issue and this will get cleaned up by xfs_free_eofblock later. Note: the patch is against Al's vfs.git tree as that contains the nessecary preparations. I'd prefer to get it applied there so that we can get some testing in linux-next. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2010-08-09exofs: New truncate sequenceBoaz Harrosh3-75/+42
These changes are crafted based on the similar conversion done to ext2 by Nick Piggin. * Remove the deprecated ->truncate vector. Let exofs_setattr take care of on-disk size updates. * Call truncate_pagecache on the unused pages if write_begin/end fails. * Cleanup exofs_delete_inode that did stupid inode writes and updates on an inode that will be removed. * And finally get rid of exofs_get_block. We never had any blocks it was all for calling nobh_truncate_page. nobh_truncate_page is not actually needed in exofs since the last page is complete and gone, just like all the other pages. There is no partial blocks in exofs. I've tested with this patch, and there are no apparent failures, so far. CC: Nick Piggin <npiggin@suse.de> CC: Christoph Hellwig <hch@lst.de> Signed-off-by: Boaz Harrosh <bharrosh@panasas.com> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2010-08-09jffs2: don't open-code iget_failed()Al Viro1-12/+4
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2010-08-09update documentation for the new truncate sequenceChristoph Hellwig1-0/+18
Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2010-08-09check ATTR_SIZE contraints in inode_change_okChristoph Hellwig21-156/+108
Make sure we check the truncate constraints early on in ->setattr by adding those checks to inode_change_ok. Also clean up and document inode_change_ok to make this obvious. As a fallout we don't have to call inode_newsize_ok from simple_setsize and simplify it down to a truncate_setsize which doesn't return an error. This simplifies a lot of setattr implementations and means we use truncate_setsize almost everywhere. Get rid of fat_setsize now that it's trivial and mark ext2_setsize static to make the calling convention obvious. Keep the inode_newsize_ok in vmtruncate for now as all callers need an audit for its removal anyway. Note: setattr code in ecryptfs doesn't call inode_change_ok at all and needs a deeper audit, but that is left for later. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2010-08-09always call inode_change_ok early in ->setattrChristoph Hellwig6-48/+48
Make sure we call inode_change_ok before doing any changes in ->setattr, and make sure to call it even if our fs wants to ignore normal UNIX permissions, but use the ATTR_FORCE to skip those. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2010-08-09remove inode_setattrChristoph Hellwig35-194/+416
Replace inode_setattr with opencoded variants of it in all callers. This moves the remaining call to vmtruncate into the filesystem methods where it can be replaced with the proper truncate sequence. In a few cases it was obvious that we would never end up calling vmtruncate so it was left out in the opencoded variant: spufs: explicitly checks for ATTR_SIZE earlier btrfs,hugetlbfs,logfs,dlmfs: explicitly clears ATTR_SIZE earlier ufs: contains an opencoded simple_seattr + truncate that sets the filesize just above In addition to that ncpfs called inode_setattr with handcrafted iattrs, which allowed to trim down the opencoded variant. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2010-08-09default to simple_setattrChristoph Hellwig2-11/+14
With the new truncate sequence every filesystem that wants to support file size changes on disk needs to implement its own ->setattr. So instead of calling inode_setattr which supports size changes call into a simple method that doesn't support this. simple_setattr is almost what we want except that it does not mark the inode dirty after changes. Given that marking the inode dirty is a no-op for the simple in-memory filesystems that use simple_setattr currently just add the mark_inode_dirty call. Also add a WARN_ON for the presence of a truncate method to simple_setattr to catch new instances of it during the transition period. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>