1. 16 9月, 2009 1 次提交
    • A
      HWPOISON: Define a new error_remove_page address space op for async truncation · 25718736
      Andi Kleen 提交于
      Truncating metadata pages is not safe right now before
      we haven't audited all file systems.
      
      To enable truncation only for data address space define
      a new address_space callback error_remove_page.
      
      This is used for memory_failure.c memory error handling.
      
      This can be then set to truncate_inode_page()
      
      This patch just defines the new operation and adds documentation.
      
      Callers and users come in followon patches.
      Signed-off-by: NAndi Kleen <ak@linux.intel.com>
      25718736
  2. 21 4月, 2009 1 次提交
  3. 10 1月, 2009 1 次提交
    • T
      filesystem freeze: add error handling of write_super_lockfs/unlockfs · c4be0c1d
      Takashi Sato 提交于
      Currently, ext3 in mainline Linux doesn't have the freeze feature which
      suspends write requests.  So, we cannot take a backup which keeps the
      filesystem's consistency with the storage device's features (snapshot and
      replication) while it is mounted.
      
      In many case, a commercial filesystem (e.g.  VxFS) has the freeze feature
      and it would be used to get the consistent backup.
      
      If Linux's standard filesystem ext3 has the freeze feature, we can do it
      without a commercial filesystem.
      
      So I have implemented the ioctls of the freeze feature.
      I think we can take the consistent backup with the following steps.
      1. Freeze the filesystem with the freeze ioctl.
      2. Separate the replication volume or create the snapshot
         with the storage device's feature.
      3. Unfreeze the filesystem with the unfreeze ioctl.
      4. Take the backup from the separated replication volume
         or the snapshot.
      
      This patch:
      
      VFS:
      Changed the type of write_super_lockfs and unlockfs from "void"
      to "int" so that they can return an error.
      Rename write_super_lockfs and unlockfs of the super block operation
      freeze_fs and unfreeze_fs to avoid a confusion.
      
      ext3, ext4, xfs, gfs2, jfs:
      Changed the type of write_super_lockfs and unlockfs from "void"
      to "int" so that write_super_lockfs returns an error if needed,
      and unlockfs always returns 0.
      
      reiserfs:
      Changed the type of write_super_lockfs and unlockfs from "void"
      to "int" so that they always return 0 (success) to keep a current behavior.
      Signed-off-by: NTakashi Sato <t-sato@yk.jp.nec.com>
      Signed-off-by: NMasayuki Hamaguchi <m-hamaguchi@ys.jp.nec.com>
      Cc: <xfs-masters@oss.sgi.com>
      Cc: <linux-ext4@vger.kernel.org>
      Cc: Christoph Hellwig <hch@lst.de>
      Cc: Dave Kleikamp <shaggy@austin.ibm.com>
      Cc: Dave Chinner <david@fromorbit.com>
      Cc: Alasdair G Kergon <agk@redhat.com>
      Cc: Al Viro <viro@zeniv.linux.org.uk>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      c4be0c1d
  4. 01 1月, 2009 2 次提交
  5. 31 10月, 2008 1 次提交
  6. 27 7月, 2008 1 次提交
  7. 07 5月, 2008 1 次提交
    • C
      [PATCH] kill ->put_inode · 33dcdac2
      Christoph Hellwig 提交于
      And with that last patch to affs killing the last put_inode instance we
      can finally, after many years of transition kill this racy and awkward
      interface.
      
      (It's kinda funny that even the description in
      Documentation/filesystems/vfs.txt was entirely wrong..)
      
      Also remove a very misleading comment above the defintion of
      struct super_operations.
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      33dcdac2
  8. 09 2月, 2008 1 次提交
    • M
      mount options: add documentation · f84e3f52
      Miklos Szeredi 提交于
      This series addresses the problem of showing mount options in
      /proc/mounts.
      
      Several filesystems which use mount options, have not implemented a
      .show_options superblock operation.  Several others have implemented
      this callback, but have not kept it fully up to date with the parsed
      options.
      
      Q: Why do we need correct option showing in /proc/mounts?
      A: We want /proc/mounts to fully replace /etc/mtab.  The reasons for
         this are:
          - unprivileged mounters won't be able to update /etc/mtab
          - /etc/mtab doesn't work with private mount namespaces
          - /etc/mtab can become out-of-sync with reality
      
      Q: Can't this be done, so that filesystems need not bother with
         implementing a .show_mounts callback, and keeping it up to date?
      A: Only in some cases.  Certain filesystems allow modification of a
         subset of options in their remount_fs method.  It is not possible
         to take this into account without knowing exactly how the
         filesystem handles options.
      
      For the simple case (no remount or remount resets all options) the
      patchset introduces two helpers:
      
        generic_show_options()
        save_mount_options()
      
      These can also be used to emulate the old /etc/mtab behavior, until
      proper support is added.  Even if this is not 100% correct, it's still
      better than showing no options at all.
      
      The following patches fix up most in-tree filesystems, some have been
      compile tested only, some have been reviewed and acked by the
      maintainer.
      
      Table displaying status of all in-kernel filesystems:
      - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
      legend:
      
        none - fs has options, but doesn't define ->show_options()
        some - fs defines ->show_options(), but some only options are shown
        good - fs shows all options
        noopt - fs does not have options
        patch - a patch will be posted
        merged - a patch has been merged by subsystem maintainer
      
      9p          good
      adfs        patch
      affs        patch
      afs         patch
      autofs      patch
      autofs4     patch
      befs        patch
      bfs         noopt
      cifs        some
      coda        noopt
      configfs    noopt
      cramfs      noopt
      debugfs     noopt
      devpts      patch
      ecryptfs    good
      efs         noopt
      ext2        patch
      ext3        good
      ext4        merged
      fat         patch
      freevxfs    noopt
      fuse        patch
      fusectl	    noopt
      gfs2        good
      gfs2meta    noopt
      hfs         good
      hfsplus     good
      hostfs      patch
      hpfs        patch
      hppfs       noopt
      hugetlbfs   patch
      isofs       patch
      jffs2       noopt
      jfs         merged
      minix       noopt
      msdos       ->fat
      ncpfs       patch
      nfs         some
      nfsd        noopt
      ntfs        good
      ocfs2       good
      ocfs2/dlmfs noopt
      openpromfs  noopt
      proc        noopt
      qnx4        noopt
      ramfs       noopt
      reiserfs    patch
      romfs       noopt
      smbfs       good
      sysfs       noopt
      sysv        noopt
      udf         patch
      ufs         good
      vfat        ->fat
      xfs         good
      
      mm/shmem.c                                    patch
      drivers/oprofile/oprofilefs.c                 noopt
      drivers/infiniband/hw/ipath/ipath_fs.c        noopt
      drivers/misc/ibmasm/ibmasmfs.c                noopt
      drivers/usb/core (usbfs)                      merged
      drivers/usb/gadget (gadgetfs)                 noopt
      drivers/isdn/capi/capifs.c                    patch
      kernel/cpuset.c                               noopt
      fs/binfmt_misc.c                              noopt
      net/sunrpc/rpc_pipe.c                         noopt
      arch/powerpc/platforms/cell/spufs             patch
      arch/s390/hypfs                               good
      ipc/mqueue.c                                  noopt
      security (securityfs)                         noopt
      security/selinux/selinuxfs.c                  noopt
      kernel/cgroup.c                               good
      security/smack/smackfs.c                      noopt
      
      in -mm:
      
      reiser4     some
      unionfs     good
      - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
      
      This patch:
      
      Document the rules for handling mount options in the .show_options
      super operation.
      Signed-off-by: NMiklos Szeredi <mszeredi@suse.cz>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      f84e3f52
  9. 08 2月, 2008 1 次提交
    • D
      iget: remove iget() and the read_inode() super op as being obsolete · 12debc42
      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() to find an inode by
      number in a filesystem from code outside that filesystem.
      
      iget_locked() should be used instead.  A new function is added in an earlier
      patch (iget_failed) that is to be called to mark an inode as bad, unlock it
      and release it should the get routine fail.  Mark iget() and read_inode() as
      being obsolete and remove references to them from the documentation.
      
      Typically a filesystem will be modified such that the read_inode function
      becomes an internal iget function, for example the following:
      
      	void thingyfs_read_inode(struct inode *inode)
      	{
      		...
      	}
      
      would be changed into something like:
      
      	struct inode *thingyfs_iget(struct super_block *sp, unsigned long ino)
      	{
      		struct inode *inode;
      		int ret;
      
      		inode = iget_locked(sb, ino);
      		if (!inode)
      			return ERR_PTR(-ENOMEM);
      		if (!(inode->i_state & I_NEW))
      			return inode;
      
      		...
      		unlock_new_inode(inode);
      		return inode;
      	error:
      		iget_failed(inode);
      		return ERR_PTR(ret);
      	}
      
      and then thingyfs_iget() would be called rather than iget(), for example:
      
      	ret = -EINVAL;
      	inode = iget(sb, ino);
      	if (!inode || is_bad_inode(inode))
      		goto error;
      
      becomes:
      
      	inode = thingyfs_iget(sb, ino);
      	if (IS_ERR(inode)) {
      		ret = PTR_ERR(inode);
      		goto error;
      	}
      
      Note that is_bad_inode() does not need to be called.  The error returned by
      thingyfs_iget() should render it unnecessary.
      Signed-off-by: NDavid Howells <dhowells@redhat.com>
      Acked-by: NChristoph Hellwig <hch@lst.de>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      12debc42
  10. 20 10月, 2007 1 次提交
  11. 17 10月, 2007 2 次提交
  12. 17 7月, 2007 2 次提交
  13. 09 5月, 2007 1 次提交
    • E
      VFS: delay the dentry name generation on sockets and pipes · c23fbb6b
      Eric Dumazet 提交于
      1) Introduces a new method in 'struct dentry_operations'.  This method
         called d_dname() might be called from d_path() to build a pathname for
         special filesystems.  It is called without locks.
      
         Future patches (if we succeed in having one common dentry for all
         pipes/sockets) may need to change prototype of this method, but we now
         use : char *d_dname(struct dentry *dentry, char *buffer, int buflen);
      
      2) Adds a dynamic_dname() helper function that eases d_dname() implementations
      
      3) Defines d_dname method for sockets : No more sprintf() at socket
         creation.  This is delayed up to the moment someone does an access to
         /proc/pid/fd/...
      
      4) Defines d_dname method for pipes : No more sprintf() at pipe
         creation.  This is delayed up to the moment someone does an access to
         /proc/pid/fd/...
      
      A benchmark consisting of 1.000.000 calls to pipe()/close()/close() gives a
      *nice* speedup on my Pentium(M) 1.6 Ghz :
      
      3.090 s instead of 3.450 s
      Signed-off-by: NEric Dumazet <dada1@cosmosbay.com>
      Acked-by: NChristoph Hellwig <hch@infradead.org>
      Acked-by: NLinus Torvalds <torvalds@linux-foundation.org>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      c23fbb6b
  14. 21 2月, 2007 1 次提交
    • N
      [PATCH] fs: fix libfs data leak · 955eff5a
      Nick Piggin 提交于
      simple_prepare_write leaks uninitialised kernel data.  This happens because
      the it leaves an uninitialised "hole" over the part of the page that the
      write is expected to go to.  This is fine, but it then marks the page
      uptodate, which means a concurrent read can come in and copy the
      uninitialised memory into userspace before it written to.
      
      Fix it by simply marking it uptodate in simple_commit_write instead, after
      the hole has been filled in.  This could theoretically break an fs that
      uses simple_prepare_write and not simple_commit_write, and that relies on
      the incorrect simple_prepare_write behaviour.  Luckily, none of those
      exists in the tree.
      Signed-off-by: NNick Piggin <npiggin@suse.de>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      955eff5a
  15. 04 10月, 2006 1 次提交
  16. 01 10月, 2006 1 次提交
  17. 11 7月, 2006 1 次提交
  18. 23 6月, 2006 2 次提交
    • D
      [PATCH] VFS: Permit filesystem to perform statfs with a known root dentry · 726c3342
      David Howells 提交于
      Give the statfs superblock operation a dentry pointer rather than a superblock
      pointer.
      
      This complements the get_sb() patch.  That reduced the significance of
      sb->s_root, allowing NFS to place a fake root there.  However, NFS does
      require a dentry to use as a target for the statfs operation.  This permits
      the root in the vfsmount to be used instead.
      
      linux/mount.h has been added where necessary to make allyesconfig build
      successfully.
      
      Interest has also been expressed for use with the FUSE and XFS filesystems.
      Signed-off-by: NDavid Howells <dhowells@redhat.com>
      Acked-by: NAl Viro <viro@zeniv.linux.org.uk>
      Cc: Nathan Scott <nathans@sgi.com>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      726c3342
    • D
      [PATCH] VFS: Permit filesystem to override root dentry on mount · 454e2398
      David Howells 提交于
      Extend the get_sb() filesystem operation to take an extra argument that
      permits the VFS to pass in the target vfsmount that defines the mountpoint.
      
      The filesystem is then required to manually set the superblock and root dentry
      pointers.  For most filesystems, this should be done with simple_set_mnt()
      which will set the superblock pointer and then set the root dentry to the
      superblock's s_root (as per the old default behaviour).
      
      The get_sb() op now returns an integer as there's now no need to return the
      superblock pointer.
      
      This patch permits a superblock to be implicitly shared amongst several mount
      points, such as can be done with NFS to avoid potential inode aliasing.  In
      such a case, simple_set_mnt() would not be called, and instead the mnt_root
      and mnt_sb would be set directly.
      
      The patch also makes the following changes:
      
       (*) the get_sb_*() convenience functions in the core kernel now take a vfsmount
           pointer argument and return an integer, so most filesystems have to change
           very little.
      
       (*) If one of the convenience function is not used, then get_sb() should
           normally call simple_set_mnt() to instantiate the vfsmount. This will
           always return 0, and so can be tail-called from get_sb().
      
       (*) generic_shutdown_super() now calls shrink_dcache_sb() to clean up the
           dcache upon superblock destruction rather than shrink_dcache_anon().
      
           This is required because the superblock may now have multiple trees that
           aren't actually bound to s_root, but that still need to be cleaned up. The
           currently called functions assume that the whole tree is rooted at s_root,
           and that anonymous dentries are not the roots of trees which results in
           dentries being left unculled.
      
           However, with the way NFS superblock sharing are currently set to be
           implemented, these assumptions are violated: the root of the filesystem is
           simply a dummy dentry and inode (the real inode for '/' may well be
           inaccessible), and all the vfsmounts are rooted on anonymous[*] dentries
           with child trees.
      
           [*] Anonymous until discovered from another tree.
      
       (*) The documentation has been adjusted, including the additional bit of
           changing ext2_* into foo_* in the documentation.
      
      [akpm@osdl.org: convert ipath_fs, do other stuff]
      Signed-off-by: NDavid Howells <dhowells@redhat.com>
      Acked-by: NAl Viro <viro@zeniv.linux.org.uk>
      Cc: Nathan Scott <nathans@sgi.com>
      Cc: Roland Dreier <rolandd@cisco.com>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      454e2398
  19. 11 4月, 2006 1 次提交
  20. 26 3月, 2006 2 次提交
  21. 03 1月, 2006 1 次提交
  22. 07 11月, 2005 2 次提交
  23. 10 9月, 2005 1 次提交
  24. 17 4月, 2005 1 次提交
    • L
      Linux-2.6.12-rc2 · 1da177e4
      Linus Torvalds 提交于
      Initial git repository build. I'm not bothering with the full history,
      even though we have it. We can create a separate "historical" git
      archive of that later if we want to, and in the meantime it's about
      3.2GB when imported into git - space that would just make the early
      git days unnecessarily complicated, when we don't have a lot of good
      infrastructure for it.
      
      Let it rip!
      1da177e4