linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sylvain Rochet <gradator@gradator.net>
To: Jamie Lokier <jamie@shareable.org>
Cc: linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org,
	linux-nfs@vger.kernel.org
Subject: Re: PROBLEM: 2.6.35.7 to 3.0 Inotify events missing
Date: Thu, 25 Aug 2011 23:47:04 +0200	[thread overview]
Message-ID: <20110825214704.GA31931@gradator.net> (raw)
In-Reply-To: <20110819233756.GI11512@jl-vm1.vm.bytemark.co.uk>


[-- Attachment #1.1: Type: text/plain, Size: 371 bytes --]

Hi,

On Sat, Aug 20, 2011 at 12:37:56AM +0100, Jamie Lokier wrote:
> 
> Can it also be bypassed with sys_open_by_handle_at?

Just checked that and... as planned it can be bypassed with 
name_to_handle_at/open_by_handle_at as well.

(I added my quick'n'dirty test code, maybe someone will be interested by 
a working fhandle example on Linux 3.0.x).

Sylvain

[-- Attachment #1.2: fhandle3.c --]
[-- Type: text/x-csrc, Size: 892 bytes --]

#include <stdio.h>
#include <stdlib.h>

#include <fcntl.h>
#include <unistd.h>
#include <errno.h>
#include <string.h>

struct file_handle {
	int handle_size;
	int handle_type;
	void *f_handle;
};


int main(int argc, char *argv[])
{
	int ret;
	int fd;
	int mntfd;
	struct file_handle fh;
	fh.handle_type = 0;
	fh.f_handle = malloc(100);
	fh.handle_size = 100/sizeof(int);
	errno  = 0;

	printf("%s\n", argv[1]);

	int mntid = 20;

	ret = syscall(303, 0, argv[1], &fh, &mntid, 0);
	if (ret) {
		perror("303 Error:");
		exit(1);
	}
	printf("%d - %d\n", mntid, fh.handle_size);

	printf("sleep\n");
	sleep(60);


	mntfd = open("/data", O_RDONLY);
	printf("dir = %d\n", mntfd );

	fd = syscall(304, mntfd, &fh, O_WRONLY);
	if (fd < 0 ) {
		perror("304 Error:");
		exit(1);
	}
	printf("fd = %d\n", fd);


	write(fd, "toto", 4);


	if( close(fd) ) {
		printf("close failed\n");
	}

	return 0;
}




[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

  parent reply	other threads:[~2011-08-25 21:47 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20101018223540.GA20730@gradator.net>
2011-08-19 23:03 ` PROBLEM: 2.6.35.7 to 3.0 Inotify events missing Sylvain Rochet
     [not found]   ` <20110819230344.GA24784-XWGZPxRNpGHk1uMJSBkQmQ@public.gmane.org>
2011-08-19 23:37     ` Jamie Lokier
     [not found]       ` <20110819233756.GI11512-DqlFc3psUjeg7Qil/0GVWOc42C6kRsbE@public.gmane.org>
2011-08-20  0:47         ` Sylvain Rochet
2011-08-20  3:21           ` Jamie Lokier
2011-08-20  1:29       ` Al Viro
2011-08-20  1:43         ` Randy Dunlap
2011-08-20  2:01           ` Al Viro
     [not found]         ` <20110820012943.GD2203-3bDd1+5oDREiFSDQTTA3OLVCufUGDwFn@public.gmane.org>
2011-08-20  3:03           ` Jamie Lokier
     [not found]             ` <20110820030335.GA14899-DqlFc3psUjeg7Qil/0GVWOc42C6kRsbE@public.gmane.org>
2011-08-21 17:07               ` J. Bruce Fields
     [not found]                 ` <20110821170714.GB9296-uC3wQj2KruNg9hUCZPvPmw@public.gmane.org>
2011-08-21 20:20                   ` Jamie Lokier
2011-08-21 23:07                     ` NeilBrown
2011-08-22 17:22                       ` J. Bruce Fields
     [not found]                         ` <20110822172239.GA15960-uC3wQj2KruNg9hUCZPvPmw@public.gmane.org>
2011-08-22 23:21                           ` NeilBrown
2011-08-25 21:47       ` Sylvain Rochet [this message]
2011-08-21 22:29   ` NeilBrown

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=20110825214704.GA31931@gradator.net \
    --to=gradator@gradator.net \
    --cc=jamie@shareable.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-nfs@vger.kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).