Message ID | 20180721101833.8598-1-cgxu519@gmx.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
On Sat, Jul 21, 2018 at 6:21 PM Chengguang Xu <cgxu519@gmx.com> wrote: > > Add a check to disallow opening large files on 32bit > systems if the caller didn't specify O_LARGEFILE. > > Signed-off-by: Chengguang Xu <cgxu519@gmx.com> > --- > v1->v2: > - Call common function generic_file_open() to check instead of adding > check logic inside ceph_open(). > > fs/ceph/file.c | 4 ++++ > 1 file changed, 4 insertions(+) > > diff --git a/fs/ceph/file.c b/fs/ceph/file.c > index ad0bed99b1d5..075bf9473abb 100644 > --- a/fs/ceph/file.c > +++ b/fs/ceph/file.c > @@ -349,6 +349,10 @@ int ceph_open(struct inode *inode, struct file *file) > return 0; > } > > + err = generic_file_open(inode, file); > + if (err) > + return err; Limiting file size at open time does not make sense for network filesystem. because inode->i_size can be stale, and other client can write data to position > MAX_NON_LFS Regards Yan, Zheng > + > /* filter out O_CREAT|O_EXCL; vfs did that already. yuck. */ > flags = file->f_flags & ~(O_CREAT|O_EXCL); > if (S_ISDIR(inode->i_mode)) > -- > 2.17.1 > > -- > To unsubscribe from this list: send the line "unsubscribe ceph-devel" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html -- To unsubscribe from this list: send the line "unsubscribe ceph-devel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
diff --git a/fs/ceph/file.c b/fs/ceph/file.c index ad0bed99b1d5..075bf9473abb 100644 --- a/fs/ceph/file.c +++ b/fs/ceph/file.c @@ -349,6 +349,10 @@ int ceph_open(struct inode *inode, struct file *file) return 0; } + err = generic_file_open(inode, file); + if (err) + return err; + /* filter out O_CREAT|O_EXCL; vfs did that already. yuck. */ flags = file->f_flags & ~(O_CREAT|O_EXCL); if (S_ISDIR(inode->i_mode))
Add a check to disallow opening large files on 32bit systems if the caller didn't specify O_LARGEFILE. Signed-off-by: Chengguang Xu <cgxu519@gmx.com> --- v1->v2: - Call common function generic_file_open() to check instead of adding check logic inside ceph_open(). fs/ceph/file.c | 4 ++++ 1 file changed, 4 insertions(+)