From e9923493c8fe6ec13d5423b9404885a7907657c9 Mon Sep 17 00:00:00 2001 From: Miklos Szeredi Date: Tue, 6 Jul 2004 18:37:37 +0000 Subject: [PATCH] fix large read bug --- ChangeLog | 3 +++ kernel/file.c | 6 +++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 2c92987..37ebbdc 100644 --- a/ChangeLog +++ b/ChangeLog @@ -4,6 +4,9 @@ if FORGET was received earlier than the last RELEASE (bug found with the LTP test-suite) + * Fix file corruption in case of bigread option. (bug found with + LTP) + * Minor fix in read: print debug info even if read size is zero 2004-07-04 Miklos Szeredi diff --git a/kernel/file.c b/kernel/file.c index 13c96ae..eaed13e 100644 --- a/kernel/file.c +++ b/kernel/file.c @@ -321,8 +321,12 @@ static ssize_t fuse_file_read(struct file *filp, char *buf, struct inode *inode = mapping->host; struct fuse_conn *fc = INO_FC(inode); - if(fc->flags & FUSE_LARGE_READ) + if(fc->flags & FUSE_LARGE_READ) { + /* Don't allow this to get mixed up with writes */ + down(&inode->i_sem); fuse_file_bigread(mapping, inode, *ppos, count); + up(&inode->i_sem); + } return generic_file_read(filp, buf, count, ppos); } -- 2.30.2