Re: [EXT4 set 5][PATCH 1/1] expand inode i_extra_isize to support features in larger inode

2007-07-14 Thread Peter Zijlstra
On Fri, 2007-07-13 at 14:47 -0700, Zach Brown wrote:
  I fear the consequences of this change :(
 
 I love it.  In the past I've lost time by working with patches which
 didn't quite realize that ext3 holds a transaction open during
 -direct_IO.
 
  Oh well, please keep it alive, maybe beat on it a bit, resend it
  later on?
 
 I can test the patch to make sure that it catches mistakes I've made in
 the past. 

That would be much appreciated.

  Peter, do you have any interest in seeing how far we can get
 at tracking lock_page()?  I'm not holding my breath, but any little bit
 would probably help.

Yeah I'm going to try that one next.. 

-
To unsubscribe from this list: send the line unsubscribe linux-fsdevel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 1/6][TAKE7] manpage for fallocate

2007-07-14 Thread Michael Kerrisk
[CC += [EMAIL PROTECTED]

Amit,

Thanks for this page.  I will endeavour to review it in 
the coming days.  In the meantime, the better address to CC
me on fot man pages stuff is [EMAIL PROTECTED]

Cheers,

Michael

 Following is the modified version of the manpage originally submitted by
 David Chinner. Please use `nroff -man fallocate.2 | less` to view.
 
 This includes changes suggested by Heikki Orsila and Barry Naujok.
 
 
 .TH fallocate 2
 .SH NAME
 fallocate \- allocate or remove file space
 .SH SYNOPSIS
 .nf
 .B #include fcntl.h
 .PP
 .BI long fallocate(int  fd , int  mode , loff_t  offset , loff_t 
 len);
 .SH DESCRIPTION
 The
 .B fallocate
 syscall allows a user to directly manipulate the allocated disk space
 for the file referred to by
 .I fd
 for the byte range starting at
 .I offset
 and continuing for
 .I len
 bytes.
 The
 .I mode
 parameter determines the operation to be performed on the given range.
 Currently there are two modes:
 .TP
 .B FALLOC_ALLOCATE
 allocates and initialises to zero the disk space within the given range.
 After a successful call, subsequent writes are guaranteed not to fail
 because
 of lack of disk space.  If the size of the file is less than
 .IR offset + len ,
 then the file is increased to this size; otherwise the file size is left
 unchanged.
 .B FALLOC_ALLOCATE
 closely resembles
 .BR posix_fallocate (3)
 and is intended as a method of optimally implementing this function.
 .B FALLOC_ALLOCATE
 may allocate a larger range than that was specified.
 .TP
 .B FALLOC_RESV_SPACE
 provides the same functionality as
 .B FALLOC_ALLOCATE
 except it does not ever change the file size. This allows allocation
 of zero blocks beyond the end of file and is useful for optimising
 append workloads.
 .SH RETURN VALUE
 .B fallocate
 returns zero on success, or an error number on failure.
 Note that
 .I errno
 is not set.
 .SH ERRORS
 .TP
 .B EBADF
 .I fd
 is not a valid file descriptor, or is not opened for writing.
 .TP
 .B EFBIG
 .IR offset + len
 exceeds the maximum file size.
 .TP
 .B EINVAL
 .I offset
 was less than 0, or
 .I len
 was less than or equal to 0.
 .TP
 .B ENODEV
 .I fd
 does not refer to a regular file or a directory.
 .TP
 .B ENOSPC
 There is not enough space left on the device containing the file
 referred to by
 .IR fd .
 .TP
 .B ESPIPE
 .I fd
 refers to a pipe of file descriptor.
 .TP
 .B ENOSYS
 The filesystem underlying the file descriptor does not support this
 operation.
 .TP
 .B EINTR
 A signal was caught during execution
 .TP
 .B EIO
 An I/O error occurred while reading from or writing to a file system.
 .TP
 .B EOPNOTSUPP
 The mode is not supported on the file descriptor.
 .SH AVAILABILITY
 The
 .B fallocate
 system call is available since 2.6.XX
 .SH SEE ALSO
 .BR syscall (2),
 .BR posix_fadvise (3),
 .BR ftruncate (3).

-- 
Ist Ihr Browser Vista-kompatibel? Jetzt die neuesten 
Browser-Versionen downloaden: http://www.gmx.net/de/go/browser
-
To unsubscribe from this list: send the line unsubscribe linux-fsdevel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] isofs: mounting to regular file may succeed

2007-07-14 Thread Kirill Kuvaldin
On Sat, Jul 14, 2007 at 03:47:21AM +0400, Kirill Kuvaldin wrote:
 $ dd if=correct.iso of=bad.iso bs=4k count=8

Oops, sorry, the right command should be:

dd if=correct.iso of=bad.iso bs=4k seek=8
   
 

Kirill
-
To unsubscribe from this list: send the line unsubscribe linux-fsdevel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] VFS: fix a race in lease-breaking during truncate

2007-07-14 Thread J. Bruce Fields
From: david m. richter [EMAIL PROTECTED]

It is possible that another process could acquire a new file lease right
after break_lease() is called during a truncate, but before lease-granting
is disabled by the subsequent get_write_access().  Merely switching the
order of the break_lease() and get_write_access() calls prevents this race.

Signed-off-by: David M. Richter [EMAIL PROTECTED]
Signed-off-by: J. Bruce Fields [EMAIL PROTECTED]
---
 fs/open.c |   16 +---
 1 files changed, 9 insertions(+), 7 deletions(-)

I posted this patch to linux-fsdevel last week and nobody said anything.
Thus, it is perfect.

--b.

diff --git a/fs/open.c b/fs/open.c
index 0d515d1..c32aba0 100644
--- a/fs/open.c
+++ b/fs/open.c
@@ -255,24 +255,26 @@ static long do_sys_truncate(const char __user * path, 
loff_t length)
if (IS_IMMUTABLE(inode) || IS_APPEND(inode))
goto dput_and_out;
 
-   /*
-* Make sure that there are no leases.
-*/
-   error = break_lease(inode, FMODE_WRITE);
+   error = get_write_access(inode);
if (error)
goto dput_and_out;
 
-   error = get_write_access(inode);
+   /*
+* Make sure that there are no leases.  get_write_access() protects
+* against the truncate racing with a lease-granting setlease().
+*/
+   error = break_lease(inode, FMODE_WRITE);
if (error)
-   goto dput_and_out;
+   goto put_write_and_out;
 
error = locks_verify_truncate(inode, NULL, length);
if (!error) {
DQUOT_INIT(inode);
error = do_truncate(nd.dentry, length, 0, NULL);
}
-   put_write_access(inode);
 
+put_write_and_out:
+   put_write_access(inode);
 dput_and_out:
path_release(nd);
 out:
-- 
1.5.3.rc0.63.gc956

-
To unsubscribe from this list: send the line unsubscribe linux-fsdevel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] isofs: mounting to regular file may succeed

2007-07-14 Thread Jan Engelhardt

On Jul 14 2007 03:47, Kirill Kuvaldin wrote:

We then can mount it to a regular file:

Wow, this is news to me. Since when is it possible to mount files to files?

Jan
-- 
-
To unsubscribe from this list: send the line unsubscribe linux-fsdevel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html