fuse fixes for 6.1-rc4
-----BEGIN PGP SIGNATURE----- iHUEABYKAB0WIQSQHSd0lITzzeNWNm3h3BK/laaZPAUCY2PdvgAKCRDh3BK/laaZ POCdAQDzAm/UqHlkyLXfrlcCJxkcC7nt65SBQ+OhDa6SAytYpgD9GXeuYUxZ0iU9 TJpnwMAex/GeutxLXUwjjBRNxA9CkQY= =qovn -----END PGP SIGNATURE----- Merge tag 'fuse-fixes-6.1-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/mszeredi/fuse Pull fuse fixes from Miklos Szeredi: "Fix two rarely triggered but long-standing issues" * tag 'fuse-fixes-6.1-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/mszeredi/fuse: fuse: add file_modified() to fallocate fuse: fix readdir cache race
This commit is contained in:
Коммит
7f7bac08d9
|
@ -3001,6 +3001,10 @@ static long fuse_file_fallocate(struct file *file, int mode, loff_t offset,
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
err = file_modified(file);
|
||||||
|
if (err)
|
||||||
|
goto out;
|
||||||
|
|
||||||
if (!(mode & FALLOC_FL_KEEP_SIZE))
|
if (!(mode & FALLOC_FL_KEEP_SIZE))
|
||||||
set_bit(FUSE_I_SIZE_UNSTABLE, &fi->state);
|
set_bit(FUSE_I_SIZE_UNSTABLE, &fi->state);
|
||||||
|
|
||||||
|
|
|
@ -77,8 +77,10 @@ static void fuse_add_dirent_to_cache(struct file *file,
|
||||||
goto unlock;
|
goto unlock;
|
||||||
|
|
||||||
addr = kmap_local_page(page);
|
addr = kmap_local_page(page);
|
||||||
if (!offset)
|
if (!offset) {
|
||||||
clear_page(addr);
|
clear_page(addr);
|
||||||
|
SetPageUptodate(page);
|
||||||
|
}
|
||||||
memcpy(addr + offset, dirent, reclen);
|
memcpy(addr + offset, dirent, reclen);
|
||||||
kunmap_local(addr);
|
kunmap_local(addr);
|
||||||
fi->rdc.size = (index << PAGE_SHIFT) + offset + reclen;
|
fi->rdc.size = (index << PAGE_SHIFT) + offset + reclen;
|
||||||
|
@ -516,6 +518,12 @@ retry_locked:
|
||||||
|
|
||||||
page = find_get_page_flags(file->f_mapping, index,
|
page = find_get_page_flags(file->f_mapping, index,
|
||||||
FGP_ACCESSED | FGP_LOCK);
|
FGP_ACCESSED | FGP_LOCK);
|
||||||
|
/* Page gone missing, then re-added to cache, but not initialized? */
|
||||||
|
if (page && !PageUptodate(page)) {
|
||||||
|
unlock_page(page);
|
||||||
|
put_page(page);
|
||||||
|
page = NULL;
|
||||||
|
}
|
||||||
spin_lock(&fi->rdc.lock);
|
spin_lock(&fi->rdc.lock);
|
||||||
if (!page) {
|
if (!page) {
|
||||||
/*
|
/*
|
||||||
|
|
Загрузка…
Ссылка в новой задаче