UBIFS: fix writing uncompressed files
UBIFS does not disable compression if ui->flags is non-zero, e.g. if the file has "sync" flag. This is because of the typo which is fixed by this patch. The patch also adds a couple of useful debugging prints. Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
This commit is contained in:
Родитель
f92b982680
Коммит
a9f2fc0e25
|
@ -154,6 +154,7 @@ long ubifs_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
|
||||||
case FS_IOC_GETFLAGS:
|
case FS_IOC_GETFLAGS:
|
||||||
flags = ubifs2ioctl(ubifs_inode(inode)->flags);
|
flags = ubifs2ioctl(ubifs_inode(inode)->flags);
|
||||||
|
|
||||||
|
dbg_gen("get flags: %#x, i_flags %#x", flags, inode->i_flags);
|
||||||
return put_user(flags, (int __user *) arg);
|
return put_user(flags, (int __user *) arg);
|
||||||
|
|
||||||
case FS_IOC_SETFLAGS: {
|
case FS_IOC_SETFLAGS: {
|
||||||
|
@ -176,6 +177,7 @@ long ubifs_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
|
||||||
err = mnt_want_write(file->f_path.mnt);
|
err = mnt_want_write(file->f_path.mnt);
|
||||||
if (err)
|
if (err)
|
||||||
return err;
|
return err;
|
||||||
|
dbg_gen("set flags: %#x, i_flags %#x", flags, inode->i_flags);
|
||||||
err = setflags(inode, flags);
|
err = setflags(inode, flags);
|
||||||
mnt_drop_write(file->f_path.mnt);
|
mnt_drop_write(file->f_path.mnt);
|
||||||
return err;
|
return err;
|
||||||
|
|
|
@ -704,7 +704,7 @@ int ubifs_jnl_write_data(struct ubifs_info *c, const struct inode *inode,
|
||||||
data->size = cpu_to_le32(len);
|
data->size = cpu_to_le32(len);
|
||||||
zero_data_node_unused(data);
|
zero_data_node_unused(data);
|
||||||
|
|
||||||
if (!(ui->flags && UBIFS_COMPR_FL))
|
if (!(ui->flags & UBIFS_COMPR_FL))
|
||||||
/* Compression is disabled for this inode */
|
/* Compression is disabled for this inode */
|
||||||
compr_type = UBIFS_COMPR_NONE;
|
compr_type = UBIFS_COMPR_NONE;
|
||||||
else
|
else
|
||||||
|
|
Загрузка…
Ссылка в новой задаче