提交 b451cec4 编写于 作者: A Al Viro

ufs: fix reserved blocks check

a) honour ->s_minfree; don't just go with default (5)
b) don't bother with capability checks until we know we'll need them
Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
上级 fffd70f5
...@@ -400,10 +400,12 @@ u64 ufs_new_fragments(struct inode *inode, void *p, u64 fragment, ...@@ -400,10 +400,12 @@ u64 ufs_new_fragments(struct inode *inode, void *p, u64 fragment,
/* /*
* There is not enough space for user on the device * There is not enough space for user on the device
*/ */
if (!capable(CAP_SYS_RESOURCE) && ufs_freespace(uspi, UFS_MINFREE) <= 0) { if (unlikely(ufs_freespace(uspi, uspi->s_minfree) <= 0)) {
mutex_unlock(&UFS_SB(sb)->s_lock); if (!capable(CAP_SYS_RESOURCE)) {
UFSD("EXIT (FAILED)\n"); mutex_unlock(&UFS_SB(sb)->s_lock);
return 0; UFSD("EXIT (FAILED)\n");
return 0;
}
} }
if (goal >= uspi->s_size) if (goal >= uspi->s_size)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册