[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20100906005028.20775.30276.stgit@localhost.localdomain>
Date: Mon, 06 Sep 2010 10:50:28 +1000
From: NeilBrown <neilb@...e.de>
To: Miklos Szeredi <miklos@...redi.hu>
Cc: linux-fsdevel@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: [PATCH 03/10] ovl: use correct seek function for directories.
It is incorrect to call generic_llseek_file on a file from a different
filesystem. For that we must use the seek function that the
filesystem defines, which is called by vfs_llseek.
Also, we only want to seek the realfile when is_real is true.
Otherwise we just want to update our own f_pos pointer, so use
generic_llseek_file for that.
Signed-off-by: NeilBrown <neilb@...e.de>
---
fs/overlayfs/overlayfs.c | 7 +++++--
1 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/fs/overlayfs/overlayfs.c b/fs/overlayfs/overlayfs.c
index 4e032e8..306de45 100644
--- a/fs/overlayfs/overlayfs.c
+++ b/fs/overlayfs/overlayfs.c
@@ -307,8 +307,11 @@ static loff_t ovl_dir_llseek(struct file *file, loff_t offset, int origin)
loff_t res;
struct ovl_dir_file *od = file->private_data;
- res = generic_file_llseek(od->realfile, offset, origin);
- file->f_pos = od->realfile->f_pos;
+ if (od->is_real) {
+ res = vfs_llseek(od->realfile, offset, origin);
+ file->f_pos = od->realfile->f_pos;
+ } else
+ res = generic_file_llseek(file, offset, origin);
return res;
}
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists