27 May, 2011

1 commit

  • Originally i_lastfrag was 32 bits but then we added support for handling
    64 bit metadata and it became a 64 bit variable. That was during 2007, in
    54fb996ac15c "[PATCH] ufs2 write: block allocation update". Unfortunately
    these casts got left behind so the value got truncated to 32 bit again.

    [akpm@linux-foundation.org: remove now-unneeded min_t/max_t casting]
    Signed-off-by: Dan Carpenter
    Cc: Evgeniy Dushistov
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Dan Carpenter
     

18 Aug, 2010

1 commit

  • These flags aren't real I/O types, but tell ll_rw_block to always
    lock the buffer instead of giving up on a failed trylock.

    Instead add a new write_dirty_buffer helper that implements this semantic
    and use it from the existing SWRITE* callers. Note that the ll_rw_block
    code had a bug where it didn't promote WRITE_SYNC_PLUG properly, which
    this patch fixes.

    In the ufs code clean up the helper that used to call ll_rw_block
    to mirror sync_dirty_buffer, which is the function it implements for
    compound buffers.

    Signed-off-by: Christoph Hellwig
    Signed-off-by: Al Viro

    Christoph Hellwig
     

24 May, 2010

1 commit

  • UFS quota is non-functional at least since 2.6.12 because dq_op was set
    to NULL. Since the filesystem exists mainly to allow cooperation with Solaris
    and quota format isn't standard, just remove the dead code.

    CC: Evgeniy Dushistov
    Signed-off-by: Jan Kara

    Jan Kara
     

05 Mar, 2010

1 commit

  • Get rid of the alloc_space, free_space, reserve_space, claim_space and
    release_rsv dquot operations - they are always called from the filesystem
    and if a filesystem really needs their own (which none currently does)
    it can just call into it's own routine directly.

    Move shared logic into the common __dquot_alloc_space,
    dquot_claim_space_nodirty and __dquot_free_space low-level methods,
    and rationalize the wrappers around it to move as much as possible
    code into the common block for CONFIG_QUOTA vs not. Also rename
    all these helpers to be named dquot_* instead of vfs_dq_*.

    Signed-off-by: Christoph Hellwig
    Signed-off-by: Jan Kara

    Christoph Hellwig
     

26 Mar, 2009

1 commit


28 Apr, 2008

1 commit


20 Mar, 2008

1 commit

  • fs/ufs/balloc.c: In function `ufs_change_blocknr':
    fs/ufs/balloc.c:317: warning: long long unsigned int format, long unsigned int arg (arg 2)
    fs/ufs/balloc.c:317: warning: long long unsigned int format, long unsigned int arg (arg 3)

    sector_t is u64 and we don't know what type the architecture uses to implement
    u64.

    Cc: Evgeniy Dushistov
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Andrew Morton
     

09 Feb, 2008

1 commit

  • Per previous discussions about cleaning up ufs_fs.h, people just want
    this straight up dropped from userspace export. The only remaining
    consumer (silo) has been fixed a while ago to not rely on this header.
    This allows use to move it completely from include/linux/ to fs/ufs/
    seeing as how the only in-kernel consumer is fs/ufs/.

    Signed-off-by: Mike Frysinger
    Cc: Jan Kara
    Cc: Christoph Hellwig
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Mike Frysinger
     

17 Oct, 2007

1 commit

  • Move prototypes and in-core structures to fs/ufs/ similar to what most
    other filesystems already do.

    I made little modifications: move also ufs debug macros and
    mount options constants into fs/ufs/ufs.h, this stuff
    also private for ufs.

    Signed-off-by: Christoph Hellwig
    Signed-off-by: Evgeniy Dushistov
    Cc: Al Viro
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Christoph Hellwig
     

17 Mar, 2007

2 commits

  • This patch fix behaviour in such test scenario:

    lseek(fd, BIG_OFFSET)
    write(fd, buf, sizeof(buf))
    truncate(BIG_OFFSET)
    truncate(BIG_OFFSET + sizeof(buf))
    read(fd, buf...)

    Because of if file big enough(BIG_OFFSET) we start allocate space by block,
    ordinary block size > page size, so we should zeroize the rest of block in
    truncate(except last framgnet, about which VFS should care), to not get
    garbage, when we extend file.

    Also patch corrects conversion from pointer to block to physical block number,
    this helps in case of not common used UFS types.

    And add to debug output inode number.

    Signed-off-by: Evgeniy Dushistov
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Evgeniy Dushistov
     
  • This fixes "change blocks numbers on the fly" in case when "prepare
    write page" is in the call chain, in this case some buffers may be not
    uptodate and not mapped, we should care to map them and load from disk.

    This patch was tested with:
    - ufs regressions simple tests
    - fsx-linux
    - ltp(20060306)
    - untar and build kernel

    Signed-off-by: Evgeniy Dushistov
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Evgeniy Dushistov
     

15 Feb, 2007

1 commit

  • After Al Viro (finally) succeeded in removing the sched.h #include in module.h
    recently, it makes sense again to remove other superfluous sched.h includes.
    There are quite a lot of files which include it but don't actually need
    anything defined in there. Presumably these includes were once needed for
    macros that used to live in sched.h, but moved to other header files in the
    course of cleaning it up.

    To ease the pain, this time I did not fiddle with any header files and only
    removed #includes from .c-files, which tend to cause less trouble.

    Compile tested against 2.6.20-rc2 and 2.6.20-rc2-mm2 (with offsets) on alpha,
    arm, i386, ia64, mips, powerpc, and x86_64 with allnoconfig, defconfig,
    allmodconfig, and allyesconfig as well as a few randconfigs on x86_64 and all
    configs in arch/arm/configs on arm. I also checked that no new warnings were
    introduced by the patch (actually, some warnings are removed that were emitted
    by unnecessarily included header files).

    Signed-off-by: Tim Schmielau
    Acked-by: Russell King
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Tim Schmielau
     

13 Feb, 2007

1 commit


31 Jan, 2007

2 commits

  • In blocks reallocation function sometimes does not update some of
    buffer_head::b_blocknr, which may and cause data damage.

    Signed-off-by: Evgeniy Dushistov
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Evgeniy Dushistov
     
  • These series of patches result of UFS1 write support stress testing, like
    running fsx-linux, untar and build linux kernel etc

    We pass from ufs::get_block_t to levels below: pointer to the current page, to
    make possible things like reallocation of blocks on the fly, and we also uses
    this pointer for indication, what actually we allocate data block or meta data
    block, but currently we make decision about what we allocate on the wrong
    level, this may and cause oops if we allocate blocks in some special order.

    Signed-off-by: Evgeniy Dushistov
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Evgeniy Dushistov
     

06 Jan, 2007

1 commit

  • Looks like this is the problem, which point Al Viro some time ago:

    ufs's get_block callback allocates 16k of disk at a time, and links that
    entire 16k into the file's metadata. But because get_block is called for only
    a single buffer_head (a 2k buffer_head in this case?) we are only able to tell
    the VFS that this 2k is buffer_new().

    So when ufs_getfrag_block() is later called to map some more data in the file,
    and when that data resides within the remaining 14k of this fragment,
    ufs_getfrag_block() will incorrectly return a !buffer_new() buffer_head.

    I don't see _right_ way to do nullification of whole block, if use inode
    page cache, some pages may be outside of inode limits (inode size), and
    will be lost; if use blockdev page cache it is possible to zero real data,
    if later inode page cache will be used.

    The simpliest way, as can I see usage of block device page cache, but not only
    mark dirty, but also sync it during "nullification". I use my simple tests
    collection, which I used for check that create,open,write,read,close works on
    ufs, and I see that this patch makes ufs code 18% slower then before.

    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Evgeniy Dushistov
     

06 Aug, 2006

1 commit

  • ufs_get_locked_page is called twice in ufs code, one time in ufs_truncate
    path(we allocated last block), and another time when fragments are
    reallocated. In ideal world in the second case on allocation/free block
    layer we should not know that things like `truncate' exists, but now with
    such crutch like ufs_get_locked_page we can (or should?) skip truncated
    pages.

    Signed-off-by: Evgeniy Dushistov
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Evgeniy Dushistov
     

02 Jul, 2006

1 commit

  • This patch fixes buggy behaviour of UFS
    in such kind of scenario:
    open(, O_TRUNC...)
    ftruncate(, 1024)
    ftruncate(, 0)

    Such a scenario causes ufs_panic and remount read-only. This happen
    because of according to specification UFS should always allocate block for
    last byte, and many parts of our implementation rely on this, but
    `ufs_truncate' doesn't care about this.

    To make possible return error code and to know about old size, this patch
    removes `truncate' from ufs inode_operations and uses `setattr' method to
    call ufs_truncate.

    Signed-off-by: Evgeniy Dushistov
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Evgeniy Dushistov
     

26 Jun, 2006

