1. 30 1月, 2015 6 次提交
  2. 28 1月, 2015 2 次提交
    • J
      quota: Switch ->get_dqblk() and ->set_dqblk() to use bytes as space units · 14bf61ff
      Jan Kara 提交于
      Currently ->get_dqblk() and ->set_dqblk() use struct fs_disk_quota which
      tracks space limits and usage in 512-byte blocks. However VFS quotas
      track usage in bytes (as some filesystems require that) and we need to
      somehow pass this information. Upto now it wasn't a problem because we
      didn't do any unit conversion (thus VFS quota routines happily stuck
      number of bytes into d_bcount field of struct fd_disk_quota). Only if
      you tried to use Q_XGETQUOTA or Q_XSETQLIM for VFS quotas (or Q_GETQUOTA
      / Q_SETQUOTA for XFS quotas), you got bogus results. Hardly anyone
      tried this but reportedly some Samba users hit the problem in practice.
      So when we want interfaces compatible we need to fix this.
      
      We bite the bullet and define another quota structure used for passing
      information from/to ->get_dqblk()/->set_dqblk. It's somewhat sad we have
      to have more conversion routines in fs/quota/quota.c and another copying
      of quota structure slows down getting of quota information by about 2%
      but it seems cleaner than overloading e.g. units of d_bcount to bytes.
      
      CC: stable@vger.kernel.org
      Reviewed-by: NChristoph Hellwig <hch@lst.de>
      Signed-off-by: NJan Kara <jack@suse.cz>
      14bf61ff
    • J
      udf: Release preallocation on last writeable close · b07ef352
      Jan Kara 提交于
      Commit 6fb1ca92 "udf: Fix race between write(2) and close(2)"
      changed the condition when preallocation is released. The idea was that
      we don't want to release the preallocation for an inode on close when
      there are other writeable file descriptors for the inode. However the
      condition was written in the opposite way so we released preallocation
      only if there were other writeable file descriptors. Fix the problem by
      changing the condition properly.
      
      CC: stable@vger.kernel.org
      Fixes: 6fb1ca92Reported-by: NFabian Frederick <fabf@skynet.be>
      Signed-off-by: NJan Kara <jack@suse.cz>
      b07ef352
  3. 22 1月, 2015 7 次提交
    • J
      xfs: Remove some pointless quota checks · a3942700
      Jan Kara 提交于
      xfs_fs_get_xstate() and xfs_fs_get_xstatev() check whether there's quota
      running before calling xfs_qm_scall_getqstat() or
      xfs_qm_scall_getqstatv(). Thus we are certain that superblock supports
      quota and xfs_sb_version_hasquota() check is pointless. Similarly we
      know that when quota is running, mp->m_quotainfo will be allocated.
      Reviewed-by: NBrian Foster <bfoster@redhat.com>
      Signed-off-by: NJan Kara <jack@suse.cz>
      a3942700
    • J
      xfs: Remove some useless flags tests · fbf64b3d
      Jan Kara 提交于
      'flags' have XFS_ALL_QUOTA_ACCT cleared immediately on function entry.
      There's no point in checking these bits later in the function. Also
      because we check something is going to change, we know some enforcement
      bits are being added and thus there's no point in testing that later.
      Reviewed-by: NBrian Foster <bfoster@redhat.com>
      Signed-off-by: NJan Kara <jack@suse.cz>
      fbf64b3d
    • J
      xfs: Remove useless test · 8a2fdd4a
      Jan Kara 提交于
      Q_XQUOTARM is never passed to xfs_fs_set_xstate() so remove the test.
      Reviewed-by: NBrian Foster <bfoster@redhat.com>
      Signed-off-by: NJan Kara <jack@suse.cz>
      8a2fdd4a
    • J
      quota: Verify flags passed to Q_SETINFO · ca6cb091
      Jan Kara 提交于
      Currently flags passed via Q_SETINFO were just stored. This makes it
      hard to add new flags since in theory userspace could be just setting /
      clearing random flags. Since currently there is only one userspace
      settable flag and that is somewhat obscure flags only for ancient v1
      quota format, I'm reasonably sure noone operates these flags and
      hopefully we are fine just adding the check that passed flags are sane.
      If we indeed find some userspace program that gets broken by the strict
      check, we can always remove it again.
      Signed-off-by: NJan Kara <jack@suse.cz>
      ca6cb091
    • J
      quota: Cleanup flags definitions · 9c45101e
      Jan Kara 提交于
      Currently all quota flags were defined just in kernel-private headers.
      Export flags readable / writeable from userspace to userspace via
      include/uapi/linux/quota.h.
      Signed-off-by: NJan Kara <jack@suse.cz>
      9c45101e
    • J
      ocfs2: Move OLQF_CLEAN flag out of generic quota flags · 96827adc
      Jan Kara 提交于
      OLQF_CLEAN flag is used by OCFS2 on disk to recognize whether quota
      recovery is needed or not. We also somewhat abuse mem_dqinfo->dqi_flags
      to pass this flag around. Use private flags for this to avoid clashes
      with other quota flags / not pollute generic quota flag namespace.
      Signed-off-by: NJan Kara <jack@suse.cz>
      96827adc
    • J
      quota: Don't store flags for v2 quota format · c119c5b9
      Jan Kara 提交于
      Currently, v2 quota format blindly stored flags from in-memory dqinfo on
      disk, although there are no flags supported. Since it is stupid to store
      flags which have no effect, just store 0 unconditionally and don't
      bother loading it from disk.
      
      Note that userspace could have stored some flags there via Q_SETINFO
      quotactl and then later read them (although flags have no effect) but
      I'm pretty sure noone does that (most definitely quota-tools don't and
      quota interface doesn't have too much other users).
      Signed-off-by: NJan Kara <jack@suse.cz>
      c119c5b9
  4. 12 1月, 2015 1 次提交
  5. 09 1月, 2015 5 次提交
  6. 08 1月, 2015 1 次提交
  7. 07 1月, 2015 3 次提交
  8. 05 1月, 2015 2 次提交
  9. 03 1月, 2015 7 次提交
  10. 27 12月, 2014 1 次提交
  11. 23 12月, 2014 1 次提交
  12. 22 12月, 2014 2 次提交
  13. 19 12月, 2014 2 次提交