1. 05 1月, 2009 19 次提交
    • S
      GFS2: Move gfs2_recoverd into recovery.c · 9ac1b4d9
      Steven Whitehouse 提交于
      By moving gfs2_recoverd, we can make an additional function static
      and it also leaves only (the already scheduled for removal) gfs2_glockd
      in daemon.c.
      
      At the same time the declaration of gfs2_quotad is moved to quota.h
      to reflect the new location of gfs2_quotad in a previous patch. Also
      the recovery.h and quota.h headers are cleaned up.
      Signed-off-by: NSteven Whitehouse <swhiteho@redhat.com>
      9ac1b4d9
    • S
      GFS2: Fix "truncate in progress" hang · 813e0c46
      Steven Whitehouse 提交于
      Following on from the recent clean up of gfs2_quotad, this patch moves
      the processing of "truncate in progress" inodes from the glock workqueue
      into gfs2_quotad. This fixes a hang due to the "truncate in progress"
      processing requiring glocks in order to complete.
      
      It might seem odd to use gfs2_quotad for this particular item, but
      we have to use a pre-existing thread since creating a thread implies
      a GFP_KERNEL memory allocation which is not allowed from the glock
      workqueue context. Of the existing threads, gfs2_logd and gfs2_recoverd
      may deadlock if used for this operation. gfs2_scand and gfs2_glockd are
      both scheduled for removal at some (hopefully not too distant) future
      point. That leaves only gfs2_quotad whose workload is generally fairly
      light and is easily adapted for this extra task.
      
      Also, as a result of this change, it opens the way for a future patch to
      make the reading of the inode's information asynchronous with respect to
      the glock workqueue, which is another improvement that has been on the list
      for some time now.
      Signed-off-by: NSteven Whitehouse <swhiteho@redhat.com>
      813e0c46
    • S
      GFS2: Clean up & move gfs2_quotad · 37b2c837
      Steven Whitehouse 提交于
      This patch is a clean up of gfs2_quotad prior to giving it an
      extra job to do in addition to the current portfolio of updating
      the quota and statfs information from time to time.
      
      As a result it has been moved into quota.c allowing one of the
      functions it calls to be made static. Also the clean up allows
      the two existing functions to have separate timeouts and also
      to coexist with its future role of dealing with the "truncate in
      progress" inode flag.
      
      The (pointless) setting of gfs2_quotad_secs is removed since we
      arrange to only wake up quotad when one of the two timers expires.
      
      In addition the struct gfs2_quota_data is moved into a slab cache,
      mainly for easier debugging. It should also be possible to use
      a shrinker in the future, rather than the current scheme of scanning
      the quota data entries from time to time.
      Signed-off-by: NSteven Whitehouse <swhiteho@redhat.com>
      37b2c837
    • S
      GFS2: Add more detail to debugfs glock dumps · fa75cedc
      Steven Whitehouse 提交于
      Although the glock dumps print quite a lot of information about
      the glocks themselves, there are more things which can be
      usefully added to the dump realting to the objects themselves.
      
      This patch adds a few more fields to the inode and resource
      group lines, which should be useful for debugging.
      Signed-off-by: NSteven Whitehouse <swhiteho@redhat.com>
      fa75cedc
    • S
      GFS2: Banish struct gfs2_rgrpd_host · 73f74948
      Steven Whitehouse 提交于
      This patch moves the final field so that we can get rid
      of struct gfs2_rgrpd_host, as promised some time ago. Also
      by rearranging the fields slightly, we are able to reduce
      the size of the gfs2_rgrpd structure at the same time.
      Signed-off-by: NSteven Whitehouse <swhiteho@redhat.com>
      73f74948
    • S
      GFS2: Move rg_free from gfs2_rgrpd_host to gfs2_rgrpd · cfc8b549
      Steven Whitehouse 提交于
      The second of three fields which need to move, in order
      to remove the struct gfs2_rgrpd_host.
      Signed-off-by: NSteven Whitehouse <swhiteho@redhat.com>
      cfc8b549
    • S
      GFS2: Move rg_igeneration into struct gfs2_rgrpd · d8b71f73
      Steven Whitehouse 提交于
      This moves one of the fields of struct gfs2_rgrpd_host into
      the struct gfs2_rgrpd with the eventual aim of removing
      the struct rgrpd_host completely.
      Signed-off-by: NSteven Whitehouse <swhiteho@redhat.com>
      d8b71f73
    • S
      GFS2: Banish struct gfs2_dinode_host · 383f01fb
      Steven Whitehouse 提交于
      The final field in gfs2_dinode_host was the i_flags field. Thats
      renamed to i_diskflags in order to avoid confusion with the existing
      inode flags, and moved into the inode proper at a suitable location
      to avoid creating a "hole".
      
      At that point struct gfs2_dinode_host is no longer needed and as
      promised (quite some time ago!) it can now be removed completely.
      Signed-off-by: NSteven Whitehouse <swhiteho@redhat.com>
      383f01fb
    • S
      GFS2: Move i_size from gfs2_dinode_host and rename it to i_disksize · c9e98886
      Steven Whitehouse 提交于
      This patch moved the i_size field from the gfs2_dinode_host and
      following the ext3 convention renames it i_disksize.
      Signed-off-by: NSteven Whitehouse <swhiteho@redhat.com>
      c9e98886
    • S
      GFS2: Move di_eattr into "proper" inode · 3767ac21
      Steven Whitehouse 提交于
      This moves the di_eattr field out of gfs2_inode_host and
      into the inode proper.
      Signed-off-by: NSteven Whitehouse <swhiteho@redhat.com>
      3767ac21
    • S
      GFS2: Move "entries" into "proper" inode · ad6203f2
      Steven Whitehouse 提交于
      This moves the directory entry count into the proper inode.
      Potentially we could get this to share the space used by
      something else in the future, but this is one more step
      on the way to removing the gfs2_dinode_host structure.
      Signed-off-by: NSteven Whitehouse <swhiteho@redhat.com>
      ad6203f2
    • S
      GFS2: Move generation number into "proper" part of inode · bcf0b5b3
      Steven Whitehouse 提交于
      This moves the generation number from the gfs2_dinode_host
      into the gfs2_inode structure. Eventually the plan is to get
      rid of the gfs2_dinode_host structure completely.
      Signed-off-by: NSteven Whitehouse <swhiteho@redhat.com>
      bcf0b5b3
    • H
      GFS2: sparse annotation of gl->gl_spin · 55ba474d
      Harvey Harrison 提交于
      fs/gfs2/glock.c:308:5: warning: context problem in 'do_promote': '_spin_unlock' expected different context
      fs/gfs2/glock.c:308:5:    context '*gl+28': wanted >= 1, got 0
      fs/gfs2/glock.c:529:2: warning: context problem in 'do_xmote': '_spin_unlock' expected different context
      fs/gfs2/glock.c:529:2:    context '*gl+28': wanted >= 1, got 0
      fs/gfs2/glock.c:925:3: warning: context problem in 'add_to_queue': '_spin_unlock' expected different context
      fs/gfs2/glock.c:925:3:    context '*gl+28': wanted >= 1, got 0
      Signed-off-by: NHarvey Harrison <harvey.harrison@gmail.com>
      Signed-off-by: NSteven Whitehouse <swhiteho@redhat.com>
      55ba474d
    • S
      GFS2: Fix up jdata writepage/delete_inode · 1bb7322f
      Steven Whitehouse 提交于
      There is a bug in writepage and delete_inode which allows jdata files to
      invalidate pages from the address space without being in a transaction at
      the time. This causes problems in case the pages are in the journal. This
      patch fixes that case and prevents the resulting oops.
      Signed-off-by: NSteven Whitehouse <swhiteho@redhat.com>
      1bb7322f
    • S
      GFS2: Rationalise header files · b2760583
      Steven Whitehouse 提交于
      Move the contents of some headers which contained very
      little into more sensible places, and remove the original
      header files. This should make it easier to find things.
      Signed-off-by: NSteven Whitehouse <swhiteho@redhat.com>
      b2760583
    • S
      GFS2: Support for FIEMAP ioctl · e9079cce
      Steven Whitehouse 提交于
      This patch implements the FIEMAP ioctl for GFS2. We can use the generic
      code (aside from a lock order issue, solved as per Ted Tso's suggestion)
      for which I've introduced a new variant of the generic function. We also
      have one exception to deal with, namely stuffed files, so we do that
      "by hand", setting all the required flags.
      
      This has been tested with a modified (I could only find an old version) of
      Eric's test program, and appears to work correctly.
      
      This patch does not currently support FIEMAP of xattrs, but the plan is to add
      that feature at some future point.
      Signed-off-by: NSteven Whitehouse <swhiteho@redhat.com>
      Cc: Theodore Tso <tytso@mit.edu>
      Cc: Eric Sandeen <sandeen@redhat.com>
      e9079cce
    • N
      fs: symlink write_begin allocation context fix · 54566b2c
      Nick Piggin 提交于
      With the write_begin/write_end aops, page_symlink was broken because it
      could no longer pass a GFP_NOFS type mask into the point where the
      allocations happened.  They are done in write_begin, which would always
      assume that the filesystem can be entered from reclaim.  This bug could
      cause filesystem deadlocks.
      
      The funny thing with having a gfp_t mask there is that it doesn't really
      allow the caller to arbitrarily tinker with the context in which it can be
      called.  It couldn't ever be GFP_ATOMIC, for example, because it needs to
      take the page lock.  The only thing any callers care about is __GFP_FS
      anyway, so turn that into a single flag.
      
      Add a new flag for write_begin, AOP_FLAG_NOFS.  Filesystems can now act on
      this flag in their write_begin function.  Change __grab_cache_page to
      accept a nofs argument as well, to honour that flag (while we're there,
      change the name to grab_cache_page_write_begin which is more instructive
      and does away with random leading underscores).
      
      This is really a more flexible way to go in the end anyway -- if a
      filesystem happens to want any extra allocations aside from the pagecache
      ones in ints write_begin function, it may now use GFP_KERNEL (rather than
      GFP_NOFS) for common case allocations (eg.  ocfs2_alloc_write_ctxt, for a
      random example).
      
      [kosaki.motohiro@jp.fujitsu.com: fix ubifs]
      [kosaki.motohiro@jp.fujitsu.com: fix fuse]
      Signed-off-by: NNick Piggin <npiggin@suse.de>
      Reviewed-by: NKOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
      Cc: <stable@kernel.org>		[2.6.28.x]
      Signed-off-by: NKOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      [ Cleaned up the calling convention: just pass in the AOP flags
        untouched to the grab_cache_page_write_begin() function.  That
        just simplifies everybody, and may even allow future expansion of the
        logic.   - Linus ]
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      54566b2c
    • P
      fs: introduce bgl_lock_ptr() · c644f0e4
      Pekka Enberg 提交于
      As suggested by Andreas Dilger, introduce a bgl_lock_ptr() helper in
      <linux/blockgroup_lock.h> and add separate sb_bgl_lock() helpers to
      filesystem specific header files to break the hidden dependency to
      struct ext[234]_sb_info.
      
      Also, while at it, convert the macros to static inlines to try make up
      for all the times I broke Andrew Morton's tree.
      Acked-by: NAndreas Dilger <adilger@sun.com>
      Signed-off-by: NPekka Enberg <penberg@cs.helsinki.fi>
      Cc: <linux-ext4@vger.kernel.org>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      c644f0e4
    • A
      sanitize audit_fd_pair() · 157cf649
      Al Viro 提交于
      * no allocations
      * return void
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      157cf649
  2. 04 1月, 2009 3 次提交
  3. 03 1月, 2009 10 次提交
    • D
      CRED: Wrap task credential accesses in the devpts filesystem · d0eafc7d
      David Howells 提交于
      Wrap access to task credentials so that they can be separated more easily from
      the task_struct during the introduction of COW creds.
      
      Change most current->(|e|s|fs)[ug]id to current_(|e|s|fs)[ug]id().
      
      Change some task->e?[ug]id to task_e?[ug]id().  In some places it makes more
      sense to use RCU directly rather than a convenient wrapper; these will be
      addressed by later patches.
      Signed-off-by: NDavid Howells <dhowells@redhat.com>
      Signed-off-by: NAlan Cox <alan@redhat.com>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      d0eafc7d
    • A
      devpts: fix unused function warning · 8c056e5b
      Andrew Morton 提交于
      fs/devpts/inode.c:324: warning: 'compare_init_pts_sb' defined but not used
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NAlan Cox <alan@redhat.com>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      8c056e5b
    • A
      devpts: Coding style clean up · 835aa440
      Alan Cox 提交于
      Just nail the oddments now while this code is being touched
      Signed-off-by: NAlan Cox <alan@redhat.com>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      835aa440
    • S
      Enable multiple instances of devpts · 2a1b2dc0
      Sukadev Bhattiprolu 提交于
      To support containers, allow multiple instances of devpts filesystem, such
      that indices of ptys allocated in one instance are independent of ptys
      allocated in other instances of devpts.
      
      But to preserve backward compatibility, enable this support for multiple
      instances only if:
      
      	- CONFIG_DEVPTS_MULTIPLE_INSTANCES is set to Y, and
      	- '-o newinstance' mount option is specified while mounting devpts
      
      To use multi-instance mount, a container startup script could:
      
      	$ ns_exec -cm /bin/bash
      	$ umount /dev/pts
      	$ mount -t devpts -o newinstance lxcpts /dev/pts
      	$ mount -o bind /dev/pts/ptmx /dev/ptmx
      	$ /usr/sbin/sshd -p 1234
      
      where 'ns_exec -cm /bin/bash' is calls clone() with CLONE_NEWNS flag and execs
      /bin/bash in the child process. A pty created by the sshd is not visible in
      the original mount of /dev/pts.
      
      USER-SPACE-IMPACT:
      	- See Documentation/fs/devpts.txt (included in next patch) for user-
      	  space impact in multi-instance and mixed-mode operation.
      TODO:
      	- Update mount(8), pts(4) man pages. Highlight impact of not
      	  redirecting /dev/ptmx to /dev/pts/ptmx after a multi-instance mount.
      
      Changelog[v6]:
      	- [Dave Hansen] Use new get_init_pts_sb() interface
      	- [Serge Hallyn] Don't bother displaying 'newinstance' in show_options
      	- [Serge Hallyn] Use macros (PARSE_REMOUNT/PARSE_MOUNT) instead of 0/1.
      	- [Serge Hallyn] Check error return from get_sb_single() (now
      	  get_init_pts_sb())
      	- devpts_pty_kill(): don't dput error dentries
      
      Changelog[v5]:
      	- Move get_sb_ref() definition to earlier patch
      	- Move usage info to Documentation/filesystems/devpts.txt (next patch)
      	- Make ptmx node even in init_pts_ns, now that default mode is 0000
      	  (defined in earlier patch, enabled here).
      	- Cache ptmx dentry and use to update mode during remount
      	  (defined in earlier patch, enabled here).
      	- Bugfix: explicitly ignore newinstance on remount (if newinstance was
      	  specified on remount of initial mount, it would be ignored but
      	  /proc/mounts would imply that the option was set)
      
      Changelog[v4]:
      
      	- Update patch description to address H. Peter Anvin's comments
      	- Consolidate multi-instance mode code under new config token,
      	  CONFIG_DEVPTS_MULTIPLE_INSTANCE.
      	- Move usage-details from patch description to
      	  Documentation/fs/devpts.txt
      
      Changelog[v3]:
      	- Rename new mount option to 'newinstance'
      	- Create ptmx nodes only in 'newinstance' mounts
      	- Bugfix: parse_mount_options() modifies @data but since we need to
      	  parse the @data twice (once in devpts_get_sb() and once during
      	  do_remount_sb()), parse a local copy of @data in devpts_get_sb().
      	  (restructured code in devpts_get_sb() to fix this)
      
      Changelog[v2]:
      	- Support both single-mount and multiple-mount semantics and
      	  provide '-onewmnt' option to select the semantics.
      Signed-off-by: NSukadev Bhattiprolu <sukadev@linux.vnet.ibm.com>
      Signed-off-by: NAlan Cox <alan@redhat.com>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      2a1b2dc0
    • S
      Define get_init_pts_sb() · d4076ac5
      Sukadev Bhattiprolu 提交于
      See comments in the function header for details. The new interface will
      be used in a follow-on patch.
      
      Changelog [v2]:
      	[Dave Hansen] Replace get_sb_ref() in fs/super.c with get_init_pts_sb()
      	and make the new interface private to devpts
      Signed-off-by: NSukadev Bhattiprolu <sukadev@linux.vnet.ibm.com>
      Signed-off-by: NAlan Cox <alan@redhat.com>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      d4076ac5
    • S
      Define mknod_ptmx() · 1f8f1e29
      Sukadev Bhattiprolu 提交于
      /dev/ptmx is closely tied to the devpts filesystem. An open of /dev/ptmx,
      allocates the next pty index and the associated device shows up in the
      devpts fs as /dev/pts/n.
      
      Wih multiple instancs of devpts filesystem, during an open of /dev/ptmx
      we would be unable to determine which instance of the devpts is being
      accessed.
      
      So we move the 'ptmx' node into /dev/pts and use the inode of the 'ptmx'
      node to identify the superblock and hence the devpts instance.  This patch
      adds ability for the kernel to internally create the [ptmx, c, 5:2] device
      when mounting devpts filesystem.  Since the ptmx node in devpts is new and
      may surprise some userspace scripts, the default permissions for the new
      node is 0000.  These permissions can be changed either using chmod or by
      remounting with the new '-o ptmxmode=0666' mount option.
      
      Changelog[v5]:
      	- [Serge Hallyn bugfix]: Letting new_inode() assign inode number to
      	  ptmx can collide with hand-assigning inode numbers to ptys. So,
      	  hand-assign specific inode number to ptmx node also.
      	- [Serge Hallyn]: Maybe safer to grab root dentry mutex while creating
      	  ptmx node
      	- [Bugfix with Serge Hallyn] Replace lookup_one_len() in mknod_ptmx()
      	  wih d_alloc_name() (lookup during ->get_sb() locks up system). To
      	  simplify patchset, fold the ptmx_dentry patch into this.
      
      Changelog[v4]:
      	- Change default permissions of pts/ptmx node to 0000.
      	- Move code for ptmxmode under #ifdef CONFIG_DEVPTS_MULTIPLE_INSTANCES.
      
      Changelog[v3]:
      	- Rename ptmx_mode to ptmxmode (for consistency with 'newinstance')
      
      Changelog[v2]:
      	- [H. Peter Anvin] Remove mknod() system call support and create the
      	  ptmx node internally.
      
      Changelog[v1]:
      	- Earlier version of this patch enabled creating /dev/pts/tty as
      	  well. As pointed out by Al Viro and H. Peter Anvin, that is not
      	  really necessary.
      Signed-off-by: NSukadev Bhattiprolu <sukadev@linux.vnet.ibm.com>
      Signed-off-by: NAlan Cox <alan@redhat.com>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      1f8f1e29
    • S
      Extract option parsing to new function · 53af8ee4
      Sukadev Bhattiprolu 提交于
      Move code to parse mount options into a separate function so it can
      (later) be shared between mount and remount operations.
      Signed-off-by: NSukadev Bhattiprolu <sukadev@linux.vnet.ibm.com>
      Signed-off-by: NAlan Cox <alan@redhat.com>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      53af8ee4
    • S
      Per-mount 'config' object · 31af0abb
      Sukadev Bhattiprolu 提交于
      With support for multiple mounts of devpts, the 'config' structure really
      represents per-mount options rather than config parameters. Rename 'config'
      structure to 'pts_mount_opts' and store it in the super-block.
      Signed-off-by: NSukadev Bhattiprolu <sukadev@linux.vnet.ibm.com>
      Signed-off-by: NAlan Cox <alan@redhat.com>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      31af0abb
    • S
      Per-mount allocated_ptys · e76b7c01
      Sukadev Bhattiprolu 提交于
      To enable multiple mounts of devpts, 'allocated_ptys' must be a per-mount
      variable rather than a global variable.  Move 'allocated_ptys' into the
      super_block's s_fs_info.
      
      Changelog[v2]:
      	Define and use DEVPTS_SB() wrapper.
      Signed-off-by: NSukadev Bhattiprolu <sukadev@linux.vnet.ibm.com>
      Signed-off-by: NAlan Cox <alan@redhat.com>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      e76b7c01
    • S
      Remove devpts_root global · 59e55e6c
      Sukadev Bhattiprolu 提交于
      Remove the 'devpts_root' global variable and find the root dentry using
      the super_block. The super-block can be found from the device inode, using
      the new wrapper, pts_sb_from_inode().
      
      Changelog: This patch is based on an earlier patchset from Serge Hallyn
      	   and Matt Helsley.
      Signed-off-by: NSukadev Bhattiprolu <sukadev@linux.vnet.ibm.com>
      Signed-off-by: NAlan Cox <alan@redhat.com>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      59e55e6c
  4. 01 1月, 2009 8 次提交