提交 bf288333 编写于 作者: A Aruna Balakrishnaiah 提交者: Tony Luck

pstore: Fail to unlink if a driver has not defined pstore_erase

pstore_erase is used to erase the record from the persistent store.
So if a driver has not defined pstore_erase callback return
-EPERM instead of unlinking a file as deleting the file without
erasing its record in persistent store will give a wrong impression
to customers.
Signed-off-by: NAruna Balakrishnaiah <aruna@linux.vnet.ibm.com>
Acked-by: NKees Cook <keescook@chromium.org>
Signed-off-by: NTony Luck <tony.luck@intel.com>
上级 26446654
...@@ -178,6 +178,8 @@ static int pstore_unlink(struct inode *dir, struct dentry *dentry) ...@@ -178,6 +178,8 @@ static int pstore_unlink(struct inode *dir, struct dentry *dentry)
if (p->psi->erase) if (p->psi->erase)
p->psi->erase(p->type, p->id, p->count, p->psi->erase(p->type, p->id, p->count,
dentry->d_inode->i_ctime, p->psi); dentry->d_inode->i_ctime, p->psi);
else
return -EPERM;
return simple_unlink(dir, dentry); return simple_unlink(dir, dentry);
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册