06 Jan, 2012

1 commit

  • Reduce object size by deduplicating formats.

    Use vsprintf extension %pV.
    Rename P9_DPRINTK uses to p9_debug, align arguments.
    Add function for _p9_debug and macro to add __func__.
    Add missing "\n"s to p9_debug uses.
    Remove embedded function names as p9_debug adds it.
    Remove P9_EPRINTK macro and convert use to pr_.
    Add and use pr_fmt and pr_.

    $ size fs/9p/built-in.o*
    text data bss dec hex filename
    62133 984 16000 79117 1350d fs/9p/built-in.o.new
    67342 984 16928 85254 14d06 fs/9p/built-in.o.old
    $ size net/9p/built-in.o*
    text data bss dec hex filename
    88792 4148 22024 114964 1c114 net/9p/built-in.o.new
    94072 4148 23232 121452 1da6c net/9p/built-in.o.old

    Signed-off-by: Joe Perches
    Signed-off-by: Eric Van Hensbergen

    Joe Perches
     

25 Oct, 2011

5 commits

  • This helps in more control over debugging.
    root@qemu-img-64:~# ls /pass/123
    ls: cannot access /pass/123: No such file or directory
    root@qemu-img-64:~# cat /sys/kernel/debug/tracing/trace
    # tracer: nop
    #
    # TASK-PID CPU# TIMESTAMP FUNCTION
    # | | | | |
    ls-1536 [001] 70.928584: 9p_protocol_dump: clnt 18446612132784021504 P9_TWALK(tag = 1)
    000: 16 00 00 00 6e 01 00 01 00 00 00 02 00 00 00 01
    010: 00 03 00 31 32 33 00 00 00 ff ff ff ff 00 00 00

    ls-1536 [001] 70.928587:
    => trace_9p_protocol_dump
    => p9pdu_finalize
    => p9_client_rpc
    => p9_client_walk
    => v9fs_vfs_lookup
    => d_alloc_and_lookup
    => walk_component
    => path_lookupat
    ls-1536 [000] 70.929696: 9p_protocol_dump: clnt 18446612132784021504 P9_RLERROR(tag = 1)
    000: 0b 00 00 00 07 01 00 02 00 00 00 4e 03 00 02 00
    010: 00 00 00 00 03 00 02 00 00 00 00 00 ff 43 00 00

    ls-1536 [000] 70.929697:
    => trace_9p_protocol_dump
    => p9_client_rpc
    => p9_client_walk
    => v9fs_vfs_lookup
    => d_alloc_and_lookup
    => walk_component
    => path_lookupat
    => do_path_lookup

    Signed-off-by: Aneesh Kumar K.V
    Signed-off-by: Eric Van Hensbergen

    Aneesh Kumar K.V
     
  • Without this msize=4294967295 will result in a crash

    Signed-off-by: Dan Carpenter
    Signed-off-by: Aneesh Kumar K.V
    Signed-off-by: Eric Van Hensbergen

    Dan Carpenter
     
  • Instead of saying all integer argument option should be listed in the beginning
    move integer parsing to each option type.

    Signed-off-by: Aneesh Kumar K.V
    Signed-off-by: Eric Van Hensbergen

    Aneesh Kumar K.V
     
  • We dereferenced "req->tc" and "req->rc" before checking for NULL.

    Signed-off-by: Dan Carpenter
    Signed-off-by: Aneesh Kumar K.V
    Signed-off-by: Eric Van Hensbergen

    Dan Carpenter
     
  • * remove lot of update to different data structure
    * add a seperate callback for zero copy request.
    * above makes non zero copy code path simpler
    * remove conditionalizing TREAD/TREADDIR/TWRITE in the zero copy path
    * Fix the dotu p9_check_errors with zero copy. Add sufficient doc around
    * Add support for both in and output buffers in zero copy callback
    * pin and unpin pages in the same context
    * use helpers instead of defining page offset and rest of page ourself
    * Fix mem leak in p9_check_errors
    * Remove 'E' and 'F' in p9pdu_vwritef

    Signed-off-by: Aneesh Kumar K.V
    Signed-off-by: Eric Van Hensbergen

    Aneesh Kumar K.V
     

23 Jul, 2011

7 commits

  • msize represents the maximum PDU size that includes P9_IOHDRSZ.

    Signed-off-by: Venkateswararao Jujjuri "
    Signed-off-by: Aneesh Kumar K.V
    Signed-off-by: Eric Van Hensbergen

    Venkateswararao Jujjuri (JV)
     
  • unlinkat - Remove a directory entry

    size[4] Tunlinkat tag[2] dirfid[4] name[s] flag[4]
    size[4] Runlinkat tag[2]

    older Tremove have the below request format

    size[4] Tremove tag[2] fid[4]

    The remove message is used to remove a directory entry either file or directory
    The remove opreation is actually a directory opertation and should ideally have
    dirfid, if not we cannot represent the fid on server with anything other than
    name. We will have to derive the directory name from fid in the Tremove request.

    NOTE: The operation doesn't clunk the unlink fid.

    Signed-off-by: Aneesh Kumar K.V
    Signed-off-by: Eric Van Hensbergen

    Aneesh Kumar K.V
     
  • renameat - change name of file or directory

    size[4] Trenameat tag[2] olddirfid[4] oldname[s] newdirfid[4] newname[s]
    size[4] Rrenameat tag[2]

    older Trename have the below request format

    size[4] Trename tag[2] fid[4] newdirfid[4] name[s]

    The rename message is used to change the name of a file, possibly moving it
    to a new directory. The rename opreation is actually a directory opertation
    and should ideally have olddirfid, if not we cannot represent the fid on server
    with anything other than name. We will have to derive the old directory name
    from fid in the Trename request.

    Signed-off-by: Aneesh Kumar K.V
    Signed-off-by: Eric Van Hensbergen

    Aneesh Kumar K.V
     
  • Signed-off-by: Prem Karat
    Signed-off-by: Aneesh Kumar K.V
    Signed-off-by: Eric Van Hensbergen

    Prem Karat
     
  • free the fid even in case of failed clunk.

    Signed-off-by: Aneesh Kumar K.V
    Signed-off-by: Eric Van Hensbergen

    Aneesh Kumar K.V
     
  • Switch to generic kernel hexdump library and cleanup macros to
    be more consistent with the way we do normal debug prints.

    Signed-off-by: Eric Van Hensbergen

    Eric Van Hensbergen
     
  • There was a BUG_ON to protect against a bad id which could be dealt with
    more gracefully.

    Reported-by: Natalie Orlin
    Signed-off-by: Eric Van Hensbergen

    Eric Van Hensbergen
     

25 May, 2011

2 commits


21 May, 2011

1 commit

  • * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next-2.6: (1446 commits)
    macvlan: fix panic if lowerdev in a bond
    tg3: Add braces around 5906 workaround.
    tg3: Fix NETIF_F_LOOPBACK error
    macvlan: remove one synchronize_rcu() call
    networking: NET_CLS_ROUTE4 depends on INET
    irda: Fix error propagation in ircomm_lmp_connect_response()
    irda: Kill set but unused variable 'bytes' in irlan_check_command_param()
    irda: Kill set but unused variable 'clen' in ircomm_connect_indication()
    rxrpc: Fix set but unused variable 'usage' in rxrpc_get_transport()
    be2net: Kill set but unused variable 'req' in lancer_fw_download()
    irda: Kill set but unused vars 'saddr' and 'daddr' in irlan_provider_connect_indication()
    atl1c: atl1c_resume() is only used when CONFIG_PM_SLEEP is defined.
    rxrpc: Fix set but unused variable 'usage' in rxrpc_get_peer().
    rxrpc: Kill set but unused variable 'local' in rxrpc_UDP_error_handler()
    rxrpc: Kill set but unused variable 'sp' in rxrpc_process_connection()
    rxrpc: Kill set but unused variable 'sp' in rxrpc_rotate_tx_window()
    pkt_sched: Kill set but unused variable 'protocol' in tc_classify()
    isdn: capi: Use pr_debug() instead of ifdefs.
    tg3: Update version to 3.119
    tg3: Apply rx_discards fix to 5719/5720
    ...

    Fix up trivial conflicts in arch/x86/Kconfig and net/mac80211/agg-tx.c
    as per Davem.

    Linus Torvalds
     

10 May, 2011

1 commit


16 Apr, 2011

2 commits


13 Apr, 2011

1 commit


31 Mar, 2011

1 commit


23 Mar, 2011

1 commit

  • Without this we can cause reclaim allocation in writepage.

    [ 3433.448430] =================================
    [ 3433.449117] [ INFO: inconsistent lock state ]
    [ 3433.449117] 2.6.38-rc5+ #84
    [ 3433.449117] ---------------------------------
    [ 3433.449117] inconsistent {RECLAIM_FS-ON-W} -> {IN-RECLAIM_FS-R} usage.
    [ 3433.449117] kswapd0/505 [HC0[0]:SC0[0]:HE1:SE1] takes:
    [ 3433.449117] (iprune_sem){+++++-}, at: [] shrink_icache_memory+0x45/0x2b1
    [ 3433.449117] {RECLAIM_FS-ON-W} state was registered at:
    [ 3433.449117] [] mark_held_locks+0x52/0x70
    [ 3433.449117] [] lockdep_trace_alloc+0x85/0x9f
    [ 3433.449117] [] slab_pre_alloc_hook+0x18/0x3c
    [ 3433.449117] [] kmem_cache_alloc+0x23/0xa2
    [ 3433.449117] [] idr_pre_get+0x2d/0x6f
    [ 3433.449117] [] p9_idpool_get+0x30/0xae
    [ 3433.449117] [] p9_client_rpc+0xd7/0x9b0
    [ 3433.449117] [] p9_client_clunk+0x88/0xdb
    [ 3433.449117] [] v9fs_evict_inode+0x3c/0x48
    [ 3433.449117] [] evict+0x1f/0x87
    [ 3433.449117] [] dispose_list+0x47/0xe3
    [ 3433.449117] [] evict_inodes+0x138/0x14f
    [ 3433.449117] [] generic_shutdown_super+0x57/0xe8
    [ 3433.449117] [] kill_anon_super+0x11/0x50
    [ 3433.449117] [] v9fs_kill_super+0x49/0xab
    [ 3433.449117] [] deactivate_locked_super+0x21/0x46
    [ 3433.449117] [] deactivate_super+0x40/0x44
    [ 3433.449117] [] mntput_no_expire+0x100/0x109
    [ 3433.449117] [] sys_umount+0x2f1/0x31c
    [ 3433.449117] [] system_call_fastpath+0x16/0x1b
    [ 3433.449117] irq event stamp: 192941
    [ 3433.449117] hardirqs last enabled at (192941): [] _raw_spin_unlock_irq+0x2b/0x30
    [ 3433.449117] hardirqs last disabled at (192940): [] shrink_inactive_list+0x290/0x2f5
    [ 3433.449117] softirqs last enabled at (188470): [] __do_softirq+0x133/0x152
    [ 3433.449117] softirqs last disabled at (188455): [] call_softirq+0x1c/0x28
    [ 3433.449117]
    [ 3433.449117] other info that might help us debug this:
    [ 3433.449117] 1 lock held by kswapd0/505:
    [ 3433.449117] #0: (shrinker_rwsem){++++..}, at: [] shrink_slab+0x38/0x15f
    [ 3433.449117]
    [ 3433.449117] stack backtrace:
    [ 3433.449117] Pid: 505, comm: kswapd0 Not tainted 2.6.38-rc5+ #84
    [ 3433.449117] Call Trace:
    [ 3433.449117] [] ? valid_state+0x17e/0x191
    [ 3433.449117] [] ? save_stack_trace+0x28/0x45
    [ 3433.449117] [] ? check_usage_forwards+0x0/0x87
    [ 3433.449117] [] ? mark_lock+0x113/0x22c
    [ 3433.449117] [] ? __lock_acquire+0x37a/0xcf7
    [ 3433.449117] [] ? mark_lock+0x2d/0x22c
    [ 3433.449117] [] ? __lock_acquire+0x392/0xcf7
    [ 3433.449117] [] ? determine_dirtyable_memory+0x15/0x28
    [ 3433.449117] [] ? lock_acquire+0x57/0x6d
    [ 3433.449117] [] ? shrink_icache_memory+0x45/0x2b1
    [ 3433.449117] [] ? down_read+0x47/0x5c
    [ 3433.449117] [] ? shrink_icache_memory+0x45/0x2b1
    [ 3433.449117] [] ? shrink_icache_memory+0x45/0x2b1
    [ 3433.449117] [] ? shrink_slab+0xdb/0x15f
    [ 3433.449117] [] ? kswapd+0x574/0x96a
    [ 3433.449117] [] ? kswapd+0x0/0x96a
    [ 3433.449117] [] ? kthread+0x7d/0x85
    [ 3433.449117] [] ? kernel_thread_helper+0x4/0x10
    [ 3433.449117] [] ? restore_args+0x0/0x30
    [ 3433.449117] [] ? kthread+0x0/0x85
    [ 3433.449117] [] ? kernel_thread_helper+0x0/0x10

    Signed-off-by: Aneesh Kumar K.V
    Signed-off-by: Venkateswararao Jujjuri
    Signed-off-by: Eric Van Hensbergen

    Aneesh Kumar K.V
     

15 Mar, 2011

6 commits


28 Oct, 2010

10 commits

  • This patch ensures that a read(fd, NULL, 10) returns EFAULT on a 9p file.

    Signed-off-by: Sanchit Garg
    Signed-off-by: Aneesh Kumar K.V
    Signed-off-by: Eric Van Hensbergen

    Sanchit Garg
     
  • SYNOPSIS
    size[4] Tfsync tag[2] fid[4] datasync[4]

    size[4] Rfsync tag[2]

    DESCRIPTION

    The Tfsync transaction transfers ("flushes") all modified in-core data of
    file identified by fid to the disk device (or other permanent storage
    device) where that file resides.

    If datasync flag is specified data will be fleshed but does not flush
    modified metadata unless that metadata is needed in order to allow a
    subsequent data retrieval to be correctly handled.

    Signed-off-by: Venkateswararao Jujjuri
    Signed-off-by: Eric Van Hensbergen

    Venkateswararao Jujjuri (JV)
     
  • We need to return error in case we fail to encode data in protocol buffer.
    This patch also return error in case of a failed copy_from_user.

    Signed-off-by: Aneesh Kumar K.V
    Signed-off-by: Venkateswararao Jujjuri
    Signed-off-by: Eric Van Hensbergen

    Aneesh Kumar K.V
     
  • If there is not enough space for the PDU on the VirtIO ring, current
    code returns -EIO propagating the error to user.

    This patch introduced a wqit_queue on the channel, and lets the process
    wait on this queue until VirtIO ring frees up.

    Signed-off-by: Venkateswararao Jujjuri
    Signed-off-by: Eric Van Hensbergen

    Venkateswararao Jujjuri (JV)
     
  • Synopsis

    size[4] TReadlink tag[2] fid[4]
    size[4] RReadlink tag[2] target[s]

    Description
    Readlink is used to return the contents of the symoblic link
    referred by fid. Contents of symboic link is returned as a
    response.

    target[s] - Contents of the symbolic link referred by fid.

    Signed-off-by: M. Mohan Kumar
    Reviewed-by: Aneesh Kumar K.V
    Signed-off-by: Venkateswararao Jujjuri
    Signed-off-by: Eric Van Hensbergen

    M. Mohan Kumar
     
  • Synopsis

    size[4] TGetlock tag[2] fid[4] getlock[n]
    size[4] RGetlock tag[2] getlock[n]

    Description

    TGetlock is used to test for the existence of byte range posix locks on a file
    identified by given fid. The reply contains getlock structure. If the lock could
    be placed it returns F_UNLCK in type field of getlock structure. Otherwise it
    returns the details of the conflicting locks in the getlock structure

    getlock structure:
    type[1] - Type of lock: F_RDLCK, F_WRLCK
    start[8] - Starting offset for lock
    length[8] - Number of bytes to check for the lock
    If length is 0, check for lock in all bytes starting at the location
    'start' through to the end of file
    pid[4] - PID of the process that wants to take lock/owns the task
    in case of reply
    client[4] - Client id of the system that owns the process which
    has the conflicting lock

    Signed-off-by: M. Mohan Kumar
    Signed-off-by: Aneesh Kumar K.V
    Signed-off-by: Venkateswararao Jujjuri
    Signed-off-by: Eric Van Hensbergen

    M. Mohan Kumar
     
  • Synopsis

    size[4] TLock tag[2] fid[4] flock[n]
    size[4] RLock tag[2] status[1]

    Description

    Tlock is used to acquire/release byte range posix locks on a file
    identified by given fid. The reply contains status of the lock request

    flock structure:
    type[1] - Type of lock: F_RDLCK, F_WRLCK, F_UNLCK
    flags[4] - Flags could be either of
    P9_LOCK_FLAGS_BLOCK - Blocked lock request, if there is a
    conflicting lock exists, wait for that lock to be released.
    P9_LOCK_FLAGS_RECLAIM - Reclaim lock request, used when client is
    trying to reclaim a lock after a server restrart (due to crash)
    start[8] - Starting offset for lock
    length[8] - Number of bytes to lock
    If length is 0, lock all bytes starting at the location 'start'
    through to the end of file
    pid[4] - PID of the process that wants to take lock
    client_id[4] - Unique client id

    status[1] - Status of the lock request, can be
    P9_LOCK_SUCCESS(0), P9_LOCK_BLOCKED(1), P9_LOCK_ERROR(2) or
    P9_LOCK_GRACE(3)
    P9_LOCK_SUCCESS - Request was successful
    P9_LOCK_BLOCKED - A conflicting lock is held by another process
    P9_LOCK_ERROR - Error while processing the lock request
    P9_LOCK_GRACE - Server is in grace period, it can't accept new lock
    requests in this period (except locks with
    P9_LOCK_FLAGS_RECLAIM flag set)

    Signed-off-by: M. Mohan Kumar
    Signed-off-by: Aneesh Kumar K.V
    Signed-off-by: Venkateswararao Jujjuri
    Signed-off-by: Eric Van Hensbergen

    M. Mohan Kumar
     
  • SYNOPSIS
    size[4] Tfsync tag[2] fid[4]

    size[4] Rfsync tag[2]

    DESCRIPTION

    The Tfsync transaction transfers ("flushes") all modified in-core data of
    file identified by fid to the disk device (or other permanent storage
    device) where that file resides.

    Signed-off-by: Venkateswararao Jujjuri
    Signed-off-by: Eric Van Hensbergen

    Venkateswararao Jujjuri (JV)
     
  • Signed-off-by: Venkateswararao Jujjuri
    Signed-off-by: Eric Van Hensbergen

    jvrao
     
  • Signed-off-by: Arun R Bharadwaj
    Signed-off-by: Venkateswararao Jujjuri
    Signed-off-by: Eric Van Hensbergen

    Arun R Bharadwaj
     

21 Oct, 2010

1 commit

  • Make p9_client_version static since only used in one file.
    Remove p9_client_auth because it is defined but never used.
    Compile tested only.

    Signed-off-by: Stephen Hemminger
    Signed-off-by: David S. Miller

    stephen hemminger
     

07 Oct, 2010

1 commit