]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
logfs: Grow inode in delete path
authorJoern Engel <joern@logfs.org>
Fri, 5 Aug 2011 09:13:30 +0000 (11:13 +0200)
committerPrasad Joshi <prasadjoshi.linux@gmail.com>
Sat, 28 Jan 2012 06:13:07 +0000 (11:43 +0530)
Can be necessary if an inode gets deleted (through -ENOSPC) before being
written.  Might be better to move this into logfs_write_rec(), but for
now go with the stupid&safe patch.

Signed-off-by: Joern Engel <joern@logfs.org>
fs/logfs/readwrite.c

index 88284c67ba9787ab23b58c2f55fe0f2216475129..4153e65b01488b55d6a5646cee01689b26afc6a3 100644 (file)
@@ -1576,11 +1576,15 @@ int logfs_write_buf(struct inode *inode, struct page *page, long flags)
 static int __logfs_delete(struct inode *inode, struct page *page)
 {
        long flags = WF_DELETE;
+       int err;
 
        inode->i_ctime = inode->i_mtime = CURRENT_TIME;
 
        if (page->index < I0_BLOCKS)
                return logfs_write_direct(inode, page, flags);
+       err = grow_inode(inode, page->index, 0);
+       if (err)
+               return err;
        return logfs_write_rec(inode, page, page->index, 0, flags);
 }