public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Heinrich Schuchardt <xypron.glpk@gmx.de>
To: Justin Maggard <jmaggard10@gmail.com>
Cc: linux-kernel@vger.kernel.org, eparis@redhat.com,
	LinoSanfilippo@gmx.de, tzvetanc@commtouch.com
Subject: Re: fanotify: fix support of large files
Date: Sat, 13 Apr 2013 13:54:37 +0200	[thread overview]
Message-ID: <5169477D.1000400@gmx.de> (raw)
In-Reply-To: <1360862966-6376-1-git-send-email-jmaggard10@gmail.com>

Dear Justin,

looking at the example at
http://www.lanedo.com/~aleksander/fanotify/fanotify-example.c
the large file support is enabled by passing O_LARGEFILE to fanotify_init:

   if ((fanotify_fd = fanotify_init (FAN_CLOEXEC,
                                     O_RDONLY | O_CLOEXEC | 
O_LARGEFILE)) < 0)

Could you, please, check if this solves your issue.

(I am resending this message because HTML was rejected by
linux-kernel@vger.kernel.org).

Best regards

Heinrich Schuchardt

On 14.02.2013 18:29, Justin Maggard wrote:
> Opening a file of>2GB in an area of the filesystem that has been marked for
> fanotify events currently results in an EOVERFLOW error.  This is particularly
> problematic if you are using fanotify permissions checking, because it prevents
> large files from being opened at all.  Fix this by setting the O_LARGEFILE flag
> on the new file handle.
>
> Signed-off-by: Justin Maggard<jmaggard10@gmail.com>
>
> ---
> fs/notify/fanotify/fanotify_user.c |    6 +++---
>   1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/fs/notify/fanotify/fanotify_user.c b/fs/notify/fanotify/fanotify_user.c
> index 9ff4a5e..ef02b3d 100644
> --- a/fs/notify/fanotify/fanotify_user.c
> +++ b/fs/notify/fanotify/fanotify_user.c
> @@ -64,6 +64,7 @@ static int create_fd(struct fsnotify_group *group,
>   			struct file **file)
>   {
>   	int client_fd;
> +	int f_flags;
>   	struct file *new_file;
>
>   	pr_debug("%s: group=%p event=%p\n", __func__, group, event);
> @@ -82,12 +83,11 @@ static int create_fd(struct fsnotify_group *group,
>   	 * we need a new file handle for the userspace program so it can read even if it was
>   	 * originally opened O_WRONLY.
>   	 */
> +	f_flags = group->fanotify_data.f_flags | FMODE_NONOTIFY | O_LARGEFILE;
>   	/* it's possible this event was an overflow event.  in that case dentry and mnt
>   	 * are NULL;  That's fine, just don't call dentry open */
>   	if (event->path.dentry&&  event->path.mnt)
> -		new_file = dentry_open(&event->path,
> -				       group->fanotify_data.f_flags | FMODE_NONOTIFY,
> -				       current_cred());
> +		new_file = dentry_open(&event->path, f_flags, current_cred());
>   	else
>   		new_file = ERR_PTR(-EOVERFLOW);
>   	if (IS_ERR(new_file)) {
>


  reply	other threads:[~2013-04-13 11:54 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-02-14 17:29 [PATCH] fanotify: fix support of large files Justin Maggard
2013-04-13 11:54 ` Heinrich Schuchardt [this message]
2013-04-19 19:23   ` Justin Maggard
2013-04-22 18:49     ` Heinrich Schuchardt
2013-07-11 22:10       ` Justin Maggard

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5169477D.1000400@gmx.de \
    --to=xypron.glpk@gmx.de \
    --cc=LinoSanfilippo@gmx.de \
    --cc=eparis@redhat.com \
    --cc=jmaggard10@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tzvetanc@commtouch.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox