1. 12 4月, 2015 6 次提交
  2. 26 3月, 2015 1 次提交
  3. 13 3月, 2015 1 次提交
  4. 28 1月, 2015 1 次提交
    • 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
  5. 17 9月, 2014 1 次提交
    • J
      udf: Fix race between write(2) and close(2) · 6fb1ca92
      Jan Kara 提交于
      Currently write(2) updating i_size and close(2) of the file can race in
      such a way that udf_truncate_tail_extent() called from
      udf_file_release() sees old i_size but already new extents added by the
      running write call. This results in complaints like:
        UDF-fs: warning (device vdb2): udf_truncate_tail_extent: Too long extent
          after EOF in inode 877: i_size: 0 lbcount: 1073739776 extent 0+1073739776
        UDF-fs: error (device vdb2): udf_truncate_tail_extent: Extent after EOF
          in inode 877
      
      Fix the problem by grabbing i_mutex in udf_file_release() to be sure
      i_size is consistent with current state of extent list. Also avoid
      truncating tail extent unnecessarily when the file is still open for
      writing.
      Signed-off-by: NJan Kara <jack@suse.cz>
      6fb1ca92
  6. 16 7月, 2014 2 次提交
  7. 07 5月, 2014 3 次提交
  8. 02 4月, 2014 1 次提交
  9. 21 2月, 2014 1 次提交
    • J
      udf: Fix data corruption on file type conversion · 09ebb17a
      Jan Kara 提交于
      UDF has two types of files - files with data stored in inode (ICB in
      UDF terminology) and files with data stored in external data blocks. We
      convert file from in-inode format to external format in
      udf_file_aio_write() when we find out data won't fit into inode any
      longer. However the following race between two O_APPEND writes can happen:
      
      CPU1					CPU2
      udf_file_aio_write()			udf_file_aio_write()
        down_write(&iinfo->i_data_sem);
        checks that i_size + count1 fits within inode
          => no need to convert
        up_write(&iinfo->i_data_sem);
      					  down_write(&iinfo->i_data_sem);
      					  checks that i_size + count2 fits
      					    within inode => no need to convert
      					  up_write(&iinfo->i_data_sem);
        generic_file_aio_write()
          - extends file by count1 bytes
      					  generic_file_aio_write()
      					    - extends file by count2 bytes
      
      Clearly if count1 + count2 doesn't fit into the inode, we overwrite
      kernel buffers beyond inode, possibly corrupting the filesystem as well.
      
      Fix the problem by acquiring i_mutex before checking whether write fits
      into the inode and using __generic_file_aio_write() afterwards which
      puts check and write into one critical section.
      Reported-by: NAl Viro <viro@ZenIV.linux.org.uk>
      Signed-off-by: NJan Kara <jack@suse.cz>
      09ebb17a
  10. 30 7月, 2013 1 次提交
    • K
      aio: Kill aio_rw_vect_retry() · 73a7075e
      Kent Overstreet 提交于
      This code doesn't serve any purpose anymore, since the aio retry
      infrastructure has been removed.
      
      This change should be safe because aio_read/write are also used for
      synchronous IO, and called from do_sync_read()/do_sync_write() - and
      there's no looping done in the sync case (the read and write syscalls).
      Signed-off-by: NKent Overstreet <koverstreet@google.com>
      Cc: Zach Brown <zab@redhat.com>
      Cc: Felipe Balbi <balbi@ti.com>
      Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
      Cc: Mark Fasheh <mfasheh@suse.com>
      Cc: Joel Becker <jlbec@evilplan.org>
      Cc: Rusty Russell <rusty@rustcorp.com.au>
      Cc: Jens Axboe <axboe@kernel.dk>
      Cc: Asai Thambi S P <asamymuthupa@micron.com>
      Cc: Selvan Mani <smani@micron.com>
      Cc: Sam Bradshaw <sbradshaw@micron.com>
      Cc: Jeff Moyer <jmoyer@redhat.com>
      Cc: Al Viro <viro@zeniv.linux.org.uk>
      Cc: Benjamin LaHaise <bcrl@kvack.org>
      Signed-off-by: NBenjamin LaHaise <bcrl@kvack.org>
      73a7075e
  11. 26 2月, 2013 1 次提交
  12. 23 2月, 2013 1 次提交
  13. 06 9月, 2012 1 次提交
    • I
      UDF: Add support for O_DIRECT · 5eec54fc
      Ian Abbott 提交于
      Add support for the O_DIRECT flag.  There are two cases to deal with:
      
      1. Small files stored in the ICB (inode control block?): just return 0
      from the new udf_adinicb_direct_IO() handler to fall back to buffered
      I/O.
      
      2. Larger files, not stored in the ICB: nothing special here.  Just call
      blockdev_direct_IO() from our new udf_direct_IO() handler and tidy up
      any blocks instantiated outside i_size on error.  This is pretty
      standard.  Factor error handling code out of udf_write_begin() into new
      function udf_write_failed() so it can also be called by udf_direct_IO().
      
      Also change the whitespace in udf_aops to make it a bit neater.
      Signed-off-by: NIan Abbott <abbotti@mev.co.uk>
      Signed-off-by: NJan Kara <jack@suse.cz>
      5eec54fc
  14. 05 9月, 2012 1 次提交
    • J
      udf: Fix data corruption for files in ICB · 9c2fc0de
      Jan Kara 提交于
      When a file is stored in ICB (inode), we overwrite part of the file, and
      the page containing file's data is not in page cache, we end up corrupting
      file's data by overwriting them with zeros. The problem is we use
      simple_write_begin() which simply zeroes parts of the page which are not
      written to. The problem has been introduced by be021ee4 (udf: convert to
      new aops).
      
      Fix the problem by providing a ->write_begin function which makes the page
      properly uptodate.
      
      CC: <stable@vger.kernel.org> # >= 2.6.24
      Reported-by: NIan Abbott <abbotti@mev.co.uk>
      Signed-off-by: NJan Kara <jack@suse.cz>
      9c2fc0de
  15. 20 3月, 2012 1 次提交
  16. 11 3月, 2012 1 次提交
  17. 01 3月, 2012 1 次提交
  18. 09 1月, 2012 1 次提交
  19. 20 7月, 2011 1 次提交
  20. 10 3月, 2011 1 次提交
  21. 23 2月, 2011 1 次提交
  22. 07 1月, 2011 3 次提交
  23. 10 8月, 2010 2 次提交
    • C
      remove inode_setattr · 1025774c
      Christoph Hellwig 提交于
      Replace inode_setattr with opencoded variants of it in all callers.  This
      moves the remaining call to vmtruncate into the filesystem methods where it
      can be replaced with the proper truncate sequence.
      
      In a few cases it was obvious that we would never end up calling vmtruncate
      so it was left out in the opencoded variant:
      
       spufs: explicitly checks for ATTR_SIZE earlier
       btrfs,hugetlbfs,logfs,dlmfs: explicitly clears ATTR_SIZE earlier
       ufs: contains an opencoded simple_seattr + truncate that sets the filesize just above
      
      In addition to that ncpfs called inode_setattr with handcrafted iattrs,
      which allowed to trim down the opencoded variant.
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      1025774c
    • C
      add missing setattr methods · d39aae9e
      Christoph Hellwig 提交于
      For the new truncate sequence every filesystem that wants to truncate on-disk
      state needs a seattr method.  Convert the remaining filesystems that implement
      the truncate inode operation to have its own setattr method.
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      d39aae9e
  24. 02 8月, 2010 1 次提交
  25. 28 5月, 2010 1 次提交
    • C
      rename the generic fsync implementations · 1b061d92
      Christoph Hellwig 提交于
      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: NChristoph Hellwig <hch@lst.de>
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      1b061d92
  26. 24 5月, 2010 1 次提交
    • J
      udf: Remove dead quota code · 36350462
      Jan Kara 提交于
      Quota on UDF is non-functional at least since 2.6.16 (I'm too lazy to
      do more archeology) because it does not provide .quota_write and .quota_read
      functions and thus quotaon(8) just returns EINVAL. Since nobody complained
      for all those years and quota support is not even in UDF standard just nuke
      it.
      Signed-off-by: NJan Kara <jack@suse.cz>
      36350462
  27. 22 5月, 2010 1 次提交
  28. 05 5月, 2010 1 次提交
  29. 08 4月, 2010 1 次提交