1. 01 8月, 2013 1 次提交
    • J
      cifs: fix bad error handling in crypto code · ba482029
      Jeff Layton 提交于
      Jarod reported an Oops like when testing with fips=1:
      
      CIFS VFS: could not allocate crypto hmacmd5
      CIFS VFS: could not crypto alloc hmacmd5 rc -2
      CIFS VFS: Error -2 during NTLMSSP authentication
      CIFS VFS: Send error in SessSetup = -2
      BUG: unable to handle kernel NULL pointer dereference at 000000000000004e
      IP: [<ffffffff812b5c7a>] crypto_destroy_tfm+0x1a/0x90
      PGD 0
      Oops: 0000 [#1] SMP
      Modules linked in: md4 nls_utf8 cifs dns_resolver fscache kvm serio_raw virtio_balloon virtio_net mperf i2c_piix4 cirrus drm_kms_helper ttm drm i2c_core virtio_blk ata_generic pata_acpi
      CPU: 1 PID: 639 Comm: mount.cifs Not tainted 3.11.0-0.rc3.git0.1.fc20.x86_64 #1
      Hardware name: Bochs Bochs, BIOS Bochs 01/01/2011
      task: ffff88007bf496e0 ti: ffff88007b080000 task.ti: ffff88007b080000
      RIP: 0010:[<ffffffff812b5c7a>]  [<ffffffff812b5c7a>] crypto_destroy_tfm+0x1a/0x90
      RSP: 0018:ffff88007b081d10  EFLAGS: 00010282
      RAX: 0000000000001f1f RBX: ffff880037422000 RCX: ffff88007b081fd8
      RDX: 000000000000001f RSI: 0000000000000006 RDI: fffffffffffffffe
      RBP: ffff88007b081d30 R08: ffff880037422000 R09: ffff88007c090100
      R10: 0000000000000000 R11: 00000000fffffffe R12: fffffffffffffffe
      R13: ffff880037422000 R14: ffff880037422000 R15: 00000000fffffffe
      FS:  00007fc322f4f780(0000) GS:ffff88007fc80000(0000) knlGS:0000000000000000
      CS:  0010 DS: 0000 ES: 0000 CR0: 000000008005003b
      CR2: 000000000000004e CR3: 000000007bdaa000 CR4: 00000000000006e0
      Stack:
       ffffffff81085845 ffff880037422000 ffff8800375e7400 ffff880037422000
       ffff88007b081d48 ffffffffa0176022 ffff880037422000 ffff88007b081d60
       ffffffffa015c07b ffff880037600600 ffff88007b081dc8 ffffffffa01610e1
      Call Trace:
       [<ffffffff81085845>] ? __cancel_work_timer+0x75/0xf0
       [<ffffffffa0176022>] cifs_crypto_shash_release+0x82/0xf0 [cifs]
       [<ffffffffa015c07b>] cifs_put_tcp_session+0x8b/0xe0 [cifs]
       [<ffffffffa01610e1>] cifs_mount+0x9d1/0xad0 [cifs]
       [<ffffffffa014ff50>] cifs_do_mount+0xa0/0x4d0 [cifs]
       [<ffffffff811ab6e9>] mount_fs+0x39/0x1b0
       [<ffffffff811c466f>] vfs_kern_mount+0x5f/0xf0
       [<ffffffff811c6a9e>] do_mount+0x23e/0xa20
       [<ffffffff811c66e6>] ? copy_mount_options+0x36/0x170
       [<ffffffff811c7303>] SyS_mount+0x83/0xc0
       [<ffffffff8165c8d9>] system_call_fastpath+0x16/0x1b
      Code: eb 9e 66 66 66 66 66 66 2e 0f 1f 84 00 00 00 00 00 66 66 66 66 90 55 48 89 e5 41 55 41 54 49 89 fc 53 48 83 ec 08 48 85 ff 74 46 <48> 83 7e 48 00 48 8b 5e 50 74 4b 48 89 f7 e8 83 fc ff ff 4c 8b
      RIP  [<ffffffff812b5c7a>] crypto_destroy_tfm+0x1a/0x90
       RSP <ffff88007b081d10>
      CR2: 000000000000004e
      
      The cifs code allocates some crypto structures. If that fails, it
      returns an error, but it leaves the pointers set to their PTR_ERR
      values. Then later when it tries to clean up, it sees that those values
      are non-NULL and then passes them to the routine that frees them.
      
      Fix this by setting the pointers to NULL after collecting the error code
      in this situation.
      
      Cc: Sachin Prabhu <sprabhu@redhat.com>
      Reported-by: NJarod Wilson <jarod@redhat.com>
      Signed-off-by: NJeff Layton <jlayton@redhat.com>
      Signed-off-by: NSteve French <smfrench@gmail.com>
      ba482029
  2. 31 7月, 2013 3 次提交
  3. 17 7月, 2013 2 次提交
  4. 14 7月, 2013 3 次提交
  5. 13 7月, 2013 6 次提交
  6. 12 7月, 2013 6 次提交
    • A
      ext4: rate limit printk in buffer_io_error() · e8974c39
      Anatol Pomozov 提交于
      If there are a lot of outstanding buffered IOs when a device is
      taken offline (due to hardware errors etc), ext4_end_bio prints
      out a message for each failed logical block. While this is desirable,
      we see thousands of such lines being printed out before the
      serial console gets overwhelmed, causing ext4_end_bio() wait for
      the printk to complete.
      
      This in itself isn't a disaster, except for the detail that this
      function is being called with the queue lock held.
      This causes any other function in the block layer
      to spin on its spin_lock_irqsave while the serial console is
      draining. If NMI watchdog is enabled on this machine then it
      eventually comes along and shoots the machine in the head.
      
      The end result is that losing any one disk causes the machine to
      go down. This patch rate limits the printk to bandaid around the
      problem.
      
      Tested: xfstests
      Change-Id: I8ab5690dcf4f3a67e78be147d45e489fdf4a88d8
      Signed-off-by: NAnatol Pomozov <anatol.pomozov@gmail.com>
      Signed-off-by: N"Theodore Ts'o" <tytso@mit.edu>
      e8974c39
    • P
      CIFS: Fix a deadlock when a file is reopened · 689c3db4
      Pavel Shilovsky 提交于
      If we request reading or writing on a file that needs to be
      reopened, it causes the deadlock: we are already holding rw
      semaphore for reading and then we try to acquire it for writing
      in cifs_relock_file. Fix this by acquiring the semaphore for
      reading in cifs_relock_file due to we don't make any changes in
      locks and don't need a write access.
      
      CC: <stable@vger.kernel.org>
      Signed-off-by: NPavel Shilovsky <pshilovsky@samba.org>
      Acked-by: NJeff Layton <jlayton@redhat.com>
      Signed-off-by: NSteve French <smfrench@gmail.com>
      689c3db4
    • P
      CIFS: Reopen the file if reconnect durable handle failed · b33fcf1c
      Pavel Shilovsky 提交于
      This is a follow-on patch for 8/8 patch from the durable handles
      series. It fixes the problem when durable file handle timeout
      expired on the server and reopen returns -ENOENT for such files.
      Signed-off-by: NPavel Shilovsky <pshilovsky@samba.org>
      Signed-off-by: NSteve French <smfrench@gmail.com>
      b33fcf1c
    • T
      ext4: don't show usrquota/grpquota twice in /proc/mounts · ad065dd0
      Theodore Ts'o 提交于
      We now print mount options in a generic fashion in
      ext4_show_options(), so we shouldn't be explicitly printing the
      {usr,grp}quota options in ext4_show_quota_options().
      
      Without this patch, /proc/mounts can look like this:
      
       /dev/vdb /vdb ext4 rw,relatime,quota,usrquota,data=ordered,usrquota 0 0
                                            ^^^^^^^^              ^^^^^^^^
      Signed-off-by: N"Theodore Ts'o" <tytso@mit.edu>
      Cc: stable@vger.kernel.org
      ad065dd0
    • C
      xfs: Fix the logic check for all quotas being turned off · c31ad439
      Chandra Seetharaman 提交于
      During the review of seperate pquota inode patches, David noticed
      that the test to detect all quotas being turned off was
      incorrect, and hence the block was not freeing all the quota
      information.
      
      The check made sense in Irix, but in Linux, quota is turned off
      one at a time, which makes the test invalid for Linux.
      
      This problem existed since XFS was ported to Linux.
      
      David suggested to fix the problem by detecting when all quotas are
      turned off by checking m_qflags.
      Signed-off-by: NChandra Seetharaman <sekharan@us.ibm.com>
      Reviewed-by: NBen Myers <bpm@sgi.com>
      Signed-off-by: NBen Myers <bpm@sgi.com>
      c31ad439
    • D
      lockd: protect nlm_blocked access in nlmsvc_retry_blocked · 1c327d96
      David Jeffery 提交于
      In nlmsvc_retry_blocked, the check that the list is non-empty and acquiring
      the pointer of the first entry is unprotected by any lock.  This allows a rare
      race condition when there is only one entry on the list.  A function such as
      nlmsvc_grant_callback() can be called, which will temporarily remove the entry
      from the list.  Between the list_empty() and list_entry(),the list may become
      empty, causing an invalid pointer to be used as an nlm_block, leading to a
      possible crash.
      
      This patch adds the nlm_block_lock around these calls to prevent concurrent
      use of the nlm_blocked list.
      
      This was a regression introduced by
      f904be9c  "lockd: Mostly remove BKL from
      the server".
      
      Cc: Bryan Schumaker <bjschuma@netapp.com>
      Cc: stable@vger.kernel.org
      Signed-off-by: NDavid Jeffery <djeffery@redhat.com>
      Signed-off-by: NJ. Bruce Fields <bfields@redhat.com>
      1c327d96
  7. 11 7月, 2013 13 次提交
  8. 10 7月, 2013 6 次提交
    • C
      xfs: fix sgid inheritance for subdirectories inheriting default acls [V3] · 42c49d7f
      Carlos Maiolino 提交于
      XFS removes sgid bits of subdirectories under a directory containing a default
      acl.
      
      When a default acl is set, it implies xfs to call xfs_setattr_nonsize() in its
      code path. Such function is shared among mkdir and chmod system calls, and
      does some checks unneeded by mkdir (calling inode_change_ok()). Such checks
      remove sgid bit from the inode after it has been granted.
      
      With this patch, we extend the meaning of XFS_ATTR_NOACL flag to avoid these
      checks when acls are being inherited (thanks hch).
      
      Also, xfs_setattr_mode, doesn't need to re-check for group id and capabilities
      permissions, this only implies in another try to remove sgid bit from the
      directories. Such check is already done either on inode_change_ok() or
      xfs_setattr_nonsize().
      
      Changelog:
      
      V2: Extends the meaning of XFS_ATTR_NOACL instead of wrap the tests into another
          function
      
      V3: Remove S_ISDIR check in xfs_setattr_nonsize() from the patch
      Signed-off-by: NCarlos Maiolino <cmaiolino@redhat.com>
      Reviewed-by: NBen Myers <bpm@sgi.com>
      Signed-off-by: NBen Myers <bpm@sgi.com>
      42c49d7f
    • M
      Use ecryptfs_dentry_to_lower_path in a couple of places · cc18ec3c
      Matthew Wilcox 提交于
      There are two places in ecryptfs that benefit from using
      ecryptfs_dentry_to_lower_path() instead of separate calls to
      ecryptfs_dentry_to_lower() and ecryptfs_dentry_to_lower_mnt().  Both
      sites use fewer instructions and less stack (determined by examining
      objdump output).
      Signed-off-by: NMatthew Wilcox <willy@linux.intel.com>
      Signed-off-by: NTyler Hicks <tyhicks@canonical.com>
      cc18ec3c
    • S
      NFS: Allow nfs_updatepage to extend a write under additional circumstances · c7559663
      Scott Mayhew 提交于
      Currently nfs_updatepage allows a write to be extended to cover a full
      page only if we don't have a byte range lock lock on the file... but if
      we have a write delegation on the file or if we have the whole file
      locked for writing then we should be allowed to extend the write as
      well.
      Signed-off-by: NScott Mayhew <smayhew@redhat.com>
      [Trond: fix up call to nfs_have_delegation()]
      Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
      c7559663
    • D
      xfs: dquot log reservations are too small · b0a9dab7
      Dave Chinner 提交于
      During review of the separate project quota inode patches, it became
      obvious that the dquot log reservation calculation underestimated
      the number dquots that can be modified in a transaction. This has
      it's roots way back in the Irix quota implementation.
      
      That is, when quotas were first implemented in XFS, it only
      supported user and project quotas as Irix did not have group quotas.
      Hence the worst case operation involving dquot modification was
      calculated to involve 2 user dquots and 1 project dquot or 1 user
      dequot and 2 project dquots. i.e. 3 dquots. This was determined back
      in 1996, and has remained unchanged ever since.
      
      However, back in 2001, the Linux XFS port dropped all support for
      project quota and implmented group quotas over the top. This was
      effectively done with a search-and-replace of project with group,
      and as such the log reservation was not changed. However, with the
      advent of group quotas, chmod and rename now could modify more than
      3 dquots in a single transaction - both could modify 4 dquots. Hence
      this log reservation has been wrong for a long time.
      
      In 2005, project quota support was reintroduced into Linux, but it
      was implemented to be mutually exclusive to group quotas and so this
      didn't add any new changes to the dquot log reservation. Hence when
      project quotas were in use (rather than group quotas) the log
      reservation was again valid, just like in the Irix days.
      
      Now, with the addition of the separate project quota inode, group
      and project quotas are no longer mutually exclusive, and hence
      operations can now modify three dquots per inode where previously it
      was only two. The worst case here is the rename transaction, which
      can allocate/free space on two different directory inodes, and if
      they have different uid/gid/prid configurations and are world
      writeable, then rename can actually modify 6 different dquots now.
      
      Further, the dquot log reservation doesn't take into account the
      space used by the dquot log format structure that precedes the dquot
      that is logged, and hence further underestimates the worst case
      log space required by dquots during a transaction. This has been
      missing since the first commit in 1996.
      
      Hence the worst case log reservation needs to be increased from 3 to
      6, and it needs to take into account a log format header for each of
      those dquots.
      Signed-off-by: NDave Chinner <dchinner@redhat.com>
      Reviewed-by: NMark Tinguely <tinguely@sgi.com>
      Signed-off-by: NBen Myers <bpm@sgi.com>
      b0a9dab7
    • D
      xfs: remove local fork format handling from xfs_bmapi_write() · f3508bcd
      Dave Chinner 提交于
      The conversion from local format to extent format requires
      interpretation of the data in the fork being converted, so it cannot
      be done in a generic way. It is up to the caller to convert the fork
      format to extent format before calling into xfs_bmapi_write() so
      format conversion can be done correctly.
      
      The code in xfs_bmapi_write() to convert the format is used
      implicitly by the attribute and directory code, but they
      specifically zero the fork size so that the conversion does not do
      any allocation or manipulation. Move this conversion into the
      shortform to leaf functions for the dir/attr code so the conversions
      are explicitly controlled by all callers.
      
      Now we can remove the conversion code in xfs_bmapi_write.
      Signed-off-by: NDave Chinner <dchinner@redhat.com>
      Reviewed-by: NMark Tinguely <tinguely@sgi.com>
      Signed-off-by: NBen Myers <bpm@sgi.com>
      f3508bcd
    • S
      NFS: Make nfs_readdir revalidate less often · 07b5ce8e
      Scott Mayhew 提交于
      Make nfs_readdir revalidate only when we're at the beginning of the directory or
      if the cached attributes have expired.
      Signed-off-by: NScott Mayhew <smayhew@redhat.com>
      Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
      07b5ce8e