ANDROID: fuse-bpf: Update attributes on file write

Bug: 221093504
Test: atest android.hardware.cts.CameraTest#testJpegExif
Signed-off-by: Paul Lawrence <paullawrence@google.com>
Change-Id: Ideb4f4d95e60594aed9000df4c21bacfaeac3a55
This commit is contained in:
Paul Lawrence
2022-02-25 23:35:30 +00:00
parent 8692c9e878
commit 67933e2f73
3 changed files with 6 additions and 1 deletions

View File

@@ -797,6 +797,10 @@ int fuse_file_write_iter_backing(struct fuse_args *fa,
/* TODO This just plain ignores any change to fuse_write_in */
fwo->size = vfs_iter_write(ff->backing_file, from, &iocb->ki_pos, 0);
/* Must reflect change in size of backing file to upper file */
if (fwo->size > 0)
fuse_copyattr(file, ff->backing_file);
if (fwo->size < 0)
return fwo->size;
return 0;

View File

@@ -1299,6 +1299,7 @@ bool fuse_dax_check_alignment(struct fuse_conn *fc, unsigned int map_alignment);
void fuse_dax_cancel_work(struct fuse_conn *fc);
/* passthrough.c */
void fuse_copyattr(struct file *dst_file, struct file *src_file);
int fuse_passthrough_open(struct fuse_dev *fud, u32 lower_fd);
int fuse_passthrough_setup(struct fuse_conn *fc, struct fuse_file *ff,
struct fuse_open_out *openarg);

View File

@@ -34,7 +34,7 @@ static void fuse_file_accessed(struct file *dst_file, struct file *src_file)
touch_atime(&dst_file->f_path);
}
static void fuse_copyattr(struct file *dst_file, struct file *src_file)
void fuse_copyattr(struct file *dst_file, struct file *src_file)
{
struct inode *dst = file_inode(dst_file);
struct inode *src = file_inode(src_file);