Re: [PATCH+comment] fix tmpfs BUG and AOP_WRITEPAGE_ACTIVATE

2007-10-25 Thread Hugh Dickins
On Thu, 25 Oct 2007, Pekka Enberg wrote: On 10/25/07, Hugh Dickins [EMAIL PROTECTED] wrote: --- 2.6.24-rc1/mm/shmem.c 2007-10-24 07:16:04.0 +0100 +++ linux/mm/shmem.c2007-10-24 22:31:09.0 +0100 @@ -915,6 +915,21 @@ static int shmem_writepage(struct page *

Re: [PATCH 2.6.24-rc1]EXPORT_SYMBOL(__set_page_dirty_no_writeback);

2007-10-25 Thread Tetsuo Handa
Hello. Arjan van de Ven wrote: when will you post this filesystem for inclusion into kernel.org kernel? (and please really consider posting the patch together with that patch) (also, if you can give a pointer to the source code of this filesystem you might even get early code review) I have

Re: [PATCH+comment] fix tmpfs BUG and AOP_WRITEPAGE_ACTIVATE

2007-10-25 Thread Erez Zadok
In message [EMAIL PROTECTED], Hugh Dickins writes: On Thu, 25 Oct 2007, Pekka Enberg wrote: With unionfs also fixed, we don't know of an absolute need for this patch (and so, on that basis, the !wbc-for_reclaim case could indeed be removed very soon); but as I see it, the unionfs case has

[PATCH 00/31] Remove iget() and read_inode() [try #5]

2007-10-25 Thread David Howells
Here's a set of patches that remove all calls to iget() and all read_inode() functions. They should be removed for two reasons: firstly they don't lend themselves to good error handling, and secondly their presence is a temptation for code outside a filesystem to call iget() to access inodes

[PATCH 01/31] Add an ERR_CAST() macro to complement ERR_PTR and co. [try #5]

2007-10-25 Thread David Howells
Add an ERR_CAST() macro to complement ERR_PTR and co. for the purposes of casting an error entyped as one pointer type to an error of another pointer type whilst making it explicit as to what is going on. This provides a replacement for the ERR_PTR(PTR_ERR(p)) construct. Signed-off-by: David

[PATCH 02/31] Convert ERR_PTR(PTR_ERR(p)) instances to ERR_CAST(p) [try #5]

2007-10-25 Thread David Howells
Convert instances of ERR_PTR(PTR_ERR(p)) to ERR_CAST(p) using: perl -spi -e 's/ERR_PTR[(]PTR_ERR[(](.*)[)][)]/ERR_CAST(\1)/' `grep -rl 'ERR_PTR[(]*PTR_ERR' fs crypto net security` Signed-off-by: David Howells [EMAIL PROTECTED] --- crypto/cbc.c |2 +- crypto/cryptd.c

[PATCH 03/31] IGET: Introduce a function to register iget failure [try #5]

2007-10-25 Thread David Howells
Introduce a function to register failure in an inode construction path. This includes marking the inode under construction as bad, unlocking it and releasing it. Signed-off-by: David Howells [EMAIL PROTECTED] --- Documentation/filesystems/porting | 18 +- fs/bad_inode.c

[PATCH 04/31] IGET: Use iget_failed() in AFS [try #5]

2007-10-25 Thread David Howells
Use iget_failed() in AFS to kill a failed inode. Signed-off-by: David Howells [EMAIL PROTECTED] --- fs/afs/inode.c |5 + 1 files changed, 1 insertions(+), 4 deletions(-) diff --git a/fs/afs/inode.c b/fs/afs/inode.c index d196840..ca9b02f 100644 --- a/fs/afs/inode.c +++ b/fs/afs/inode.c

[PATCH 05/31] IGET: Use iget_failed() in GFS2 [try #5]

2007-10-25 Thread David Howells
Use iget_failed() in GFS2 to kill a failed inode. Signed-off-by: David Howells [EMAIL PROTECTED] --- fs/gfs2/inode.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/fs/gfs2/inode.c b/fs/gfs2/inode.c index 5f6dc32..c5285e2 100644 --- a/fs/gfs2/inode.c +++

[PATCH 07/31] IGET: Stop autofs from using iget() and read_inode() [try #5]

2007-10-25 Thread David Howells
Stop the autofs filesystem from using iget() and read_inode(). Replace autofs_read_inode() with autofs_iget(), and call that instead of iget(). autofs_iget() then uses iget_locked() directly and returns a proper error code instead of an inode in the event of an error. Signed-off-by: David

[PATCH 08/31] IGET: Stop BEFS from using iget() and read_inode() [try #5]

2007-10-25 Thread David Howells
Stop the BEFS filesystem from using iget() and read_inode(). Replace befs_read_inode() with befs_iget(), and call that instead of iget(). befs_iget() then uses iget_locked() directly and returns a proper error code instead of an inode in the event of an error. befs_fill_super() returns any error

[PATCH 09/31] IGET: Stop BFS from using iget() and read_inode() [try #5]

2007-10-25 Thread David Howells
Stop the BFS filesystem from using iget() and read_inode(). Replace bfs_read_inode() with bfs_iget(), and call that instead of iget(). bfs_iget() then uses iget_locked() directly and returns a proper error code instead of an inode in the event of an error. bfs_fill_super() returns any error

[PATCH 11/31] IGET: Stop EFS from using iget() and read_inode() [try #5]

2007-10-25 Thread David Howells
Stop the EFS filesystem from using iget() and read_inode(). Replace efs_read_inode() with efs_iget(), and call that instead of iget(). efs_iget() then uses iget_locked() directly and returns a proper error code instead of an inode in the event of an error. efs_fill_super() returns any error

[PATCH 12/31] IGET: Stop EXT2 from using iget() and read_inode() [try #5]

2007-10-25 Thread David Howells
Stop the EXT2 filesystem from using iget() and read_inode(). Replace ext2_read_inode() with ext2_iget(), and call that instead of iget(). ext2_iget() then uses iget_locked() directly and returns a proper error code instead of an inode in the event of an error. ext2_fill_super() returns any error

[PATCH 13/31] IGET: Stop EXT3 from using iget() and read_inode() [try #5]

2007-10-25 Thread David Howells
Stop the EXT3 filesystem from using iget() and read_inode(). Replace ext3_read_inode() with ext3_iget(), and call that instead of iget(). ext3_iget() then uses iget_locked() directly and returns a proper error code instead of an inode in the event of an error. ext3_fill_super() returns any error

[PATCH 19/31] IGET: Stop ISOFS from using read_inode() [try #5]

2007-10-25 Thread David Howells
Stop the ISOFS filesystem from using read_inode(). Make isofs_read_inode() return an error code, and make isofs_iget() pass it on. Signed-off-by: David Howells [EMAIL PROTECTED] --- fs/isofs/inode.c | 25 + 1 files changed, 17 insertions(+), 8 deletions(-) diff --git

[PATCH 15/31] IGET: Stop FAT from using iget() and read_inode() [try #5]

2007-10-25 Thread David Howells
Stop the FAT filesystem from using iget() and read_inode(). Replace the call to iget() with a call to ilookup(). Signed-off-by: David Howells [EMAIL PROTECTED] --- fs/fat/inode.c |6 ++ 1 files changed, 2 insertions(+), 4 deletions(-) diff --git a/fs/fat/inode.c b/fs/fat/inode.c index

[PATCH 20/31] IGET: Stop JFFS2 from using iget() and read_inode() [try #5]

2007-10-25 Thread David Howells
Stop the JFFS2 filesystem from using iget() and read_inode(). Replace jffs2_read_inode() with jffs2_iget(), and call that instead of iget(). jffs2_iget() then uses iget_locked() directly and returns a proper error code instead of an inode in the event of an error. jffs2_do_fill_super() returns

[PATCH 16/31] IGET: Stop FreeVXFS from using iget() and read_inode() [try #5]

2007-10-25 Thread David Howells
Stop the FreeVXFS filesystem from using iget() and read_inode(). Replace vxfs_read_inode() with vxfs_iget(), and call that instead of iget(). vxfs_iget() then uses iget_locked() directly and returns a proper error code instead of an inode in the event of an error. vxfs_fill_super() returns any

[PATCH 21/31] IGET: Stop JFS from using iget() and read_inode() [try #5]

2007-10-25 Thread David Howells
Stop the JFS filesystem from using iget() and read_inode(). Replace jfs_read_inode() with jfs_iget(), and call that instead of iget(). jfs_iget() then uses iget_locked() directly and returns a proper error code instead of an inode in the event of an error. jfs_fill_super() returns any error

[PATCH 14/31] IGET: Stop EXT4 from using iget() and read_inode() [try #5]

2007-10-25 Thread David Howells
Stop the EXT4 filesystem from using iget() and read_inode(). Replace ext4_read_inode() with ext4_iget(), and call that instead of iget(). ext4_iget() then uses iget_locked() directly and returns a proper error code instead of an inode in the event of an error. ext4_fill_super() returns any error

[PATCH 22/31] IGET: Stop the MINIX filesystem from using iget() and read_inode() [try #5]

2007-10-25 Thread David Howells
Stop the MINIX filesystem from using iget() and read_inode(). Replace minix_read_inode() with minix_iget(), and call that instead of iget(). minix_iget() then uses iget_locked() directly and returns a proper error code instead of an inode in the event of an error. minix_fill_super() returns any

[PATCH 17/31] IGET: Stop FUSE from using iget() and read_inode() [try #5]

2007-10-25 Thread David Howells
Stop the FUSE filesystem from using read_inode(), which it doesn't use anyway. Signed-off-by: David Howells [EMAIL PROTECTED] --- fs/fuse/inode.c |6 -- 1 files changed, 0 insertions(+), 6 deletions(-) diff --git a/fs/fuse/inode.c b/fs/fuse/inode.c index 9a68d69..e50be15 100644 ---

[PATCH 18/31] IGET: Stop HFSPLUS from using iget() and read_inode() [try #5]

2007-10-25 Thread David Howells
Stop the HFSPLUS filesystem from using iget() and read_inode(). Replace hfsplus_read_inode() with hfsplus_iget(), and call that instead of iget(). hfsplus_iget() then uses iget_locked() directly and returns a proper error code instead of an inode in the event of an error. hfsplus_fill_super()

[PATCH 25/31] IGET: Stop ROMFS from using iget() and read_inode() [try #5]

2007-10-25 Thread David Howells
Stop the ROMFS filesystem from using iget() and read_inode(). Replace romfs_read_inode() with romfs_iget(), and call that instead of iget(). romfs_iget() then uses iget_locked() directly and returns a proper error code instead of an inode in the event of an error. romfs_fill_super() returns any

[PATCH 26/31] IGET: Stop the SYSV filesystem from using iget() and read_inode() [try #5]

2007-10-25 Thread David Howells
Stop the SYSV filesystem from using iget() and read_inode(). Replace sysv_read_inode() with sysv_iget(), and call that instead of iget(). sysv_iget() then uses iget_locked() directly and returns a proper error code instead of an inode in the event of an error. Signed-off-by: David Howells [EMAIL

[PATCH 27/31] IGET: Stop UFS from using iget() and read_inode() [try #5]

2007-10-25 Thread David Howells
Stop the UFS filesystem from using iget() and read_inode(). Replace ufs_read_inode() with ufs_iget(), and call that instead of iget(). ufs_iget() then uses iget_locked() directly and returns a proper error code instead of an inode in the event of an error. ufs_fill_super() returns any error

[PATCH 28/31] IGET: Stop OPENPROMFS from using iget() and read_inode() [try #5]

2007-10-25 Thread David Howells
Stop the OPENPROMFS filesystem from using iget() and read_inode(). Replace openpromfs_read_inode() with openpromfs_iget(), and call that instead of iget(). openpromfs_iget() then uses iget_locked() directly and returns a proper error code instead of an inode in the event of an error.

[PATCH 23/31] IGET: Stop PROCFS from using iget() and read_inode() [try #5]

2007-10-25 Thread David Howells
Stop the PROCFS filesystem from using iget() and read_inode(). Merge procfs_read_inode() into procfs_get_inode(), and have that call iget_locked() instead of iget(). Signed-off-by: David Howells [EMAIL PROTECTED] --- fs/proc/inode.c | 60

[PATCH 29/31] IGET: Stop HOSTFS from using iget() and read_inode() [try #5]

2007-10-25 Thread David Howells
Stop the HOSTFS filesystem from using iget() and read_inode(). Provide hostfs_iget(), and call that instead of iget(). hostfs_iget() then uses iget_locked() directly and returns a proper error code instead of an inode in the event of an error. hostfs_fill_sb_common() returns any error incurred

[PATCH 30/31] IGET: Stop HPPFS from using iget() and read_inode() [try #5]

2007-10-25 Thread David Howells
Stop the HPPFS filesystem from using iget() and read_inode(). Provide an hppfs_iget(), and call that instead of iget(). hppfs_iget() then uses iget_locked() directly and returns a proper error code instead of an inode in the event of an error. hppfs_fill_sb_common() returns any error incurred

[PATCH 31/31] IGET: Remove iget() and the read_inode() super op as being obsolete [try #5]

2007-10-25 Thread David Howells
Remove the old iget() call and the read_inode() superblock operation it uses as these are really obsolete, and the use of read_inode() does not produce proper error handling (no distinction between ENOMEM and EIO when marking an inode bad). Furthermore, this removes the temptation to use iget()

Re: msync(2) bug(?), returns AOP_WRITEPAGE_ACTIVATE to userland

2007-10-25 Thread Hugh Dickins
On Mon, 22 Oct 2007, Erez Zadok wrote: In message [EMAIL PROTECTED], Hugh Dickins writes: Only ramdisk and shmem have been returning AOP_WRITEPAGE_ACTIVATE. Both of those set BDI_CAP_NO_WRITEBACK. ramdisk never returned it if !wbc-for_reclaim. I contend that shmem shouldn't either:

Re: msync(2) bug(?), returns AOP_WRITEPAGE_ACTIVATE to userland

2007-10-25 Thread Erez Zadok
That's a nice historical review, Huge, of how got into these mess we're in now -- it all starts with good intentions. :-) On a related note, I would just love to get rid of calling the lower -writepage in unionfs b/c I can't even tell if I have a lower page to use all the time. I'd prefer to

Re: msync(2) bug(?), returns AOP_WRITEPAGE_ACTIVATE to userland

2007-10-25 Thread Hugh Dickins
On Mon, 22 Oct 2007, Erez Zadok wrote: What's the precise semantics of AOP_WRITEPAGE_ACTIVATE? Sigh - not at you, at it! It's a secret that couldn't be kept secret, a hack for tmpfs reclaim, let's just look forward to it going away. Is it considered an error or not? No, it's definitely not

Re: [PATCH+comment] fix tmpfs BUG and AOP_WRITEPAGE_ACTIVATE

2007-10-25 Thread H. Peter Anvin
Erez Zadok wrote: In message [EMAIL PROTECTED], Hugh Dickins writes: On Thu, 25 Oct 2007, Pekka Enberg wrote: With unionfs also fixed, we don't know of an absolute need for this patch (and so, on that basis, the !wbc-for_reclaim case could indeed be removed very soon); but as I see it, the

Re: [PATCH] VFS: new fgetattr() file operation

2007-10-25 Thread David Chinner
On Wed, Oct 24, 2007 at 05:27:04PM +0200, Miklos Szeredi wrote: Wouldn't you be better off by attempting to implement an open by ino operation and an operation to get the generation count for the file and then modifying the network protocol of interest to use these as identifiers for

Re: [patch] fs: restore nobh

2007-10-25 Thread Nick Piggin
On Thu, Oct 25, 2007 at 09:07:36PM +0200, Jan Kara wrote: Hi, This is overdue, sorry. Got a little complicated, and I've been away from my filesystem test setup so I didn't want ot send it (lucky, coz I found a bug after more substantial testing). Anyway, RFC? Hmm, maybe one

[PATCH] Add an ERR_CAST() function to complement ERR_PTR and co. [try #5.1]

2007-10-25 Thread David Howells
Add an ERR_CAST() function to complement ERR_PTR and co. for the purposes of casting an error entyped as one pointer type to an error of another pointer type whilst making it explicit as to what is going on. This provides a replacement for the ERR_PTR(PTR_ERR(p)) construct. Signed-off-by: David

Re: [PATCH 01/31] Add an ERR_CAST() macro to complement ERR_PTR and co. [try #5]

2007-10-25 Thread Zach Brown
+ * ERR_CAST - Explicitly cast an error-valued pointer to another pointer type + * @ptr: The pointer to cast. + * + * Explicitly cast an error-valued pointer to another pointer type in such a + * way as to make it clear that's what's going on. + */ +static inline void *ERR_CAST(const void

Re: [PATCH] VFS: new fgetattr() file operation

2007-10-25 Thread Miklos Szeredi
On Wed, Oct 24, 2007 at 05:27:04PM +0200, Miklos Szeredi wrote: Wouldn't you be better off by attempting to implement an open by ino operation and an operation to get the generation count for the file and then modifying the network protocol of interest to use these as identifiers

[patch 1/1] Drop CAP_SYS_RAWIO requirement for FIBMAP

2007-10-25 Thread Mike Waychison
Remove the need for having CAP_SYS_RAWIO when doing a FIBMAP call on an open file descriptor. It would be nice to allow users to have permission to see where their data is landing on disk, and there really isn't a good reason to keep them from getting at this information. Signed-off-by: Mike

Re: [PATCH 01/31] Add an ERR_CAST() macro to complement ERR_PTR and co. [try #5]

2007-10-25 Thread Roland Dreier
+static inline void *ERR_CAST(const void *ptr) +{ + return (void *) ptr; +} Just to nit, surely you don't need the cast inside the function. The casting happens at the call site between the argument and returned pointer. The way it's written you kinda do, since it takes a

Re: [PATCH 01/31] Add an ERR_CAST() macro to complement ERR_PTR and co. [try #5]

2007-10-25 Thread Andrew Morton
On Thu, 25 Oct 2007 16:09:09 -0700 Zach Brown [EMAIL PROTECTED] wrote: + * ERR_CAST - Explicitly cast an error-valued pointer to another pointer type + * @ptr: The pointer to cast. + * + * Explicitly cast an error-valued pointer to another pointer type in such a + * way as to

Re: [PATCH 2/2] VFS: Reorder vfs_getxattr to avoid unnecessary calls to the LSM

2007-10-25 Thread Serge E. Hallyn
Quoting James Morris ([EMAIL PROTECTED]): On Mon, 22 Oct 2007, David P. Quigley wrote: Originally vfs_getxattr would pull the security xattr variable using the inode getxattr handle and then proceed to clobber it with a subsequent call to the LSM. This patch reorders the two operations

Re: [PATCH] VFS: new fgetattr() file operation

2007-10-25 Thread David Chinner
On Fri, Oct 26, 2007 at 01:10:14AM +0200, Miklos Szeredi wrote: On Wed, Oct 24, 2007 at 05:27:04PM +0200, Miklos Szeredi wrote: Wouldn't you be better off by attempting to implement an open by ino operation and an operation to get the generation count for the file and then

Re: [PATCH 1/2] VFS/Security: Rework inode_getsecurity and callers to return resulting buffer

2007-10-25 Thread Serge E. Hallyn
Quoting David P. Quigley ([EMAIL PROTECTED]): This patch modifies the interface to inode_getsecurity to have the function return a buffer containing the security blob and its length via parameters instead of relying on the calling function to give it an appropriately sized buffer.

Re: [patch 1/1] Drop CAP_SYS_RAWIO requirement for FIBMAP

2007-10-25 Thread Alan Cox
On Thu, 25 Oct 2007 16:06:40 -0700 Mike Waychison [EMAIL PROTECTED] wrote: Remove the need for having CAP_SYS_RAWIO when doing a FIBMAP call on an open file descriptor. It would be nice to allow users to have permission to see where their data is landing on disk, and there really isn't a

Re: [PATCH 01/31] Add an ERR_CAST() macro to complement ERR_PTR and co. [try #5]

2007-10-25 Thread Zach Brown
Roland Dreier wrote: +static inline void *ERR_CAST(const void *ptr) +{ +return (void *) ptr; +} Just to nit, surely you don't need the cast inside the function. The casting happens at the call site between the argument and returned pointer. The way it's

Re: [patch 1/1] Drop CAP_SYS_RAWIO requirement for FIBMAP

2007-10-25 Thread Mike Waychison
Alan Cox wrote: On Thu, 25 Oct 2007 16:06:40 -0700 Mike Waychison [EMAIL PROTECTED] wrote: Remove the need for having CAP_SYS_RAWIO when doing a FIBMAP call on an open file descriptor. It would be nice to allow users to have permission to see where their data is landing on disk, and there

Re: [patch 1/1] Drop CAP_SYS_RAWIO requirement for FIBMAP

2007-10-25 Thread Alan Cox
I found Chris's comment about negative block numbers, I'll send a patch out for that. You mentioned back in 99 about racing with ftruncate. Is it sufficient to mutex_lock(i_mutex) and down_read(i_alloc_sem)? One for the fs guys. That code has changed far beyond anything I understand any

Re: msync(2) bug(?), returns AOP_WRITEPAGE_ACTIVATE to userland

2007-10-25 Thread Neil Brown
On Thursday October 25, [EMAIL PROTECTED] wrote: On Mon, 22 Oct 2007, Pekka Enberg wrote: On 10/22/07, Hugh Dickins [EMAIL PROTECTED] wrote: Only ramdisk and shmem have been returning AOP_WRITEPAGE_ACTIVATE. Both of those set BDI_CAP_NO_WRITEBACK. ramdisk never returned it if