Skip to content

Commit

Permalink
logfs: Grow inode in delete path
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Joern Engel authored and Prasad Joshi committed Jan 28, 2012
1 parent 1bcceaf commit bbe0138
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions fs/logfs/readwrite.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down

0 comments on commit bbe0138

Please sign in to comment.