10 commits

  • In ufs code there is function: ubh_ll_rw_block, it has parameter how many
    ufs_buffer_head it should handle, but it always called with "1" on the place
    of this parameter. This patch removes unused parameter of "ubh_ll_wr_block".

    Signed-off-by: Evgeniy Dushistov
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Evgeniy Dushistov
     
  • ufs super block contains some statistic about file systems, like amount of
    directories, free blocks, inodes and so on.

    UFS1 hold this information in one location and uses 32bit integers for such
    information, UFS2 hold statistic in another location and uses 64bit integers.

    There is transition variant, if UFS1 has type 44BSD and flags field in super
    block has some special value this mean that we work with statistic like UFS2
    does. and this also means that nobody care about old(UFS1) statistic.

    So if start fsck against such file system, after usage linux ufs driver, it
    found error: at now only UFS1 like statistic is updated.

    This patch should fix this. Also it contains some minor cleanup: CodingSytle
    and remove unused variables.

    Signed-off-by: Evgeniy Dushistov
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Evgeniy Dushistov
     
  • This patch fixes two bugs, which introduced by previous patches:

    1) Missed "brelse"

    2) Sometimes "baseblk" may be wrongly calculated, if i_size is equal to
    zero, which lead infinite cycle in "mpage_writepages".

    Signed-off-by: Evgeniy Dushistov
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Evgeniy Dushistov
     
  • ufs_free_blocks function looks now in so way:
    if (err)
    goto failed;
    lock_super();
    failed:
    unlock_super();

    So if error happen we'll unlock not locked super.

    Signed-off-by: Evgeniy Dushistov
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Evgeniy Dushistov
     
  • At now UFS code uses DQUOT_* mechanism, but it also update inode->i_blocks
    manually, this cause wrong i_blocks value.

    Signed-off-by: Evgeniy Dushistov
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Evgeniy Dushistov
     
  • Currently to turn on debug mode "user" has to edit ~10 files, to turn off he
    has to do it again.

    This patch introduce such changes:
    1)turn on(off) debug messages via ".config"
    2)remove unnecessary duplication of code
    3)make "UFSD" macros more similar to function
    4)fix some compiler warnings

    Signed-off-by: Evgeniy Dushistov
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Evgeniy Dushistov
     
  • The writing to UFS file system with block/fragment!=8 may cause bogus
    behaviour. The problem in "ufs_bitmap_search" function, which doesn't work
    correctly in "block/fragment!=8" case. The idea is stolen from BSD code.

    Signed-off-by: Evgeniy Dushistov
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Evgeniy Dushistov
     
  • There are two ugly macros in ufs code:
    #define UCPI_UBH ((struct ufs_buffer_head *)ucpi)
    #define USPI_UBH ((struct ufs_buffer_head *)uspi)
    when uspi looks like
    struct {
    struct ufs_buffer_head ;
    }
    and USPI_UBH has some sence,
    ucpi looks like
    struct {
    struct not_ufs_buffer_head;
    }

    To prevent bugs in future, this patch convert macros to inline function and
    fix "ucpi" structure.

    Signed-off-by: Evgeniy Dushistov
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Evgeniy Dushistov
     
  • First of all some necessary notes about UFS by it self: To avoid waste of disk
    space the tail of file consists not from blocks (which is ordinary big enough,
    16K usually), it consists from fragments(which is ordinary 2K). When file is
    growing its tail occupy 1 fragment, 2 fragments... At some stage decision to
    allocate whole block is made and all fragments are moved to one block.

    How this situation was handled before:

    ufs_prepare_write
    ->block_prepare_write
    ->ufs_getfrag_block
    ->...
    ->ufs_new_fragments:

    bh = sb_bread
    bh->b_blocknr = result + i;
    mark_buffer_dirty (bh);

    This is wrong solution, because:

    - it didn't take into consideration that there is another cache: "inode page
    cache"

    - because of sb_getblk uses not b_blocknr, (it uses page->index) to find
    certain block, this breaks sb_getblk.

    How this situation is handled now: we go though all "page inode cache", if
    there are no such page in cache we load it into cache, and change b_blocknr.

    Signed-off-by: Evgeniy Dushistov
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Evgeniy Dushistov
     
  • * After block allocation, we map it on the same "address" as 8 others
    blocks

    * We nullify block several times: once in ufs/block.c and once in
    block_*write_full_page, and use different "caches" for this.

    Signed-off-by: Evgeniy Dushistov
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Evgeniy Dushistov
     

15 Jan, 2006

1 commit

  • Here is update of ufs cleanup patch, brought on by the recently fixed
    ubh_get_usb_second() bug that made some ugly code rather painfully
    obvious. It also includes

    - fix compilation warnings which appears if debug mode turn on
    - remove unnecessary duplication of code to support UFS2

    I tested it on ufs1 and ufs2 file-systems.

    Signed-off-by: Evgeniy Dushistov
    Signed-off-by: Linus Torvalds

    Evgeniy
     

12 Jan, 2006

1 commit


08 Sep, 2005

1 commit


17 Apr, 2005

1 commit

  • 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!

    Linus Torvalds