logfs: Grow inode in delete path
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>
This commit is contained in:
parent
1bcceaff8c
commit
bbe0138712
|
@ -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)
|
static int __logfs_delete(struct inode *inode, struct page *page)
|
||||||
{
|
{
|
||||||
long flags = WF_DELETE;
|
long flags = WF_DELETE;
|
||||||
|
int err;
|
||||||
|
|
||||||
inode->i_ctime = inode->i_mtime = CURRENT_TIME;
|
inode->i_ctime = inode->i_mtime = CURRENT_TIME;
|
||||||
|
|
||||||
if (page->index < I0_BLOCKS)
|
if (page->index < I0_BLOCKS)
|
||||||
return logfs_write_direct(inode, page, flags);
|
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);
|
return logfs_write_rec(inode, page, page->index, 0, flags);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue