1. 28 May, 2010 9 commits
    • Erik van der Kouwe's avatar
      fs/minix: bugfix, number of indirect block ptrs per block depends on block size · 0ab7620a
      Erik van der Kouwe authored
      The MINIX filesystem driver used a constant number of indirect block
      pointers in an indirect block. This worked only for filesystems with 1kb
      block, while the MINIX default block size is now 4kb. As a consequence,
      large files were read incorrectly on such filesystems and writing a
      large file would cause the filesystem to become corrupted. This patch
      computes the number of indirect block pointers based on the block size,
      making the driver work for each block size.
      
      I would like to thank Feiran Zheng ('Fam') for pointing out the cause
      of the corruption.
      Signed-off-by: default avatarErik van der Kouwe <vdkouwe@cs.vu.nl>
      Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
      0ab7620a
    • Christoph Hellwig's avatar
      rename the generic fsync implementations · 1b061d92
      Christoph Hellwig authored
      We don't name our generic fsync implementations very well currently.
      The no-op implementation for in-memory filesystems currently is called
      simple_sync_file which doesn't make too much sense to start with,
      the the generic one for simple filesystems is called simple_fsync
      which can lead to some confusion.
      
      This patch renames the generic file fsync method to generic_file_fsync
      to match the other generic_file_* routines it is supposed to be used
      with, and the no-op implementation to noop_fsync to make it obvious
      what to expect.  In addition add some documentation for both methods.
      Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
      Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
      1b061d92
    • Christoph Hellwig's avatar
      drop unused dentry argument to ->fsync · 7ea80859
      Christoph Hellwig authored
      Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
      Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
      7ea80859
    • Julia Lawall's avatar
      fs: Add missing mutex_unlock · cc967be5
      Julia Lawall authored
      Add a mutex_unlock missing on the error path.  At other exists from the
      function that return an error flag, the mutex is unlocked, so do the same
      here.
      
      The semantic match that finds this problem is as follows:
      (http://coccinelle.lip6.fr/)
      
      // <smpl>
      @@
      expression E1;
      @@
      
      * mutex_lock(E1,...);
        <+... when != E1
        if (...) {
          ... when != E1
      *   return ...;
        }
        ...+>
      * mutex_unlock(E1,...);
      // </smpl>
      Signed-off-by: default avatarJulia Lawall <julia@diku.dk>
      Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
      cc967be5
    • Al Viro's avatar
      Fix racy use of anon_inode_getfd() in perf_event.c · ea635c64
      Al Viro authored
      once anon_inode_getfd() is called, you can't expect *anything* about
      struct file that descriptor points to - another thread might be doing
      whatever it likes with descriptor table at that point.
      
      Cc: stable <stable@kernel.org>
      Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
      ea635c64
    • Al Viro's avatar
      get rid of the magic around f_count in aio · d7065da0
      Al Viro authored
      __aio_put_req() plays sick games with file refcount.  What
      it wants is fput() from atomic context; it's almost always
      done with f_count > 1, so they only have to deal with delayed
      work in rare cases when their reference happens to be the
      last one.  Current code decrements f_count and if it hasn't
      hit 0, everything is fine.  Otherwise it keeps a pointer
      to struct file (with zero f_count!) around and has delayed
      work do __fput() on it.
      
      Better way to do it: use atomic_long_add_unless( , -1, 1)
      instead of !atomic_long_dec_and_test().  IOW, decrement it
      only if it's not the last reference, leave refcount alone
      if it was.  And use normal fput() in delayed work.
      
      I've made that atomic_long_add_unless call a new helper -
      fput_atomic().  Drops a reference to file if it's safe to
      do in atomic (i.e. if that's not the last one), tells if
      it had been able to do that.  aio.c converted to it, __fput()
      use is gone.  req->ki_file *always* contributes to refcount
      now.  And __fput() became static.
      Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
      d7065da0
    • Neil Brown's avatar
      VFS: fix recent breakage of FS_REVAL_DOT · 176306f5
      Neil Brown authored
      Commit 1f36f774 broke FS_REVAL_DOT semantics.
      
      In particular, before this patch, the command
         ls -l
      in an NFS mounted directory would always check if the directory on the server
      had changed and if so would flush and refill the pagecache for the dir.
      After this patch, the same "ls -l" will repeatedly return stale date until
      the cached attributes for the directory time out.
      
      The following patch fixes this by ensuring the d_revalidate is called by
      do_last when "." is being looked-up.
      link_path_walk has already called d_revalidate, but in that case LOOKUP_OPEN
      is not set so nfs_lookup_verify_inode chooses not to do any validation.
      
      The following patch restores the original behaviour.
      
      Cc: stable@kernel.org
      Signed-off-by: default avatarNeilBrown <neilb@suse.de>
      Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
      176306f5
    • Al Viro's avatar
      Revert "anon_inode: set S_IFREG on the anon_inode" · 1eb2cbb6
      Al Viro authored
      This reverts commit a7cf4145.
      1eb2cbb6
    • Linus Torvalds's avatar
  2. 27 May, 2010 31 commits